<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/pmdomain/core.c, branch v6.18.22</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.22</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.22'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-09-11T10:36:14+00:00</updated>
<entry>
<title>pmdomain: core: Restore behaviour for disabling unused PM domains</title>
<updated>2025-09-11T10:36:14+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2025-09-09T11:11:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=002ebddd695a53999550e241b71950f1aa0e1ac4'/>
<id>urn:sha1:002ebddd695a53999550e241b71950f1aa0e1ac4</id>
<content type='text'>
Recent changes to genpd prevents those PM domains being powered-on during
initialization from being powered-off during the boot sequence. Based upon
whether CONFIG_PM_CONFIG_PM_GENERIC_DOMAINS_OF is set of not, genpd relies
on the sync_state mechanism or the genpd_power_off_unused() (which is a
late_initcall_sync), to understand when it's okay to allow these PM domains
to be powered-off.

This new behaviour in genpd has lead to problems on different platforms.
Let's therefore restore the behavior of genpd_power_off_unused().
Moreover, let's introduce GENPD_FLAG_NO_STAY_ON, to allow genpd OF
providers to opt-out from the new behaviour.

Link: https://lore.kernel.org/all/20250701114733.636510-1-ulf.hansson@linaro.org/
Reported-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Link: https://lore.kernel.org/all/20250902-rk3576-lockup-regression-v1-1-c4a0c9daeb00@collabora.com/
Reported-by: Nicolas Frattaroli &lt;nicolas.frattaroli@collabora.com&gt;
Fixes: 0e789b491ba0 ("pmdomain: core: Leave powered-on genpds on until sync_state")
Fixes: 13a4b7fb6260 ("pmdomain: core: Leave powered-on genpds on until late_initcall_sync")
Tested-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Tested-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>pmdomain: core: introduce dev_pm_genpd_is_on()</title>
<updated>2025-07-16T18:54:27+00:00</updated>
<author>
<name>Hiago De Franco</name>
<email>hiago.franco@toradex.com</email>
</author>
<published>2025-06-29T17:25:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=09813cde376d9d8f30eaf761534532101a0a7755'/>
<id>urn:sha1:09813cde376d9d8f30eaf761534532101a0a7755</id>
<content type='text'>
This helper function returns the current power status of a given generic
power domain.

As example, remoteproc/imx_rproc.c can now use this function to check
the power status of the remote core to properly set "attached" or
"offline" modes.

Suggested-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Reviewed-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Reviewed-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Signed-off-by: Hiago De Franco &lt;hiago.franco@toradex.com&gt;
Link: https://lore.kernel.org/r/20250629172512.14857-2-hiagofranco@gmail.com
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>pmdomain: core: Leave powered-on genpds on until sync_state</title>
<updated>2025-07-09T11:29:57+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2025-07-01T11:47:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0e789b491ba04c31de5c71249487593e386baa67'/>
<id>urn:sha1:0e789b491ba04c31de5c71249487593e386baa67</id>
<content type='text'>
Powering-off a genpd that was on during boot, before all of its consumer
devices have been probed, is certainly prone to problems.

For OF based platforms we can rely on using the sync_state mechanism that
the fw_devlink provides, to understand when all consumers for a genpd
provider have been probed. Let's therefore prevent these genpds from being
powered-off until the -&gt;sync_state() callback gets called.

Note that, for non-OF based platform we will keep relying on the
late_initcall_sync, which seems to be the best we can do for now.

Suggested-by: Saravana Kannan &lt;saravanak@google.com&gt;
Tested-by: Hiago De Franco &lt;hiago.franco@toradex.com&gt; # Colibri iMX8X
Tested-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt; # TI AM62A,Xilinx ZynqMP ZCU106
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Link: https://lore.kernel.org/r/20250701114733.636510-23-ulf.hansson@linaro.org
</content>
</entry>
<entry>
<title>pmdomain: core: Leave powered-on genpds on until late_initcall_sync</title>
<updated>2025-07-09T11:29:53+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2025-07-01T11:47:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=13a4b7fb62600e1c0738fdb0b7176555ff05aadf'/>
<id>urn:sha1:13a4b7fb62600e1c0738fdb0b7176555ff05aadf</id>
<content type='text'>
Powering-off a genpd that was on during boot, before all of its consumer
devices have been probed, is certainly prone to problems.

