Re: [PATCH] spi: bcm63xx-hsspi: disable clocks on resume failure

Kursad Oney <[email protected]>
Newsgroups org.kernel.vger.linux-spi,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <CAMm8Nh1RMWN23xf_DOtK1rm2LMJxwLJGGxnonCBioC1sSR2m7g@mail.gmail.com>
On Tue, Aug 4, 2026 at 3:21 AM Can Peng <[email protected]> wrote:
>
> bcm63xx_hsspi_resume() enables the HSSPI clock, and optionally the PLL
> clock, before restarting the SPI controller queue.
>
> If spi_controller_resume() fails, the function currently reports success
> and leaves those clocks enabled. Propagate the error and disable the
> clocks before returning.
>
> Fixes: 142168eba9dc ("spi: bcm63xx-hsspi: add bcm63xx HSSPI driver")
> Cc: [email protected]
> Signed-off-by: Can Peng <[email protected]>
> ---
>  drivers/spi/spi-bcm63xx-hsspi.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c
> index 37b3534d0b0a..633164e5a856 100644
> --- a/drivers/spi/spi-bcm63xx-hsspi.c
> +++ b/drivers/spi/spi-bcm63xx-hsspi.c
> @@ -919,7 +919,13 @@ static int bcm63xx_hsspi_resume(struct device *dev)
>                 }
>         }
>
> -       spi_controller_resume(host);
> +       ret = spi_controller_resume(host);
> +       if (ret) {
> +               if (bs->pll_clk)
> +                       clk_disable_unprepare(bs->pll_clk);
> +               clk_disable_unprepare(bs->clk);
> +               return ret;
> +       }
>
>         return 0;
>  }
> --
> 2.53.0
>

Reviewed-by: Kursad Oney <[email protected]>
smime.p7s (application/pkcs7-signature, 5.3 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.