I am running on an intel dual core processor system with a PVR 250 (very old) and a new PVR 150. The error observed is:
DMA Error 0x0000000b
This is may, but does not always, cause corruption in the video stream. It may even cause the system to lock (although that could be a result of reading a badly corrupted video stream). I've found it to be very easily reproducable, but only by stressing the system to its limit. To reproduce this bug reliably I have to have 2 transcodings going on while recording on one tuner and watching TV on the other. It will occur in other cases... it just takes a lot longer.
The area of interest in the code is in dma_from_device in ivtv-irq.c. This is where the error is being printed out from. The error means there was a write error. The write error is occuring exactly as one would expect (if there were to be an error). It occurs after the dma registers are written to instructing a write. It takes a bit for the card to set the DMA error, so the error doesn't occur immediatly, it occurs in the while loop which is normally waiting to see the DMA started (the DMAXFER bit to flip).
Here are some things I have tried:
-Uncommenting the DMA_locks placed around dma_from_device elswewhere in ivtv-irq.c. No effect.
-Moving the DMA_slock spinlock (Line 640) up to include the loops checking for the appropriate time to start the write. I thought this could be a race condition... but it has no effect. I also did the same in ivtv-queue.c's dma_to_device
-Checking to see if the IVTV_REG_ENCDMAADDR write isn't happening. I noticed there is a place where the code double checks to see if the register was actually written to. In my testing I never saw this register write fail. So... that's not it.
-Doing another sanity check to make absolutely sure, at the point the DMA registers are written, that the registers are of the expected value. I never saw anything unusual.
-Checking to see if there is some strange pause going on in the code. Even with all my printks I never saw more than 2 jiffies from the start of the method, to the return. This is in the error case (so it was re-trying the DMA write).
-I never saw the DMA write fail more than once in a row. It always succeeded (or at least no error is set).
-I'm not seeing any ivtv_sleep_timeouts fail.
So... I'm running out of ideas. From all appearences, there is nothing different before a successful write and a failed write. Things look the same from the point of view of the registers. The retry always succeeds... even though everything is the same. Every now and then a write appears to randomly fail, and BAM things can get really screwed up.
One question for others. Is it normal to see DMA writes fail? Or should it pretty much never happen? If the former is the case then I'll stop trying to figure out what is causing it to fail and focus on trying to find a way to recover from it.
Is there any strange implict logic going on that I'm not seeing? Stuff like reading a register changing it's state (or some other register), or any of the itv/st data structures being changed? I'm getting really paranoid :*(
Is there something different that must be done when a DMA error occurs? Is it not exceptable to just clear the DMA error bits and retry? Are there other bits that must be reset somewhere?
Thanks for any advice anyone has.
_______________________________________________ ivtv-devel mailing list [email protected] http://ivtvdriver.org/mailman/listinfo/ivtv-devel
