pmdomain: ti-sci: Fix duplicate PD referrals
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Mon, 15 Apr 2024 16:00:23 +0000 (19:00 +0300)
committerUlf Hansson <ulf.hansson@linaro.org>
Fri, 3 May 2024 13:20:05 +0000 (15:20 +0200)
commit670c900f69645db394efb38934b3344d8804171a
treef64194366a06723ec00599a86cb63c36d8668f6d
parent39cd87c4eb2b893354f3b850f916353f2658ae6f
pmdomain: ti-sci: Fix duplicate PD referrals

When the dts file has multiple referrers to a single PD (e.g.
simple-framebuffer and dss nodes both point to the DSS power-domain) the
ti-sci driver will create two power domains, both with the same ID, and
that will cause problems as one of the power domains will hide the other
one.

Fix this checking if a PD with the ID has already been created, and only
create a PD for new IDs.

Fixes: efa5c01cd7ee ("soc: ti: ti_sci_pm_domains: switch to use multiple genpds instead of one")
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240415-ti-sci-pd-v1-1-a0e56b8ad897@ideasonboard.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/pmdomain/ti/ti_sci_pm_domains.c