]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mmc: sdhci-msm: Ensure SD card power isn't ON when card removed
authorSarthak Garg <quic_sartgarg@quicinc.com>
Tue, 1 Jul 2025 10:06:59 +0000 (15:36 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:41:00 +0000 (18:41 +0200)
commit5d6e92f8a88d56ea76f0ece3d2189c81fce906fe
tree8bcd474bb6f30bec55f779161a91db8a46729477
parent11d16a93471f75e45f986d4e5505fd65eeaec2a4
mmc: sdhci-msm: Ensure SD card power isn't ON when card removed

[ Upstream commit db58532188ebf51d52b1d7693d9e94c76b926e9f ]

Many mobile phones feature multi-card tray designs, where the same
tray is used for both SD and SIM cards. If the SD card is placed
at the outermost location in the tray, the SIM card may come in
contact with SD card power-supply while removing the tray, possibly
resulting in SIM damage.

To prevent that, make sure the SD card is really inserted by reading
the Card Detect pin state. If it's not, turn off the power in
sdhci_msm_check_power_status() and also set the BUS_FAIL power state
on the controller as part of pwr_irq handling for BUS_ON request.

Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20250701100659.3310386-1-quic_sartgarg@quicinc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mmc/host/sdhci-msm.c