<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/power/runtime.c, branch v3.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.1</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2011-08-05T19:45:20Z</updated>
<entry>
<title>PM / Runtime: Allow _put_sync() from interrupts-disabled context</title>
<updated>2011-08-05T19:45:20Z</updated>
<author>
<name>Kevin Hilman</name>
<email>khilman@ti.com</email>
</author>
<published>2011-08-05T19:45:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=02b26774afebb2d62695ba3230319d70d8c6cc2d'/>
<id>urn:sha1:02b26774afebb2d62695ba3230319d70d8c6cc2d</id>
<content type='text'>
Currently the use of pm_runtime_put_sync() is not safe from
interrupts-disabled context because rpm_idle() will release the
spinlock and enable interrupts for the idle callbacks.  This enables
interrupts during a time where interrupts were expected to be
disabled, and can have strange side effects on drivers that expected
interrupts to be disabled.

This is not a bug since the documentation clearly states that only
_put_sync_suspend() is safe in IRQ-safe mode.

However, pm_runtime_put_sync() could be made safe when in IRQ-safe
mode by releasing the spinlock but not re-enabling interrupts, which
is what this patch aims to do.

Problem was found when using some buggy drivers that set
pm_runtime_irq_safe() and used _put_sync() in interrupts-disabled
context.

Reported-by: Colin Cross &lt;ccross@google.com&gt;
Tested-by: Nishanth Menon &lt;nm@ti.com&gt;
Signed-off-by: Kevin Hilman &lt;khilman@ti.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM / Runtime: Consistent utilization of deferred_resume</title>
<updated>2011-07-08T18:53:55Z</updated>
<author>
<name>ShuoX Liu</name>
<email>shuox.liu@intel.com</email>
</author>
<published>2011-07-08T18:53:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2cffff1281a74714c9e035322077ec52ffb1f838'/>
<id>urn:sha1:2cffff1281a74714c9e035322077ec52ffb1f838</id>
<content type='text'>
dev-&gt;power.deferred_resume is used as a bool typically, so change
one assignment to false from 0, like other places.

Signed-off-by: ShuoX Liu &lt;shuox.liu@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / Runtime: Replace "run-time" with "runtime" in documentation</title>
<updated>2011-07-06T08:52:13Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2011-07-06T08:52:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=62052ab1d1a456f5f62f8b753e12d10ca1a83604'/>
<id>urn:sha1:62052ab1d1a456f5f62f8b753e12d10ca1a83604</id>
<content type='text'>
The runtime PM documentation and kerneldoc comments sometimes spell
"runtime" with a dash (i.e. "run-time").  Replace all of those
instances with "runtime" to make the naming consistent.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM / Runtime: Return special error code if runtime PM is disabled</title>
<updated>2011-07-02T12:30:10Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2011-07-01T20:29:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=632e270e01d8a1ee9e8ea56c83028727f17b1d17'/>
<id>urn:sha1:632e270e01d8a1ee9e8ea56c83028727f17b1d17</id>
<content type='text'>
Some callers of pm_runtime_get_sync() and other runtime PM helper
functions, scsi_autopm_get_host() and scsi_autopm_get_device() in
particular, need to distinguish error codes returned when runtime PM
is disabled (i.e. power.disable_depth is nonzero for the given
device) from error codes returned in other situations.  For this
reason, make the runtime PM helper functions return -EACCES when
power.disable_depth is nonzero and ensure that this error code
won't be returned by them in any other circumstances.  Modify
scsi_autopm_get_host() and scsi_autopm_get_device() to check the
error code returned by pm_runtime_get_sync() and ignore -EACCES.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>PM / Domains: Rename struct dev_power_domain to struct dev_pm_domain</title>
<updated>2011-07-02T12:29:54Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2011-06-22T23:52:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=564b905ab10d17fb42f86aa8b7b9b796276d1336'/>
<id>urn:sha1:564b905ab10d17fb42f86aa8b7b9b796276d1336</id>
<content type='text'>
The naming convention used by commit 7538e3db6e015e890825fbd9f86599b
(PM: Add support for device power domains), which introduced the
struct dev_power_domain type for representing device power domains,
evidently confuses some developers who tend to think that objects
of this type must correspond to "power domains" as defined by
hardware, which is not the case.  Namely, at the kernel level, a
struct dev_power_domain object can represent arbitrary set of devices
that are mutually dependent power management-wise and need not belong
to one hardware power domain.  To avoid that confusion, rename struct
dev_power_domain to struct dev_pm_domain and rename the related
pointers in struct device and struct pm_clk_notifier_block from
pwr_domain to pm_domain.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Kevin Hilman &lt;khilman@ti.com&gt;
</content>
</entry>
<entry>
<title>PM: Make power domain callbacks take precedence over subsystem ones</title>
<updated>2011-04-28T22:35:50Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2011-04-28T22:35:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4d27e9dcff00a6425d779b065ec8892e4f391661'/>
<id>urn:sha1:4d27e9dcff00a6425d779b065ec8892e4f391661</id>
<content type='text'>
Change the PM core's behavior related to power domains in such a way
that, if a power domain is defined for a given device, its callbacks
will be executed instead of and not in addition to the device
subsystem's PM callbacks.

