PM / Runtime: Add synchronous runtime interface for interrupt handlers (v3)
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 30 Nov 2010 23:14:42 +0000 (00:14 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Fri, 24 Dec 2010 14:02:41 +0000 (15:02 +0100)
commitc7b61de5b7b17f0df34dc7d2f8b9576f8bd36fce
treed8cf6be1aab175839973d2c76060bd41d65b2ed5
parent5262a47502adcfc3a64403120768f528418a3b79
PM / Runtime: Add synchronous runtime interface for interrupt handlers (v3)

This patch (as1431c) makes the synchronous runtime-PM interface
suitable for use in interrupt handlers.  Subsystems can call the new
pm_runtime_irq_safe() function to tell the PM core that a device's
runtime_suspend and runtime_resume callbacks should be invoked with
interrupts disabled and the spinlock held.  This permits the
pm_runtime_get_sync() and the new pm_runtime_put_sync_suspend()
routines to be called from within interrupt handlers.

When a device is declared irq-safe in this way, the PM core increments
the parent's usage count, so the parent will never be runtime
suspended.  This prevents difficult situations in which an irq-safe
device can't resume because it is forced to wait for its non-irq-safe
parent.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Documentation/power/runtime_pm.txt
drivers/base/power/runtime.c
include/linux/pm.h
include/linux/pm_runtime.h