Re: [PATCH] PM: runtime: add might_sleep to PM runtime functions

From: Alan Stern
Date: Sat Jul 23 2011 - 21:42:00 EST


On Sat, 23 Jul 2011, Colin Cross wrote:

> On Sat, Jul 23, 2011 at 3:57 PM, Rafael J. Wysocki <rjw@xxxxxxx> wrote:
> > On Saturday, July 23, 2011, Colin Cross wrote:
> >> The list of functions that can be called in atomic context is
> >> non-intuitive (pm_runtime_put_sync can not, but
> >> pm_runtime_put_sync_suspend can, if pm_runtime_irq_safe has
> >> been called?).
> >
> > However, this behavior is documented.
> >
> > Also, if you have a clean use case for calling rpm_idle() with interrupts
> > off, it can be modified to work in analogy with rpm_suspend() in that respect.
>
> Yes, Kevin posted that patch in response to a bug that would never
> have existed with this patch. Even with Kevin's change, this patch
> still detects drivers that are missing pm_runtime_irq_safe().

I suggest that adding the annotations to __pm_runtime_idle(),
__pm_runtime_suspend(), and __pm_runtime_resume() is entirely
reasonable. But the annotations to __pm_runtime_disable() and
__pm_runtime_use_autosuspend() do seem unnecessary.

Alan Stern

--
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/