]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mmc: core: Enable eMMC sleep commands to use HW busy polling
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 4 May 2021 16:12:16 +0000 (18:12 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 24 May 2021 13:12:28 +0000 (15:12 +0200)
commit25c193d3b483cbd038a794f7c978f9e3fbe53989
treee65b98029200fc69f9640466c7a51c036aac0378
parent6776f7dc36a88339bc49744732ed1e33ea6891e3
mmc: core: Enable eMMC sleep commands to use HW busy polling

After the eMMC sleep command (CMD5) has been sent, the card start signals
busy on the DAT0 line, which can be monitored to understand when it's
allowed to proceed to power off the VCC regulator.

When MMC_CAP_WAIT_WHILE_BUSY isn't supported by the host the DAT0 line
isn't being monitored for busy completion, but instead we are waiting a
fixed period of time. The time corresponds to the sleep timeout that is
specified in the EXT_CSD register of the eMMC card. This is many cases
suboptimal, as the timeout corresponds to the worst case scenario.

To improve the situation add support for HW busy polling through the
->card_busy() host ops, when the host supports this.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20210504161222.101536-6-ulf.hansson@linaro.org
drivers/mmc/core/mmc.c