Messages in this thread Patch in this message | ![/](/images/icornerl.gif) | | Date | Wed, 23 Jun 2004 15:23:04 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH] HPET driver |
| |
Jeff Garzik <jgarzik@pobox.com> wrote: > > > I eliminated the request_irq brain damage, eliminated procfs support, > > made the check for FMODE_WRITE in hpet_open and responded to a few > > other suggestions. > > Thanks! I'll look over it too.
Here's one fixlet against Robert's fixes:
- Need to set TASK_INTERRUPTIBLE before checking devp->hd_irqdata. Otherwise the wakeup from hpet_interrupt() could be missed.
Signed-off-by: Andrew Morton <akpm@osdl.org> ---
25-akpm/drivers/char/hpet.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-)
diff -puN drivers/char/hpet.c~hpet-fixes-fix drivers/char/hpet.c --- 25/drivers/char/hpet.c~hpet-fixes-fix Wed Jun 23 14:38:16 2004 +++ 25-akpm/drivers/char/hpet.c Wed Jun 23 14:38:16 2004 @@ -196,7 +196,8 @@ hpet_read(struct file *file, char *buf, add_wait_queue(&devp->hd_waitqueue, &wait); - do { + for ( ; ; ) { + set_current_state(TASK_INTERRUPTIBLE); spin_lock_irq(&hpet_lock); data = devp->hd_irqdata; devp->hd_irqdata = 0; @@ -211,17 +212,14 @@ hpet_read(struct file *file, char *buf, retval = -ERESTARTSYS; goto out; } - - set_current_state(TASK_INTERRUPTIBLE); schedule(); - - } while (1); + } retval = put_user(data, (unsigned long *)buf); if (!retval) retval = sizeof(unsigned long); - out: - current->state = TASK_RUNNING; +out: + __set_current_state(TASK_RUNNING) remove_wait_queue(&devp->hd_waitqueue, &wait); return retval; _ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |