linux/drivers/pmdomain/mediatek
Macpaul Lin 744e1bdd14 pmdomain: mtk-pm-domains: Fix spinlock recursion fix in probe
commit 305f254727 upstream.

Remove scpsys_get_legacy_regmap(), replacing its usage with
of_find_node_with_property(). Explicitly call of_node_get(np) before each
of_find_node_with_property() to maintain correct node reference counting.

The of_find_node_with_property() function "consumes" its input by calling
of_node_put() internally, whether or not it finds a match.  Currently,
dev->of_node (np) is passed multiple times in sequence without incrementing
its reference count, causing it to be decremented multiple times and
risking early memory release.

Adding of_node_get(np) before each call balances the reference count,
preventing premature node release.

Fixes: c1bac49fe9 ("pmdomains: mtk-pm-domains: Fix spinlock recursion in probe")
Cc: stable@vger.kernel.org
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Tested-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-01-08 10:17:09 +01:00
..
airoha-cpu-pmdomain.c pmdomain: mediatek: airoha: convert from round_rate() to determine_rate() 2025-09-17 16:28:18 +02:00
Kconfig pmdomain: airoha: Add Airoha CPU PM Domain support 2025-01-16 16:01:27 +01:00
Makefile pmdomain: airoha: Fix compilation error with Clang-20 and Thumb2 mode 2025-01-21 10:45:24 +01:00
mt6735-pm-domains.h pmdomain: mediatek: Add support for MT6735 2024-10-22 13:08:11 +02:00
mt6795-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt6893-pm-domains.h pmdomain: mediatek: Add support for Dimensity 1200 MT6893 2025-04-23 10:28:13 +02:00
mt8167-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt8173-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt8183-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt8186-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt8188-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt8192-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mt8195-pm-domains.h pmdomain: Merge branch fixes into next 2025-09-23 16:35:23 +02:00
mt8365-pm-domains.h pmdomain: mediatek: Convert all SoCs to new style regmap retrieval 2025-08-19 14:12:41 +02:00
mtk-pm-domains.c pmdomain: mtk-pm-domains: Fix spinlock recursion fix in probe 2026-01-08 10:17:09 +01:00
mtk-pm-domains.h pmdomain: mediatek: Add support for RTFF Hardware in MT8196/MT6991 2025-08-19 14:12:40 +02:00
mtk-scpsys.c pmdomain: mediatek: scpsys: drop driver owner assignment 2024-04-04 11:44:54 +02:00