Messages in this thread | | | From | Kevin Hilman <> | Subject | Re: [PATCH v2] PM: runtime: add might_sleep to PM runtime functions | Date | Tue, 26 Jul 2011 17:26:42 -0700 |
| |
Colin Cross <ccross@android.com> writes:
> Some of the entry points to pm runtime are not safe to > call in atomic context unless pm_runtime_irq_safe() has > been called. Inspecting the code, it is not immediately > obvious that the functions sleep at all, as they run > inside a spin_lock_irqsave, but under some conditions > they can drop the lock and turn on irqs. > > If a driver incorrectly calls the pm_runtime apis, it can > cause sleeping and irq processing when it expects to stay > in atomic context. > > Add might_sleep_if to all the __pm_runtime_* entry points > to enforce correct usage.
Minor: s/all/most of/, or something similar since in v2, it doesn't annotate all of the functions anymore, just the main ones likely to be (mis)used by drivers.
Other than that, looks good...
> Add pm_runtime_put_sync_autosuspend to the list of > functions that can be called in atomic context. > > Signed-off-by: Colin Cross <ccross@android.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Kevin
| |