As a step to improve this situation, let's prevent these genpds from being
powered-off until genpd_power_off_unused() gets called, which is a
late_initcall_sync().

Note that, this still doesn't guarantee that all the consumer devices has
been probed before we allow to power-off the genpds. Yet, this should be a
step in the right direction.

Suggested-by: Saravana Kannan &lt;saravanak@google.com&gt;
Tested-by: Hiago De Franco &lt;hiago.franco@toradex.com&gt; # Colibri iMX8X
Tested-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt; # TI AM62A,Xilinx ZynqMP ZCU106
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Link: https://lore.kernel.org/r/20250701114733.636510-22-ulf.hansson@linaro.org
</content>
</entry>
<entry>
<title>pmdomain: core: Default to use of_genpd_sync_state() for genpd providers</title>
<updated>2025-07-09T11:29:50+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2025-07-01T11:47:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f66c65686abdf317f6ea1ebd3a76a2cdb2020d06'/>
<id>urn:sha1:f66c65686abdf317f6ea1ebd3a76a2cdb2020d06</id>
<content type='text'>
Unless the typical platform driver that act as genpd provider, has its own
-&gt;sync_state() callback implemented let's default to use
of_genpd_sync_state().

More precisely, while adding a genpd OF provider let's assign the
-&gt;sync_state() callback, in case the fwnode has a device and its driver
doesn't have the -&gt;sync_state() set already. In this way the typical
platform driver doesn't need to assign -&gt;sync_state(), unless it has some
additional things to manage beyond genpds.

Suggested-by: Saravana Kannan &lt;saravanak@google.com&gt;
Tested-by: Hiago De Franco &lt;hiago.franco@toradex.com&gt; # Colibri iMX8X
Tested-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt; # TI AM62A,Xilinx ZynqMP ZCU106
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Link: https://lore.kernel.org/r/20250701114733.636510-21-ulf.hansson@linaro.org
</content>
</entry>
<entry>
<title>pmdomain: core: Add common -&gt;sync_state() support for genpd providers</title>
<updated>2025-07-09T11:29:41+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2025-07-01T11:47:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3b7b8acacf372945b4855a136634775c064a57f8'/>
<id>urn:sha1:3b7b8acacf372945b4855a136634775c064a57f8</id>
<content type='text'>
If the genpd provider's fwnode doesn't have an associated struct device
with it, we can make use of the generic genpd-&gt;dev and it corresponding
driver internally in genpd to manage -&gt;sync_state().

More precisely, while adding a genpd OF provider let's check if the fwnode
has a device and if not, make the preparation to handle -&gt;sync_state()
internally through the genpd_provider_driver and the genpd_provider_bus.

Note that, genpd providers may opt out from this behaviour by setting the
GENPD_FLAG_NO_SYNC_STATE config options for the genpds in question.

Suggested-by: Saravana Kannan &lt;saravanak@google.com&gt;
Tested-by: Hiago De Franco &lt;hiago.franco@toradex.com&gt; # Colibri iMX8X
Tested-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt; # TI AM62A,Xilinx ZynqMP ZCU106
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Link: https://lore.kernel.org/r/20250701114733.636510-19-ulf.hansson@linaro.org
</content>
</entry>
<entry>
<title>pmdomain: core: Export a common -&gt;sync_state() helper for genpd providers</title>
<updated>2025-07-09T11:28:57+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2025-07-01T11:47:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6c3b746fd536b7612b23e5c2041365014b85082e'/>
<id>urn:sha1:6c3b746fd536b7612b23e5c2041365014b85082e</id>
<content type='text'>
In some cases the typical platform driver that act as genpd provider, may
need its own -&gt;sync_state() callback to manage various things. In this
regards, the provider most likely wants to allow its corresponding genpds
to be powered-off.

