lkml.org 
[lkml]   [1999]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] msp3400 (bttv), new semaphores
Hi,

msp3400 uses a semaphore to sleep. With the new owner, owner_depth scheme
introduced in pre8 this does not function anymore the way it did. The function
wanted can be regained with the patch attached. It reinitializes the semaphore
and therefore it zero's the owner field.

Linus, is this change wanted? Will it remain the way it is now? Are there other
places where semaphores are used this way? Will they show up before 2.2 is
released? Should the new semaphore scheme with owners be renamed to owner_down
and owner_down_interruptible?

Without the patch it goes like this:

msp_thread:
calls down

other:
calls up

msp_thread:
wakes up
sets owner and owner_depth
does useful things

msp_thread:
loop:
calls down
wakes up immediatly because owner == this_thread && owner_depth
does random things, eat cpu
goto loop


--
»»»» Harald Hoyer ««»» mailto:HarryH@Royal.Net ««»» http://hot.spotline.de ««««
···············································································
Algol-60 surely must be regarded as the most important programming language
yet developed.
-- T. Cheatham--- drivers/char/msp3400.c.old Thu Jan 21 11:29:14 1999
+++ drivers/char/msp3400.c Thu Jan 21 11:29:26 1999
@@ -543,7 +543,8 @@
goto done;
if (debug > 1)
printk("msp3400: thread: sleep\n");
- down_interruptible(&sem);
+ down_interruptible(&sem);
+ sem = MUTEX_LOCKED;
if (debug > 1)
printk("msp3400: thread: wakeup\n");
if (msp->rmmod || signal_pending(current))
\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.015 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site