[PATCH] mmc: mmci: handle clk_prepare_enable() failure on runtime resume

Ulf Hansson ulf.hansson at oss.qualcomm.com
Mon Nov 30 08:15:24 PST 2026


On Tue, Nov 17, 2026 at 3:07 AM Luo Yifan <luoyifan at cmss.chinamobile.com> wrote:
>
> mmci_runtime_resume() ignores the return value of clk_prepare_enable()
> and then calls mmci_restore(), which writes to the controller registers.
> If the clock cannot be enabled, the restore runs with the clock off and
> the PM core never learns that the resume failed.
>
> Return the error before touching the controller.
>
> Signed-off-by: Luo Yifan <luoyifan at cmss.chinamobile.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/mmci.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index f5ee793dda..16c8cf57fd 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -2578,7 +2578,12 @@ static int mmci_runtime_resume(struct device *dev)
>
>         if (mmc) {
>                 struct mmci_host *host = mmc_priv(mmc);
> -               clk_prepare_enable(host->clk);
> +               int ret;
> +
> +               ret = clk_prepare_enable(host->clk);
> +               if (ret)
> +                       return ret;
> +
>                 mmci_restore(host);
>                 pinctrl_select_default_state(dev);
>         }
> --
> 2.24.4
>
>
>



More information about the linux-arm-kernel mailing list