For this reason, let's introduce a new genpd helper function,
of_genpd_sync_state() that helps genpd provider drivers to achieve this.

Suggested-by: Saravana Kannan &lt;saravanak@google.com&gt;
Reviewed-by: Abel Vesa &lt;abel.vesa@linaro.org&gt;
Tested-by: Hiago De Franco &lt;hiago.franco@toradex.com&gt; # Colibri iMX8X
Tested-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt; # TI AM62A,Xilinx ZynqMP ZCU106
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Link: https://lore.kernel.org/r/20250701114733.636510-8-ulf.hansson@linaro.org
</content>
</entry>
<entry>
<title>pmdomain: core: Add the genpd-&gt;dev to the genpd provider bus</title>
<updated>2025-07-09T11:28:53+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2025-07-01T11:47:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=18a3a510ecfd0e508e8e41160dea0493cdfa297c'/>
<id>urn:sha1:18a3a510ecfd0e508e8e41160dea0493cdfa297c</id>
<content type='text'>
To take the next step for a more common handling of the genpd providers,
let's add the genpd-&gt;dev to the genpd provider bus when registering a genpd
OF provider.

Also note, to allow us to add devices to the genpd provider bus we need to
make sure the bus has been registered first, which is done via a
core_initcall. Hence, calls to of_genpd_add_provider_simple|onecell() must
be done after the bus has been registered, else they will fail.

Suggested-by: Saravana Kannan &lt;saravanak@google.com&gt;
Reviewed-by: Abel Vesa &lt;abel.vesa@linaro.org&gt;
Tested-by: Hiago De Franco &lt;hiago.franco@toradex.com&gt; # Colibri iMX8X
Tested-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt; # TI AM62A,Xilinx ZynqMP ZCU106
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Link: https://lore.kernel.org/r/20250701114733.636510-7-ulf.hansson@linaro.org
</content>
</entry>
<entry>
<title>pmdomain: core: Add a bus and a driver for genpd providers</title>
<updated>2025-07-09T11:28:48+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2025-07-01T11:47:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=31cb75077003acb81b34b8d204a8997138536a55'/>
<id>urn:sha1:31cb75077003acb81b34b8d204a8997138536a55</id>
<content type='text'>
When we create a genpd via pm_genpd_init() we are initializing a
corresponding struct device for it, but we don't add the device to any
bus_type. It has not really been needed as the device is used as cookie to
help us manage OPP tables.

However, to prepare to make better use of the device, let's add a new genpd
provider bus_type and a corresponding genpd provider driver. Subsequent
changes will make use of this.

Suggested-by: Saravana Kannan &lt;saravanak@google.com&gt;
Reviewed-by: Abel Vesa &lt;abel.vesa@linaro.org&gt;
Tested-by: Hiago De Franco &lt;hiago.franco@toradex.com&gt; # Colibri iMX8X
Tested-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt; # TI AM62A,Xilinx ZynqMP ZCU106
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Link: https://lore.kernel.org/r/20250701114733.636510-6-ulf.hansson@linaro.org
</content>
</entry>
<entry>
<title>pmdomain: core: Prevent registering devices before the bus</title>
<updated>2025-07-09T11:28:44+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2025-07-01T11:47:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=60fe1ca5bc6ca1971c23e26078e33366de84d53e'/>
<id>urn:sha1:60fe1ca5bc6ca1971c23e26078e33366de84d53e</id>
<content type='text'>
We must not register a consumer device to the genpd bus, before registering
the bus itself. Even if this doesn't seem to be an issue, let's add a
simple check to make sure we really avoid this from happening.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Link: https://lore.kernel.org/r/20250701114733.636510-5-ulf.hansson@linaro.org
</content>
</entry>
</feed>
