Messages in this thread Patch in this message | | | Date | Sun, 24 Jan 1999 16:25:03 +0100 (CET) | From | Gerd Knorr <> | Subject | [patch] msp3400 bugfix |
| |
Hi !
This one fixes the bttv hangs in pre7+. It is build against xawtv's driver version, but it fits into the standard kernel too (with a few offsets).
Gerd
------------------------- cut here ------------------------------ diff -urN /tmp/xawtv-2.34/bttv/driver/msp3400.c xawtv-2.35/bttv/driver/msp3400.c --- /tmp/xawtv-2.34/bttv/driver/msp3400.c Fri Jan 15 20:49:48 1999 +++ xawtv-2.35/bttv/driver/msp3400.c Sun Jan 24 15:30:20 1999 @@ -83,7 +83,7 @@ /* thread */ struct task_struct *thread; - struct semaphore *wait; + struct wait_queue *wq; struct semaphore *notify; int active,restart,rmmod; @@ -559,14 +565,12 @@ { struct msp3400c *msp = (struct msp3400c*)data; /* XXX alpha ??? */ - if (!msp->active) - up(msp->wait); + wake_up_interruptible(&msp->wq); } static int msp3400c_thread(void *data) { struct msp3400c *msp = data; - struct semaphore sem = MUTEX_LOCKED; struct CARRIER_DETECT *cd; int count, max1,max2,val1,val2, val,this; @@ -583,7 +587,7 @@ current->fs->umask = 0; strcpy(current->comm,"msp3400"); - msp->wait = &sem; + msp->wq = NULL; msp->thread = current; #ifdef __SMP__ @@ -599,7 +603,7 @@ goto done; if (debug > 1) printk("msp3400: thread: sleep\n"); - down_interruptible(&sem); + interruptible_sleep_on(&msp->wq); if (debug > 1) printk("msp3400: thread: wakeup\n"); if (msp->rmmod || signal_pending(current)) @@ -776,7 +780,6 @@ done: dprintk("msp3400: thread: exit\n"); - msp->wait = NULL; msp->active = 0; msp->thread = NULL; @@ -1113,12 +1116,12 @@ /* startup control thread */ MOD_INC_USE_COUNT; + msp->wq = NULL; msp->notify = &sem; kernel_thread(msp3400c_thread, (void *)msp, 0); down(&sem); msp->notify = NULL; - if (!msp->active) - up(msp->wait); + wake_up_interruptible(&msp->wq); printk(KERN_INFO "msp3400: init: chip=%s",device->name); if (msp->nicam) @@ -1150,8 +1153,7 @@ { msp->notify = &sem; msp->rmmod = 1; - if (!msp->active) - up(msp->wait); + wake_up_interruptible(&msp->wq); down(&sem); msp->notify = NULL; } @@ -1199,10 +1201,9 @@ /* channels switching step two -- trigger sound carrier scan */ msp->watch_stereo=0; del_timer(&msp->wake_stereo); - if (!msp->active) - up(msp->wait); - else + if (msp->active) msp->restart = 1; + wake_up_interruptible(&msp->wq); break; case MSP_GET_VOLUME:
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |