From a1c592b766ee94aaf0e2549b8ba4d0298c328484 Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Sun, 5 Sep 2010 09:49:43 -0300 Subject: [PATCH] [media] saa7164: saa7164-buffer.c line 274 bugfix Mark buffers free when the dvb dma engine stops. Signed-off-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/saa7164/saa7164-dvb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/media/video/saa7164/saa7164-dvb.c b/drivers/media/video/saa7164/saa7164-dvb.c index 2d21c01dea29..b305a01b3bde 100644 --- a/drivers/media/video/saa7164/saa7164-dvb.c +++ b/drivers/media/video/saa7164/saa7164-dvb.c @@ -143,6 +143,8 @@ static int saa7164_dvb_pause_port(struct saa7164_port *port) static int saa7164_dvb_stop_streaming(struct saa7164_port *port) { struct saa7164_dev *dev = port->dev; + struct saa7164_buffer *buf; + struct list_head *p, *q; int ret; dprintk(DBGLVL_DVB, "%s(port=%d)\n", __func__, port->nr); @@ -151,6 +153,14 @@ static int saa7164_dvb_stop_streaming(struct saa7164_port *port) ret = saa7164_dvb_acquire_port(port); ret = saa7164_dvb_stop_port(port); + /* Mark the hardware buffers as free */ + mutex_lock(&port->dmaqueue_lock); + list_for_each_safe(p, q, &port->dmaqueue.list) { + buf = list_entry(p, struct saa7164_buffer, list); + buf->flags = SAA7164_BUFFER_FREE; + } + mutex_unlock(&port->dmaqueue_lock); + return ret; } -- 2.39.5