* [PATCH 1/1] soc: imx: imx93-blk-ctrl: Add dedicated lockdep class for nested genpd locks
@ 2023-07-06 7:46 Alexander Stein
2023-07-18 7:00 ` Shawn Guo
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Stein @ 2023-07-06 7:46 UTC (permalink / raw)
To: Shawn Guo, Sascha Hauer, Fabio Estevam, Peng Fan
Cc: Alexander Stein, Pengutronix Kernel Team, NXP Linux Team,
linux-arm-kernel
This is the same approach as being used within imx8mp-blk-ctrl. This fixes
the lockdep warning about 'possible recursive locking detected' with the
following (reduced) backtrace:
genpd_lock_mtx+0x14/0x1c
genpd_runtime_resume+0x108/0x308
__rpm_callback+0x44/0x19c
rpm_callback+0x64/0x70
rpm_resume+0x438/0x6d8
__pm_runtime_resume+0x54/0xb0
imx93_blk_ctrl_power_on+0x100/0x294
_genpd_power_on+0x8c/0x16c
genpd_power_on.part.0+0xa0/0x1a0
__genpd_dev_pm_attach+0x14c/0x2e4
genpd_dev_pm_attach+0x58/0x64
dev_pm_domain_attach+0x1c/0x2c
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
drivers/soc/imx/imx93-blk-ctrl.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/soc/imx/imx93-blk-ctrl.c b/drivers/soc/imx/imx93-blk-ctrl.c
index 6cd7f2015b5a..185d428cebac 100644
--- a/drivers/soc/imx/imx93-blk-ctrl.c
+++ b/drivers/soc/imx/imx93-blk-ctrl.c
@@ -187,6 +187,8 @@ static int imx93_blk_ctrl_power_off(struct generic_pm_domain *genpd)
return 0;
}
+static struct lock_class_key blk_ctrl_genpd_lock_class;
+
static int imx93_blk_ctrl_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -269,6 +271,19 @@ static int imx93_blk_ctrl_probe(struct platform_device *pdev)
goto cleanup_pds;
}
+ /*
+ * We use runtime PM to trigger power on/off of the upstream GPC
+ * domain, as a strict hierarchical parent/child power domain
+ * setup doesn't allow us to meet the sequencing requirements.
+ * This means we have nested locking of genpd locks, without the
+ * nesting being visible at the genpd level, so we need a
+ * separate lock class to make lockdep aware of the fact that
+ * this are separate domain locks that can be nested without a
+ * self-deadlock.
+ */
+ lockdep_set_class(&domain->genpd.mlock,
+ &blk_ctrl_genpd_lock_class);
+
bc->onecell_data.domains[i] = &domain->genpd;
}
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 1/1] soc: imx: imx93-blk-ctrl: Add dedicated lockdep class for nested genpd locks
2023-07-06 7:46 [PATCH 1/1] soc: imx: imx93-blk-ctrl: Add dedicated lockdep class for nested genpd locks Alexander Stein
@ 2023-07-18 7:00 ` Shawn Guo
0 siblings, 0 replies; 2+ messages in thread
From: Shawn Guo @ 2023-07-18 7:00 UTC (permalink / raw)
To: Alexander Stein
Cc: Sascha Hauer, Fabio Estevam, Peng Fan, Pengutronix Kernel Team,
NXP Linux Team, linux-arm-kernel
On Thu, Jul 06, 2023 at 09:46:29AM +0200, Alexander Stein wrote:
> This is the same approach as being used within imx8mp-blk-ctrl. This fixes
> the lockdep warning about 'possible recursive locking detected' with the
> following (reduced) backtrace:
> genpd_lock_mtx+0x14/0x1c
> genpd_runtime_resume+0x108/0x308
> __rpm_callback+0x44/0x19c
> rpm_callback+0x64/0x70
> rpm_resume+0x438/0x6d8
> __pm_runtime_resume+0x54/0xb0
> imx93_blk_ctrl_power_on+0x100/0x294
> _genpd_power_on+0x8c/0x16c
> genpd_power_on.part.0+0xa0/0x1a0
> __genpd_dev_pm_attach+0x14c/0x2e4
> genpd_dev_pm_attach+0x58/0x64
> dev_pm_domain_attach+0x1c/0x2c
>
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Applied, thanks!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-19 6:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-06 7:46 [PATCH 1/1] soc: imx: imx93-blk-ctrl: Add dedicated lockdep class for nested genpd locks Alexander Stein
2023-07-18 7:00 ` Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).