mmc: mmci: Add support for SW busy-end timeouts
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 20 Jun 2023 09:11:13 +0000 (11:11 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Thu, 22 Jun 2023 09:06:37 +0000 (11:06 +0200)
commitb1a665932dc23cad0b8af2745cd9713f9e930d63
treea4a75fe3768360097ab1d304137fcdf737c00633
parentc467c8f081859d4f4ca4eee4fba54bb5d85d6c97
mmc: mmci: Add support for SW busy-end timeouts

The ux500 variant doesn't have a HW based timeout to use for busy-end IRQs.
To avoid hanging and waiting for the card to stop signaling busy, let's
schedule a delayed work, according to the corresponding cmd->busy_timeout
for the command. If the work gets to run, let's kick the IRQ handler to
complete the currently running request/command.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20230620091113.33393-1-ulf.hansson@linaro.org
drivers/mmc/host/mmci.c
drivers/mmc/host/mmci.h
drivers/mmc/host/mmci_stm32_sdmmc.c