<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/power/common.c, branch v4.9</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=v4.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-02-03T18:10:37Z</updated>
<entry>
<title>PM: Avoid false-positive warnings in dev_pm_domain_set()</title>
<updated>2016-02-03T18:10:37Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-01-30T11:54:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e79aee49bcf9ad005b3f2f4cf68b17dc2c22d9c2'/>
<id>urn:sha1:e79aee49bcf9ad005b3f2f4cf68b17dc2c22d9c2</id>
<content type='text'>
There is a WARN_ON() in dev_pm_domain_set() that triggers on attempts
to set the pm_domain pointer for devices with a driver bound.

However, that WARN_ON() triggers on attempts to clear the pointer
too and the test it uses is based on checking the device's
p-&gt;knode_driver pointer which still is set when the device bus
type's/driver's -&gt;remove callback has been executed.  This
leads to false-positive warnings when bus type code calls
dev_pm_domain_set() to clear the pm_domain pointer after
invoking the driver's -&gt;remove() callback.

To avoid those false-positives, make dev_pm_domain_set() check
if the pointer passed to it is NULL and skip the warning in
that case.

Fixes: 989561de9b51 (PM / Domains: add setter for dev.pm_domain)
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Tested-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Tested-by: Sinan Kaya &lt;okaya@codeaurora.org&gt;
Tested-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Acked-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>PM / sleep: Go direct_complete if driver has no callbacks</title>
<updated>2016-01-08T00:12:06Z</updated>
<author>
<name>Tomeu Vizoso</name>
<email>tomeu.vizoso@collabora.com</email>
</author>
<published>2016-01-07T15:46:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aa8e54b559479d0cb7eb632ba443b8cacd20cd4b'/>
<id>urn:sha1:aa8e54b559479d0cb7eb632ba443b8cacd20cd4b</id>
<content type='text'>
If a suitable prepare callback cannot be found for a given device and
its driver has no PM callbacks at all, assume that it can go direct to
complete when the system goes to sleep.

The reason for this is that there's lots of devices in a system that do
no PM at all and there's no reason for them to prevent their ancestors
to do direct_complete if they can support it.

Signed-off-by: Tomeu Vizoso &lt;tomeu.vizoso@collabora.com&gt;
Reviewed-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / Domains: add setter for dev.pm_domain</title>
<updated>2016-01-08T00:12:06Z</updated>
<author>
<name>Tomeu Vizoso</name>
<email>tomeu.vizoso@collabora.com</email>
</author>
<published>2016-01-07T15:46:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=989561de9b5112999475b406557d9c7e9e59c041'/>
<id>urn:sha1:989561de9b5112999475b406557d9c7e9e59c041</id>
<content type='text'>
Adds a function that sets the pointer to dev_pm_domain in struct device
and that warns if the device has already finished probing. The reason
why we want to enforce that is because in the general case that can
cause problems and also that we can simplify code quite a bit if we can
always assume that.

This patch also changes all current code that directly sets the
dev.pm_domain pointer.

Signed-off-by: Tomeu Vizoso &lt;tomeu.vizoso@collabora.com&gt;
Reviewed-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / core: fix typo in documentation</title>
<updated>2016-01-01T23:34:49Z</updated>
<author>
<name>Manuel Pégourié-Gonnard</name>
<email>mpg@elzevir.fr</email>
</author>
<published>2015-12-29T10:03:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4295733eee4e69eda432d95765b7762dc6013271'/>
<id>urn:sha1:4295733eee4e69eda432d95765b7762dc6013271</id>
<content type='text'>
The documentation for detach() said attach.

