[PATCH v4 0/2] mmc: core: Keep the card powered across suspend when firmware needs it live

From: Kamal Dasu

Date: Tue Jul 28 2026 - 15:08:09 EST


This is v4.

Background: on brcmstb boards with a Kioxia 016G01 eMMC, firmware
accesses the card directly during resume from Suspend-to-DRAM, before
the kernel's own resume path runs, in order to load boot code using
hard wired logic that is not field updatable. The card needs to stay
powered and responsive for that access to succeed.

Changes in v4:
- Dropped the no-mmc-poweroff-suspend DT property and
MMC_CAP2_NO_POWEROFF_SUSPEND host capability entirely. Krzysztof
pointed out they described exactly the same contract as the
existing keep-power-in-suspend property (don't power off the card
across suspend/resume). Extended keep-power-in-suspend's scope
beyond SDIO instead, and reworked _mmc_suspend() to check
host->pm_caps & MMC_PM_KEEP_POWER directly rather than adding a
new capability. (e)MMC has no per-function driver to make the
dynamic sdio_set_host_pm_flags() request SDIO uses, so this reads
pm_caps -- the DT-derived, fixed platform characteristic -- not
pm_flags.
- Gated the fast path on pm_type == MMC_POWEROFF_SUSPEND; it was
previously unconditional, so it wrongly skipped the required
power-off/notify handling during shutdown, unbind and
undervoltage as well.
- Reset the host to its initial bus state (mmc_set_clock() +
mmc_set_initial_state(), the same helpers _mmc_hw_reset() uses for
a non-power-cycle reset) before marking the card suspended.
- Set/clear host->pm_flags |= MMC_PM_KEEP_POWER around the suspend/
resume, mirroring the SDIO convention, so host drivers can tell
power was preserved if they need to.

Changes in v3:
- Reworked the fix in _mmc_suspend() (drivers/mmc/core/mmc.c) to
skip the poweroff-notify/sleep/power-off sequence entirely.
- Renamed no-mmc-sleep/MMC_CAP2_NO_SLEEP_CMD to
no-mmc-poweroff-suspend/MMC_CAP2_NO_POWEROFF_SUSPEND.

Changes in v2:
- Replaced v1's card-level MMC_QUIRK_BROKEN_SLEEP quirk with a host
capability and matching DT property, per Ulf's suggestion.
- Added Reported-by/Closes tags crediting Florian.

Kamal Dasu (2):
dt-bindings: mmc: Extend keep-power-in-suspend beyond SDIO
mmc: core: Honor keep-power-in-suspend for (e)MMC in suspend/resume

.../bindings/mmc/mmc-controller-common.yaml | 7 ++++-
drivers/mmc/core/mmc.c | 30 ++++++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletion(-)

--
2.34.1