Skip to content

Commit

Permalink
soc: imx: gpcv2: Fix clock disabling imbalance in error path
Browse files Browse the repository at this point in the history
[ Upstream commit fa231be ]

The imx_pgc_power_down() starts by enabling the domain clocks, and thus
disables them in the error path. Commit 18c9857 ("soc: imx: gpcv2:
add domain option to keep domain clocks enabled") made the clock enable
conditional, but forgot to add the same condition to the error path.
This can result in a clock enable/disable imbalance. Fix it.

Fixes: 18c9857 ("soc: imx: gpcv2: add domain option to keep domain clocks enabled")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
pinchartl authored and gregkh committed Mar 8, 2022
1 parent 79d4b01 commit 3de5b97
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/soc/imx/gpcv2.c
Expand Up @@ -382,7 +382,8 @@ static int imx_pgc_power_down(struct generic_pm_domain *genpd)
return 0;

out_clk_disable:
clk_bulk_disable_unprepare(domain->num_clks, domain->clks);
if (!domain->keep_clocks)
clk_bulk_disable_unprepare(domain->num_clks, domain->clks);

return ret;
}
Expand Down

0 comments on commit 3de5b97

Please sign in to comment.