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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Colin Cross <ccross@xxxxxxxxxxx> 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@xxxxxxxxxxx>

Reviewed-by: Kevin Hilman <khilman@xxxxxx>

Kevin
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux