Re: dma hardware underrun



On Sun, 22 Jul 2007 22:14:24 +0800, treul <lgijnpuhx@xxxxxxxxx> wrote:

I'm currently experiencing a tough DMA underrun problem.

The system is like:

global bus
||
data-compressor ------||------//---- memory
IDE-PCI harddisk -----||
data-decompressor ----||
data-consumer --------||
||

1. harddisk has the compressed data, read to compressed buffer by DMA1;
2. data-decompressor gets data from compressed buffer by DMA2, and puts
decompressed data to decompressed buffers in ISR;
3. data-consumer eats the decompressed data at an uncompromisable speed;

The data-consumer encounters DMA underrun...

Assuming this is an Intel-based system...

Have you tried turning IDE interrupt unmasking on/off with hdparm (the
-u switch)? It could be that the IDE device disables interrupts for too
long, or alternatively that something else is causing excessive latency
(maybe data-decompressor is doing programmed I/O in the ISR?).

That command masks/unmasks other interrupts during the IDE one, which
works on virtually all modern hardware but used to cause problems on
some back in the day.

You don't say what kernel you are using but SATA uses libata whereas IDE
has in the past used a different driver. That might explain why it
works with SATA. Perhaps the libata driver is just more efficient or
has a different pattern of interrupt masking/unmasking.

Also, how is data-decompressor's driver written? Is it copying and/or
decompressing a lot of data in the ISR? How long does that take, and
are other interrupts disabled during that time?

As for the printf's in the interrupt handler, probably you are just
preventing data-consumer from running as often as it normally would. It
is likely hiding the problem rather than fixing it.


--
-| Bob Hauck
-| "Reality has a well-known liberal bias." -- Stephen Colbert
-| http://www.haucks.org/
.



Relevant Pages

  • Re: IDE cdrom problem with PLEXTOR DVDR PX-608AL
    ... Actually the interrupt handler in ide-cd got rewritten and you're still using the ... IDE device, a Pioneer DVR-115D DVD-ROM, hooked up to the JMicron IDE port. ... With the IDE driver compiled into the kernel any access to the DVD is fine ...
    (Linux-Kernel)
  • RE: [BUG] ide dma_timer_expiry, then hard lockup
    ... I think reading the IDE status register clears the interrupt in the IDE ... Perhaps a printk in the IDE IRQ handler would be informative? ... the printk before the readb() is printed, ...
    (Linux-Kernel)
  • [PATCH v2 -rt] ide: workaround buggy hardware issues with preemptable hardirqs
    ... IDE interrupt handler relies on the fact that, if necessary, hardirqs ... 100% native mode on irq 18 ... It would be great to re-configure the ULi bridge or ULi IDE controller ...
    (Linux-Kernel)
  • Re: [BUG] ide dma_timer_expiry, then hard lockup
    ... This is not how IDE drives are supposed to act -- they won't proceed any ... further until "interrupt pending" condition is cleared, ... I'm thinking that trying to debug libata is a better idea, ...
    (Linux-Kernel)
  • Re: PIIX4 DMA Timeout
    ... you had to wire IDE interrupt lines to motherboard interrupt ... LynxOS has been run successfully on this board, and we want port it to Linux recently. ... The I/O BAR has been configured, though I have to admit the values set ...
    (Linux-Kernel)