The idea behind the initial implementation of power domains handling
by the PM core was that power domain callbacks would be executed in
addition to subsystem callbacks, so that it would be possible to
extend the subsystem callbacks by using power domains.  It turns out,
however, that this wouldn't be really convenient in some important
situations.

For example, there are systems in which power can only be removed
from entire power domains.  On those systems it is not desirable to
execute device drivers' PM callbacks until it is known that power is
going to be removed from the devices in question, which means that
they should be executed by power domain callbacks rather then by
subsystem (e.g. bus type) PM callbacks, because subsystems generally
have no information about what devices belong to which power domain.
Thus, for instance, if the bus type in question is the platform bus
type, its PM callbacks generally should not be called in addition to
power domain callbacks, because they run device drivers' callbacks
unconditionally if defined.

While in principle the default subsystem PM callbacks, or a subset of
them, may be replaced with different functions, it doesn't seem
correct to do so, because that would change the subsystem's behavior
with respect to all devices in the system, regardless of whether or
not they belong to any power domains.  Thus, the only remaining
option is to make power domain callbacks take precedence over
subsystem callbacks.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Acked-by: Kevin Hilman &lt;khilman@ti.com&gt;
</content>
</entry>
<entry>
<title>Fix common misspellings</title>
<updated>2011-03-31T14:26:23Z</updated>
<author>
<name>Lucas De Marchi</name>
<email>lucas.demarchi@profusion.mobi</email>
</author>
<published>2011-03-31T01:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=25985edcedea6396277003854657b5f3cb31a628'/>
<id>urn:sha1:25985edcedea6396277003854657b5f3cb31a628</id>
<content type='text'>
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi &lt;lucas.demarchi@profusion.mobi&gt;
</content>
</entry>
<entry>
<title>PM: Make system-wide PM and runtime PM treat subsystems consistently</title>
<updated>2011-03-14T23:43:17Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2011-02-18T22:20:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9659cc0678b954f187290c6e8b247a673c5d37e1'/>
<id>urn:sha1:9659cc0678b954f187290c6e8b247a673c5d37e1</id>
<content type='text'>
The code handling system-wide power transitions (eg. suspend-to-RAM)
can in theory execute callbacks provided by the device's bus type,
device type and class in each phase of the power transition.  In
turn, the runtime PM core code only calls one of those callbacks at
a time, preferring bus type callbacks to device type or class
callbacks and device type callbacks to class callbacks.

It seems reasonable to make them both behave in the same way in that
respect.  Moreover, even though a device may belong to two subsystems
(eg. bus type and device class) simultaneously, in practice power
management callbacks for system-wide power transitions are always
provided by only one of them (ie. if the bus type callbacks are
defined, the device class ones are not and vice versa).  Thus it is
possible to modify the code handling system-wide power transitions
so that it follows the core runtime PM code (ie. treats the
subsystem callbacks as mutually exclusive).

