Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] [PATCH] stop fe thread without FE_SLEEP if shutdown timeout is 0



Hi.

When dvb_shutdown_timeout is 0, then the kernel fe thread is not
stopped, when an application closes the frontend device. However, if the
device is opened again, then the thread will be stopped and a new one
will be created. So why not just skip FE_SLEEP and quit the thread
immediately?

I made this patch because killing my application made the kernel thread
start zigzagging (and it never stopped), because it sent a diseqc
standby command which somehow made the frontend lose lock (although i do
not use diseqc devices except for the frontend itself). This patch
unfortunatly does not prevent loss of lock in this case, but at least it
stops zigzagging around. :)

Does this have any drawbacks?

Regards,
Andreas

--- dvb_frontend.c	10 Dec 2002 15:54:27 -0000	1.1
+++ dvb_frontend.c	12 Dec 2002 02:34:54 -0000
@@ -418,7 +418,7 @@ int dvb_frontend_is_exiting (struct dvb_
 	if (fe->exit)
 		return 1;
 
-	if (fe->dvbdev->users == 1 && dvb_shutdown_timeout)
+	if (fe->dvbdev->users == 1)
 		if (jiffies - fe->release_jiffies > dvb_shutdown_timeout * HZ)
 			return 1;
 
@@ -492,7 +492,9 @@ int dvb_frontend_thread (void *data)
 			dvb_frontend_add_event (fe, s);
 	};
 
-	dvb_frontend_internal_ioctl (&fe->frontend, FE_SLEEP, NULL); 
+	if (dvb_shutdown_timeout)
+		dvb_frontend_internal_ioctl (&fe->frontend, FE_SLEEP, NULL); 
+
 	up (&fe->sem);
 	fe->thread = NULL;
 	return 0;





-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index