Re: [patch] Fix suspend of the kseriod thread

Vojtech Pavlik (vojtech@suse.cz)
Wed, 31 Jul 2002 12:10:54 +0200


On Wed, Jul 31, 2002 at 11:07:21AM +0100, David Woodhouse wrote:

> vojtech@suse.cz said:
> > Ok. Is the use in drivers/input/serio.c buggy?
>
> If it matters that the thread can miss wakeup events and sleep indefinitely
> while there's a 'SERIO_RESCAN' event pending, then yes it looks buggy.
>
> serio_thread() serio_rescan()
> -------------- --------------
>
> serio_handle_events();
> serio->event |= SERIO_RESCAN;
> wake_up(&serio_wait);
> sleep_on(&serio_wait);
>
> ...sleeps...
>
> If both serio_thread() and serio_rescan() hold the BKL you're OK. It looks
> like serio_rescan() doesn't, though.

Thanks for the explanation. Yes, this could happen.

> > What should be it replaced with?
>
> In general, the response 'anything but sleep_on' is considered appropriate.
> Try wait_event().

-- 
Vojtech Pavlik
SuSE Labs
-
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/