2021-06-27 15:57:47

by Christophe JAILLET

[permalink] [raw]
Subject: [PATCH] soc/tegra: Fix an error handling path in 'tegra_powergate_power_up()'

If an error occurs after a successful 'tegra_powergate_enable_clocks()'
call, it must be undone by a 'tegra_powergate_disable_clocks()' call, as
already done in the below and above error handling paths of this function.

Update the 'goto' to branch at the correct place of the error handling
path.

Fixes: a38045121bf4 ("soc/tegra: pmc: Add generic PM domain support")
Signed-off-by: Christophe JAILLET <[email protected]>
---
/!\ This patch is speculative /!\
Review with care.
---
drivers/soc/tegra/pmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index ea62f84d1c8b..b8ef9506f3de 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -782,7 +782,7 @@ static int tegra_powergate_power_up(struct tegra_powergate *pg,

err = reset_control_deassert(pg->reset);
if (err)
- goto powergate_off;
+ goto disable_clks;

usleep_range(10, 20);

--
2.30.2


2021-06-28 08:31:38

by Jon Hunter

[permalink] [raw]
Subject: Re: [PATCH] soc/tegra: Fix an error handling path in 'tegra_powergate_power_up()'


On 27/06/2021 16:54, Christophe JAILLET wrote:
> If an error occurs after a successful 'tegra_powergate_enable_clocks()'
> call, it must be undone by a 'tegra_powergate_disable_clocks()' call, as
> already done in the below and above error handling paths of this function.
>
> Update the 'goto' to branch at the correct place of the error handling
> path.
>
> Fixes: a38045121bf4 ("soc/tegra: pmc: Add generic PM domain support")
> Signed-off-by: Christophe JAILLET <[email protected]>
> ---
> /!\ This patch is speculative /!\
> Review with care.
> ---
> drivers/soc/tegra/pmc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
> index ea62f84d1c8b..b8ef9506f3de 100644
> --- a/drivers/soc/tegra/pmc.c
> +++ b/drivers/soc/tegra/pmc.c
> @@ -782,7 +782,7 @@ static int tegra_powergate_power_up(struct tegra_powergate *pg,
>
> err = reset_control_deassert(pg->reset);
> if (err)
> - goto powergate_off;
> + goto disable_clks;
>
> usleep_range(10, 20);


Thanks for the fix.

Reviewed-by: Jon Hunter <[email protected]>

Cheers
Jon

--
nvpublic

2021-10-07 18:06:01

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH] soc/tegra: Fix an error handling path in 'tegra_powergate_power_up()'

On Sun, Jun 27, 2021 at 05:54:31PM +0200, Christophe JAILLET wrote:
> If an error occurs after a successful 'tegra_powergate_enable_clocks()'
> call, it must be undone by a 'tegra_powergate_disable_clocks()' call, as
> already done in the below and above error handling paths of this function.
>
> Update the 'goto' to branch at the correct place of the error handling
> path.
>
> Fixes: a38045121bf4 ("soc/tegra: pmc: Add generic PM domain support")
> Signed-off-by: Christophe JAILLET <[email protected]>
> ---
> /!\ This patch is speculative /!\
> Review with care.
> ---
> drivers/soc/tegra/pmc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Thierry


Attachments:
(No filename) (719.00 B)
signature.asc (849.00 B)
Download all attachments