On the other hand, the core runtime PM code will choose to execute,
for example, a runtime suspend callback provided by the device type
even if the bus type's struct dev_pm_ops object exists, but the
runtime_suspend pointer in it happens to be NULL.  This is confusing,
because it may lead to the execution of callbacks from different
subsystems during different operations (eg. the bus type suspend
callback may be executed during runtime suspend of the device, while
the device type callback will be executed during system suspend).

Make all of the power management code treat subsystem callbacks in
a consistent way, such that:
(1) If the device's type is defined (eg. dev-&gt;type is not NULL)
    and its pm pointer is not NULL, the callbacks from dev-&gt;type-&gt;pm
    will be used.
(2) If dev-&gt;type is NULL or dev-&gt;type-&gt;pm is NULL, but the device's
    class is defined (eg. dev-&gt;class is not NULL) and its pm pointer
    is not NULL, the callbacks from dev-&gt;class-&gt;pm will be used.
(3) If dev-&gt;type is NULL or dev-&gt;type-&gt;pm is NULL and dev-&gt;class is
    NULL or dev-&gt;class-&gt;pm is NULL, the callbacks from dev-&gt;bus-&gt;pm
    will be used provided that both dev-&gt;bus and dev-&gt;bus-&gt;pm are
    not NULL.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Kevin Hilman &lt;khilman@ti.com&gt;
Reasoning-sounds-sane-to: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>PM: Add support for device power domains</title>
<updated>2011-03-14T23:43:16Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2011-02-16T20:53:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7538e3db6e015e890825fbd9f8659952896ddd5b'/>
<id>urn:sha1:7538e3db6e015e890825fbd9f8659952896ddd5b</id>
<content type='text'>
The platform bus type is often used to handle Systems-on-a-Chip (SoC)
where all devices are represented by objects of type struct
platform_device.  In those cases the same "platform" device driver
may be used with multiple different system configurations, but the
actions needed to put the devices it handles into a low-power state
and back into the full-power state may depend on the design of the
given SoC.  The driver, however, cannot possibly include all the
information necessary for the power management of its device on all
the systems it is used with.  Moreover, the device hierarchy in its
current form also is not suitable for representing this kind of
information.

The patch below attempts to address this problem by introducing
objects of type struct dev_power_domain that can be used for
representing power domains within a SoC.  Every struct
dev_power_domain object provides a sets of device power
management callbacks that can be used to perform what's needed for
device power management in addition to the operations carried out by
the device's driver and subsystem.

Namely, if a struct dev_power_domain object is pointed to by the
pwr_domain field in a struct device, the callbacks provided by its
ops member will be executed in addition to the corresponding
callbacks provided by the device's subsystem and driver during all
power transitions.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Tested-and-acked-by: Kevin Hilman &lt;khilman@ti.com&gt;
</content>
</entry>
<entry>
<title>PM / Runtime: Don't enable interrupts while running in_interrupt</title>
<updated>2011-01-25T19:50:07Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2011-01-25T19:50:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c3810c88788d505d4ffd786addd111b745e42161'/>
<id>urn:sha1:c3810c88788d505d4ffd786addd111b745e42161</id>
<content type='text'>
This patch (as1445) fixes a bug in the runtime PM core left over from
the addition of the no_callbacks flag.  If this flag is set then it is
possible for rpm_suspend() to be called in_interrupt, so when
releasing spinlocks it's important not to re-enable interrupts.

To avoid an unnecessary save-and-restore of the interrupt flag, the
patch also inlines a pm_request_idle() call.

This fixes Bugzilla #27482.

(The offending code was added in 2.6.37, so it's not necessary to apply
this to any earlier stable kernels.)

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: tim blechmann &lt;tim@klingt.org&gt;
CC: &lt;stable@kernel.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
</feed>
