Re: [PATCH] - race-free suspend. Was: Re: [linux-pm] [PATCH 0/8]Suspend block api (version 8)

From: Dmitry Torokhov
Date: Wed Jun 02 2010 - 19:32:58 EST


On Wed, Jun 02, 2010 at 09:05:21PM +0200, Florian Mickler wrote:
> On Wed, 2 Jun 2010 21:02:24 +1000
> Neil Brown <neilb@xxxxxxx> wrote:
> >
> > And this decision (to block suspend) really needs to be made in the driver,
> > not in userspace?
>
> Well, it fits. The requirement is a direct consequence of the intimate
> knowledge the driver has about the driven devices.

That is not really true. A driver does have intimate knowledge of the
device, however it does not necessarily have an idea about the data read
from the device. Consider the gpio_matrix driver: Arve says that it has
to continue scanning matrix once first interrupt arrvies. But it really
depends on what key has been pressed - if user pressed KEY_SUSPEND or
KEY_POWER it cmight be better if we did not wait for key release but
initiated the action right away. The decision on how system reacts to a
key press does not belong to the driver but really to userspace.

--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/