summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/dvb-core
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@kernellabs.com>2009-05-04 20:43:02 -0400
committerDevin Heitmueller <dheitmueller@kernellabs.com>2009-05-04 20:43:02 -0400
commit3165ca2068855d7118d78396adce4c49a4e7f636 (patch)
tree4bc7753df2cdf82d13a2881c56096b5d6ab1ac43 /linux/drivers/media/dvb/dvb-core
parenta7dc2838bf1a5069828ca5a4f9e7a35916c95f7e (diff)
downloadmediapointer-dvb-s2-3165ca2068855d7118d78396adce4c49a4e7f636.tar.gz
mediapointer-dvb-s2-3165ca2068855d7118d78396adce4c49a4e7f636.tar.bz2
dvb_frontend: fix race condition resulting in dropped tuning commands
From: Devin Heitmueller <dheitmueller@kernellabs.com> A race condition was detected in the case that putting the tuner to sleep takes an unusually long period of time, combined with applications that quickly close/open the dvb frontend. The kaffeine channel scanner closes and reopens the dvb frontend between each tuning attempt. If it takes an unusually longer period of time to put the tuner to sleep (for example, the Pinnacle 801e takes 660 ms), the dvb_frontend thread will still be in a running state (and hence fepriv->thread is still set) but the fepriv->exit field will still be zero. As a result, if a dvb_frontend_start() call arrives while the frontend thread is in the process of terminating, the call will return 0 without actually starting a new thread. This results in the tuning request being dropped. To address this, mark fepriv->exit as soon as we know the thread is going to be terminated, so that dvb_frontend_start() knows to start a new instance. Problem encountered with Kaffeine 0.8.7 doing ATSC scanning against the Pinnacle 801e tuner, in conjunction with new code to power down the xc5000 when not in use. Priority: normal Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_frontend.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
index da2890b22..d359f6841 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -554,6 +554,7 @@ restart:
if (kthread_should_stop() || dvb_frontend_is_exiting(fe)) {
/* got signal or quitting */
+ fepriv->exit = 1;
break;
}