mmc: core: Allow mmc_start_host() synchronously detect a card
authorDennis Zhou <dennis@kernel.org>
Wed, 29 Mar 2023 23:48:01 +0000 (16:48 -0700)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 13 Jun 2023 14:08:16 +0000 (16:08 +0200)
commit2cc83bf7d41113d95c5e8aa0938a73d6cd7082bb
tree1907272d477f230b086614ad2d298091e166b9ff
parent3108eb2e8aa7e955a9dd3a4c1bf19a7898961822
mmc: core: Allow mmc_start_host() synchronously detect a card

When using dm-verity with a data partition on an emmc device, dm-verity
races with the initialization of the (e)MMC/SD cards. This is because the
card detection procedure is being managed from a workqueue, rather than
synchronously from the mmc host's ->probe() routine.

To allow the card detect to be synchronous, let's simply skip using the
workqueue at the first initialization attempt from mmc_start_host().

Signed-off-by: Dennis Zhou <dennis@kernel.org>
Link: https://lore.kernel.org/r/ZCTOMVjW+pnZVGsQ@snowbird
[Ulf: Re-wrote the commit message to clarify the change]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/core.c