[PATCH v2] mmc: sdhci-of-arasan: Add shutdown callback

Paul P, Alvin Alvin.PaulP at amd.com
Wed Jun 11 03:23:11 PDT 2025


[AMD Official Use Only - AMD Internal Distribution Only]

Hi,

> -----Original Message-----
> From: Ulf Hansson <ulf.hansson at linaro.org>
> Sent: Monday, June 9, 2025 6:56 PM
> To: Paul P, Alvin <Alvin.PaulP at amd.com>
> Cc: Simek, Michal <michal.simek at amd.com>; adrian.hunter at intel.com; git
> (AMD-Xilinx) <git at amd.com>; linux-arm-kernel at lists.infradead.org; linux-
> mmc at vger.kernel.org; linux-kernel at vger.kernel.org
> Subject: Re: [PATCH v2] mmc: sdhci-of-arasan: Add shutdown callback
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Thu, 29 May 2025 at 12:49, Paul Alvin <alvin.paulp at amd.com> wrote:
> >
> > Implement shutdown hook to suspend host and disable all mmc clocks to
> > increase power saving during shutdown or reboot.
>
> So how long is the shutdown process for the platform? What do we really gain?
>
> In general we don't quite care about power-savings during shutdown, as we are
> going to turn off things anyway, right?
>

Agree, this patch may not be particularly useful for the shutdown use case, but in kexec flow during system restart preparation, it triggers device shutdown. This patch ensures a proper host shutdown by using sdhci platform suspend.

Will update the commit description to reflect the same.

Thanks,
Alvin
>
> >
> > Signed-off-by: Paul Alvin <alvin.paulp at amd.com>
> > ---
> >
> > Changes in v2:
> > - Make use of platform suspend instead of driver suspend as driver
> >   suspend will only get defined if PMC_SLEEP is configured which
> >   results in build failure if it is not configured.
> > - Updated commit description.
> >
> >  drivers/mmc/host/sdhci-of-arasan.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/mmc/host/sdhci-of-arasan.c
> > b/drivers/mmc/host/sdhci-of-arasan.c
> > index 8c29676ab662..4abdad3c4e5b 100644
> > --- a/drivers/mmc/host/sdhci-of-arasan.c
> > +++ b/drivers/mmc/host/sdhci-of-arasan.c
> > @@ -2056,6 +2056,11 @@ static void sdhci_arasan_remove(struct
> platform_device *pdev)
> >         clk_disable_unprepare(clk_ahb);  }
> >
> > +static void sdhci_arasan_shutdown(struct platform_device *pdev) {
> > +       sdhci_pltfm_suspend(&pdev->dev); }
> > +
> >  static struct platform_driver sdhci_arasan_driver = {
> >         .driver = {
> >                 .name = "sdhci-arasan", @@ -2065,6 +2070,7 @@ static
> > struct platform_driver sdhci_arasan_driver = {
> >         },
> >         .probe = sdhci_arasan_probe,
> >         .remove = sdhci_arasan_remove,
> > +       .shutdown = sdhci_arasan_shutdown,
> >  };
> >
> >  module_platform_driver(sdhci_arasan_driver);
> > --
> > 2.44.1
> >


More information about the linux-arm-kernel mailing list