[PATCH V1 0/1] Export an API to reinit SDIO card

Sayali Lokhande posted 1 patch 2 months, 2 weeks ago
drivers/mmc/core/core.h       | 1 +
drivers/mmc/core/sdio.c       | 2 +-
drivers/mmc/core/sdio_io.c    | 6 ++++++
include/linux/mmc/sdio_func.h | 2 ++
4 files changed, 10 insertions(+), 1 deletion(-)
[PATCH V1 0/1] Export an API to reinit SDIO card
Posted by Sayali Lokhande 2 months, 2 weeks ago
Some SDIO client drivers, manage external power to the SDIO card.
In such cases, the card may be power-cycled independently of the
MMC core's runtime PM state.
Currently, reinitialization of the SDIO card is tied to the runtime
PM resume path. However, if the card is powered off and on again before
the autosuspend delay expires, the runtime suspend/resume callbacks are
not triggered, leaving the card in an uninitialized state.

To address this, export sdio_reinit_card() so that client drivers can
explicitly trigger reinitialization after powering the card back on,
ensuring proper device state regardless of runtime PM behavior.

This change enables more robust handling of power-managed SDIO devices
in scenarios where runtime PM is disabled or insufficient.

Sayali Lokhande (1):
  mmc: sdio: Export an API to reinit the SDIO card

 drivers/mmc/core/core.h       | 1 +
 drivers/mmc/core/sdio.c       | 2 +-
 drivers/mmc/core/sdio_io.c    | 6 ++++++
 include/linux/mmc/sdio_func.h | 2 ++
 4 files changed, 10 insertions(+), 1 deletion(-)

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Re: [PATCH V1 0/1] Export an API to reinit SDIO card
Posted by Ulf Hansson 2 months, 2 weeks ago
On Mon, 21 Jul 2025 at 11:43, Sayali Lokhande <quic_sayalil@quicinc.com> wrote:
>
> Some SDIO client drivers, manage external power to the SDIO card.
> In such cases, the card may be power-cycled independently of the
> MMC core's runtime PM state.
> Currently, reinitialization of the SDIO card is tied to the runtime
> PM resume path. However, if the card is powered off and on again before
> the autosuspend delay expires, the runtime suspend/resume callbacks are
> not triggered, leaving the card in an uninitialized state.
>
> To address this, export sdio_reinit_card() so that client drivers can
> explicitly trigger reinitialization after powering the card back on,
> ensuring proper device state regardless of runtime PM behavior.
>
> This change enables more robust handling of power-managed SDIO devices
> in scenarios where runtime PM is disabled or insufficient.

Please use mmc_hw|sw_reset() instead.

Kind regards
Uffe

>
> Sayali Lokhande (1):
>   mmc: sdio: Export an API to reinit the SDIO card
>
>  drivers/mmc/core/core.h       | 1 +
>  drivers/mmc/core/sdio.c       | 2 +-
>  drivers/mmc/core/sdio_io.c    | 6 ++++++
>  include/linux/mmc/sdio_func.h | 2 ++
>  4 files changed, 10 insertions(+), 1 deletion(-)
>
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>