]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mmc: core: Further avoid re-storing power to the eMMC before a shutdown
authorUlf Hansson <ulf.hansson@linaro.org>
Mon, 7 Apr 2025 15:27:52 +0000 (17:27 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 14 May 2025 14:59:16 +0000 (16:59 +0200)
commitfa34c940e830e7af37b57f5fcdb17e2fc03dbf7f
tree4ea40baf3b39e2c1bcde6093f060735466bccd71
parent3953e7e8c1eaab9cd96ca45d420fb4561111294f
mmc: core: Further avoid re-storing power to the eMMC before a shutdown

To manage a graceful power-off of the eMMC card during platform shutdown,
the prioritized option is to use the poweroff-notification command, if the
eMMC card supports it.

During a suspend request we may decide to fall back to use the sleep
command, instead of the poweroff-notification, unless the mmc host supports
a complete power-cycle of the eMMC. For this reason, we may need to restore
power and re-initialize the card, if it remains suspended when a shutdown
request is received.

However, the current condition to restore power and re-initialize the card
doesn't take into account MMC_CAP2_FULL_PWR_CYCLE_IN_SUSPEND properly. This
may lead to doing a re-initialization when it really isn't needed, as the
eMMC may already have been powered-off using the poweroff-notification
command. Let's fix the condition to avoid this.

Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20250407152759.25160-3-ulf.hansson@linaro.org
drivers/mmc/core/mmc.c