Signed-off-by: Manuel Pégourié-Gonnard &lt;mpg@elzevir.fr&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM: Convert dev_pm_put_subsys_data() into a void function</title>
<updated>2015-02-03T21:59:25Z</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2015-01-29T17:39:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1e95e3b2da424db68d0a465273f1901a990c6277'/>
<id>urn:sha1:1e95e3b2da424db68d0a465273f1901a990c6277</id>
<content type='text'>
Clients using the dev_pm_put_subsys_data() API isn't interested of a
return value. They care only of decreasing a reference to the device's
pm_subsys_data. So, let's convert the API to a void function, which
anyway seems like reasonable thing to do.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM: Update function header for dev_pm_get_subsys_data()</title>
<updated>2015-02-03T21:59:25Z</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2015-01-29T17:39:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=766bb53c015bcc28dbd5ceb7c004581af7ab51b2'/>
<id>urn:sha1:766bb53c015bcc28dbd5ceb7c004581af7ab51b2</id>
<content type='text'>
The commit "PM: Make dev_pm_get_subsys_data() always return 0 on success"
changed the return value from dev_pm_get_subsys_data(). Let's update the
comment in the function header to reflect this change as well.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Acked-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / Domains: Add APIs to attach/detach a PM domain for a device</title>
<updated>2014-09-22T13:57:40Z</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2014-09-19T18:27:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=46420dd73b800f87a19af13af5883855cf38cb08'/>
<id>urn:sha1:46420dd73b800f87a19af13af5883855cf38cb08</id>
<content type='text'>
To maintain scalability let's add common methods to attach and detach
a PM domain for a device, dev_pm_domain_attach|detach().

Typically dev_pm_domain_attach() shall be invoked from subsystem level
code at the probe phase to try to attach a device to its PM domain.
The reversed actions may be done a the remove phase and then by
invoking dev_pm_domain_detach().

When attachment succeeds, the attach function should assign its
corresponding detach function to a new -&gt;detach() callback added in the
struct dev_pm_domain.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Tested-by: Philipp Zabel &lt;p.zabel@pengutronix.de&gt;
Reviewed-by: Kevin Hilman &lt;khilman@linaro.org&gt;
Reviewed-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>drivers/base: delete non-required instances of include &lt;linux/init.h&gt;</title>
<updated>2014-02-14T22:31:37Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2014-01-21T21:23:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4272b9611c30f99f51590085998129480f2fe45e'/>
<id>urn:sha1:4272b9611c30f99f51590085998129480f2fe45e</id>
<content type='text'>
None of these files are actually using any __init type directives
and hence don't need to include &lt;linux/init.h&gt;.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Cc: Len Brown &lt;len.brown@intel.com&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Mark Brown &lt;broonie@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>PM: Avoid calling kfree() under spinlock in dev_pm_put_subsys_data()</title>
<updated>2013-05-12T12:04:40Z</updated>
<author>
<name>Shuah Khan</name>
<email>shuah.kh@samsung.com</email>
</author>
<published>2013-05-07T23:14:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d5e1670afe0c886d6dd92afb7a1f085f88294dc8'/>
<id>urn:sha1:d5e1670afe0c886d6dd92afb7a1f085f88294dc8</id>
<content type='text'>
Fix dev_pm_put_subsys_data() so that it doesn't call kfree() under
a spinlock and make it return 1 whenever it leaves NULL
power.subsys_data (regardless of the reason).

Signed-off-by: Shuah Khan &lt;shuah.kh@samsung.com&gt;
Reviewed-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM: Make dev_pm_get_subsys_data() always return 0 on success</title>
<updated>2012-08-08T18:49:33Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2012-08-07T11:50:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=77254950bb174d637cd88d1a74e137ecf3185a65'/>
<id>urn:sha1:77254950bb174d637cd88d1a74e137ecf3185a65</id>
<content type='text'>
Commits 1d5fcfec22 (PM / Domains: Add device domain data reference
counter) and 62d4490294 (PM / Domains: Allow device callbacks to be
added at any time) added checks for the return value of
dev_pm_get_subsys_data(), but those checks were incorrect, because
that function returned 1 on success in some cases.

Since all of the existing users of dev_pm_get_subsys_data() don't use
the positive value returned by it on success, change its definition
so that it always returns 0 when successful.

Reported-by: Heiko Stübner &lt;heiko@sntech.de&gt;
Reported-by: Tushar Behera &lt;tushar.behera@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
</feed>
