Skip to content

Commit

Permalink
soc: imx: gpcv2: add lockdep annotation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lucas Stach authored and Shawn Guo committed Oct 6, 2021
1 parent 2b2f106 commit fadf79a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/soc/imx/gpcv2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit fadf79a

Please sign in to comment.