]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pmdomain: mtk-pm-domains: Fix spinlock recursion fix in probe
authorMacpaul Lin <macpaul.lin@mediatek.com>
Fri, 28 Nov 2025 04:17:22 +0000 (12:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:17:09 +0000 (10:17 +0100)
commit744e1bdd1471b7c914bf9fc06666f8960f149aad
treeeea22aededb14d5906af2a3316d20640c4feeb79
parent11ccb3476ead90e7da669a0d0a5b74ac8819208a
pmdomain: mtk-pm-domains: Fix spinlock recursion fix in probe

commit 305f254727bd379bbed0385afa0162f5bde1f51c 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: c1bac49fe91f ("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>
drivers/pmdomain/mediatek/mtk-pm-domains.c