]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: core: Disable card detect during shutdown
authorUlf Hansson <ulf.hansson@linaro.org>
Fri, 3 Dec 2021 14:15:54 +0000 (15:15 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 20 Dec 2021 10:09:15 +0000 (11:09 +0100)
commit8dee719f89184619554d35a99c7b57a3d99424c5
treecc524c76e200a44c4a0a040a1b196d7723ab0523
parent086d9ed71f334b4f8fa2d485ab4ac66db6166a12
mmc: core: Disable card detect during shutdown

It's seems prone to problems by allowing card detect and its corresponding
mmc_rescan() work to run, during platform shutdown. For example, we may end
up turning off the power while initializing a card, which potentially could
damage it.

To avoid this scenario, let's add ->shutdown_pre() callback for the mmc host
class device and then turn of the card detect from there.

Reported-by: Al Cooper <alcooperx@gmail.com>
Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20211203141555.105351-1-ulf.hansson@linaro.org
drivers/mmc/core/core.c
drivers/mmc/core/core.h
drivers/mmc/core/host.c