soc: imx: gpcv2: add lockdep annotation
authorLucas Stach <l.stach@pengutronix.de>
Sat, 2 Oct 2021 00:59:40 +0000 (02:59 +0200)
committerShawn Guo <shawnguo@kernel.org>
Wed, 6 Oct 2021 12:13:23 +0000 (20:13 +0800)
Some of the GPCv2 power domains are nested inside each other without
visibility to lockdep at the genpd level, as they are in separate
driver instances and don't have a parent/child power-domain relationship.

Add a subclass annotation to the nested domains to let lockdep know that
it is okay to take the genpd lock in a nested fashion.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/soc/imx/gpcv2.c

index 7fbf1f25b48e5b3af50ed3b96ace74d99c6ecedd..fcea95317287e34da970170037e25b4357ee5163 100644 (file)
@@ -898,6 +898,10 @@ static int imx_pgc_domain_probe(struct platform_device *pdev)
                goto out_domain_unmap;
        }
 
+       if (IS_ENABLED(CONFIG_LOCKDEP) &&
+           of_property_read_bool(domain->dev->of_node, "power-domains"))
+               lockdep_set_subclass(&domain->genpd.mlock, 1);
+
        ret = of_genpd_add_provider_simple(domain->dev->of_node,
                                           &domain->genpd);
        if (ret) {