diff mbox

au0828: Cancel stream-restart operation if frontend is disconnected

Message ID 1399611251-7746-1-git-send-email-cb.xiong@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

From: Changbing Xiong <cb.xiong@samsung.com>

If the tuner is already disconnected, It is meaningless to go on doing the
stream-restart operation, It is better to cancel this operation.

Signed-off-by: Changbing Xiong <cb.xiong@samsung.com>
---
 drivers/media/usb/au0828/au0828-dvb.c |    2 ++
 1 file changed, 2 insertions(+)
 mode change 100644 => 100755 drivers/media/usb/au0828/au0828-dvb.c

--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Mauro Carvalho Chehab May 9, 2014, 8:12 a.m. UTC | #1
Em Fri, 09 May 2014 12:54:11 +0800
Changbing Xiong@pop3.w2.samsung.net escreveu:

> From: Changbing Xiong <cb.xiong@samsung.com>
> 
> If the tuner is already disconnected, It is meaningless to go on doing the
> stream-restart operation, It is better to cancel this operation.
> 
> Signed-off-by: Changbing Xiong <cb.xiong@samsung.com>
> ---
>  drivers/media/usb/au0828/au0828-dvb.c |    2 ++
>  1 file changed, 2 insertions(+)
>  mode change 100644 => 100755 drivers/media/usb/au0828/au0828-dvb.c
> 
> diff --git a/drivers/media/usb/au0828/au0828-dvb.c b/drivers/media/usb/au0828/au0828-dvb.c
> old mode 100644
> new mode 100755
> index 9a6f156..fd8e798
> --- a/drivers/media/usb/au0828/au0828-dvb.c
> +++ b/drivers/media/usb/au0828/au0828-dvb.c
> @@ -403,6 +403,8 @@ void au0828_dvb_unregister(struct au0828_dev *dev)
>  	if (dvb->frontend == NULL)
>  		return;
> 
> +	cancel_work_sync(&dev->restart_streaming);
> +
>  	dvb_net_release(&dvb->net);
>  	dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem);
>  	dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw);

Seems ok on my eyes.

Btw, I think we should also call cancel_work_sync() on other
places. On some tests I did with this frontend last week, things
sometimes get badly when switching from one channel to another one,
or doing channel scan.

This thread could be the culprit. Unfortunately, I can't test it
ATM, as I'm in a business trip this week.

Anyway, from a theoretical perspective, it seems logical that
call cancel_work_sync() should also be called when:
	- stop_urb_transfer() is called;
	- when a new tuning starts.

For the second one, the patch should be somewhat similar to what 
cx23885_set_frontend_hook() does, e. g. hooking the 
fe->ops.set_frontend, in order to call cancel_work_sync() before setting
the frontend parameters for the next frequency to zap. Due to the 
DVB zigzag algorithm, I suspect that this could even improve channel
scanning.

Devin,

What do you think?

Thanks,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/usb/au0828/au0828-dvb.c b/drivers/media/usb/au0828/au0828-dvb.c
old mode 100644
new mode 100755
index 9a6f156..fd8e798
--- a/drivers/media/usb/au0828/au0828-dvb.c
+++ b/drivers/media/usb/au0828/au0828-dvb.c
@@ -403,6 +403,8 @@  void au0828_dvb_unregister(struct au0828_dev *dev)
 	if (dvb->frontend == NULL)
 		return;

+	cancel_work_sync(&dev->restart_streaming);
+
 	dvb_net_release(&dvb->net);
 	dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem);
 	dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw);