sleep/wakeup macros was designed to do it on random address in the stack.
This random address can be matched (with some probability) with another sleep addresses from other drivers, which can cause strange sleep/wakeup sequence. Rewrite this ugly code to do the right thing.
This commit is contained in:
parent
2f055e7f0f
commit
ad0738fce4
@ -188,16 +188,15 @@ struct snd_wait {
|
||||
*/
|
||||
#define DO_SLEEP(q, f, time_limit) \
|
||||
{ \
|
||||
int flag, chn; \
|
||||
int flag; \
|
||||
f.mode = WK_SLEEP; \
|
||||
q = &chn; \
|
||||
flag=tsleep((caddr_t) &chn, (PRIBIO-5)|PCATCH, "sndint", time_limit); \
|
||||
flag=tsleep((caddr_t) &q, (PRIBIO-5)|PCATCH, "sndint", time_limit); \
|
||||
if(flag == ERESTART) f.aborting = 1;\
|
||||
else f.aborting = 0;\
|
||||
f.mode &= ~WK_SLEEP; \
|
||||
}
|
||||
/* An the following wakes up a process */
|
||||
#define WAKE_UP(q, f) {f.mode = WK_WAKEUP;wakeup((caddr_t) q);}
|
||||
#define WAKE_UP(q, f) {f.mode = WK_WAKEUP;wakeup((caddr_t) &q);}
|
||||
|
||||
/*
|
||||
* Timing macros. This driver assumes that there is a timer running in the
|
||||
|
Loading…
Reference in New Issue
Block a user