OSDN Git Service

mmc: core: Use mmc_get_cd_gpio to get cd gpio status in resume path
authorVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
Thu, 26 Jul 2018 12:35:31 +0000 (18:05 +0530)
committerVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
Thu, 26 Jul 2018 12:52:44 +0000 (18:22 +0530)
The change a4d7728mmc(core: Update SD card removal logic based on cd-
gpio state), has introduced logic to read the card presence status in
resume path of mmc_pm_notify(), for forcing card detection if card is
removed. But the API being used for getting gpio status invoking sleep
calls from resume context which shouldn't have any sleep calls.

So updated the resume path with different API for getting cd-gpio
state.

This chagne is not needed 4.9 kernel onwards since the there the
sdhci_get_cd() API has different implementation.

Change-Id: I5e7e760c6345a6fcdc873849d11f0bb32af09295
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
drivers/mmc/core/core.c

index e4e4e04..76dbbbd 100644 (file)
@@ -4572,8 +4572,8 @@ int mmc_pm_notify(struct notifier_block *notify_block,
 
                spin_lock_irqsave(&host->lock, flags);
                host->rescan_disable = 0;
-               if (host->ops->get_cd)
-                       present = host->ops->get_cd(host);
+               if (mmc_card_is_removable(host))
+                       present = !!mmc_gpio_get_cd(host);
 
                if (mmc_bus_manual_resume(host) &&
                                !host->ignore_bus_resume_flags &&