diff mbox series

[v2,04/18] soc: imx: gpcv2: add lockdep annotation

Message ID 20210721204703.1424034-5-l.stach@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series i.MX8MM GPC improvements and BLK_CTRL driver | expand

Commit Message

Lucas Stach July 21, 2021, 8:46 p.m. UTC
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>
---
 drivers/soc/imx/gpcv2.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Peng Fan Aug. 5, 2021, 9:38 a.m. UTC | #1
> Subject: [PATCH v2 04/18] soc: imx: gpcv2: add lockdep annotation
> 
> 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>

> ---
>  drivers/soc/imx/gpcv2.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index
> 2c43e74db0be..35f26f57d1ac 100644
> --- a/drivers/soc/imx/gpcv2.c
> +++ b/drivers/soc/imx/gpcv2.c
> @@ -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) {
> --
> 2.30.2
diff mbox series

Patch

diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c
index 2c43e74db0be..35f26f57d1ac 100644
--- a/drivers/soc/imx/gpcv2.c
+++ b/drivers/soc/imx/gpcv2.c
@@ -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) {