]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
pmdomain: mediatek: fix race conditions with genpd
authorEugen Hristev <eugen.hristev@collabora.com>
Mon, 25 Dec 2023 13:36:15 +0000 (15:36 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 23 Jan 2024 12:19:15 +0000 (13:19 +0100)
commitc41336f4d69057cbf88fed47951379b384540df5
tree41299a8b2bb1340c2e342b5917ac1f7a790f2153
parentf0e4a1356466ec1858ae8e5c70bea2ce5e55008b
pmdomain: mediatek: fix race conditions with genpd

If the power domains are registered first with genpd and *after that*
the driver attempts to power them on in the probe sequence, then it is
possible that a race condition occurs if genpd tries to power them on
in the same time.
The same is valid for powering them off before unregistering them
from genpd.
Attempt to fix race conditions by first removing the domains from genpd
and *after that* powering down domains.
Also first power up the domains and *after that* register them
to genpd.

Fixes: 59b644b01cf4 ("soc: mediatek: Add MediaTek SCPSYS power domains")
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20231225133615.78993-1-eugen.hristev@collabora.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/pmdomain/mediatek/mtk-pm-domains.c