Mauro Carvalho Chehab schrieb: > Em Sat, 07 Nov 2009 15:05:02 +0100 > e9hack <e9hack@xxxxxxxxxxxxxx> escreveu: > >> Mauro Carvalho Chehab schrieb: >> >>> I agree. We need first to stop DMA activity, and then release the page tables. >>> >>> Could you please test if the enclosed patch fixes the issue? >> Hi Mauro, >> >> your patch doesn't solve the problem, because saa7146_dma_free() doesn't stop a running >> dma transfer of the saa7146. > > Well, it should be stopping it. The logic is to wait for an incoming dma > transfer and then disable dma transfers: > > void saa7146_dma_free(struct saa7146_dev *dev,struct videobuf_queue *q, > struct saa7146_buf *buf) > { > struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); > DEB_EE(("dev:%p, buf:%p\n",dev,buf)); > > BUG_ON(in_interrupt()); > > videobuf_waiton(&buf->vb,0,0); > videobuf_dma_unmap(q, dma); > videobuf_dma_free(dma); > buf->vb.state = VIDEOBUF_NEEDS_INIT; > } In my case, videobuf_queue_cancel() is called previously. videobuf_queue_cancel() wakes up all buffers, but it doesn't handle the currently by the saa7146 used buffer. queue->curr points to this buffer. Waiting for an incoming dma transfer in saa7146_dma_free() has no effect for such a buffer. Regards, Hartmut -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html