From: Jerry Huang <Chang-Ming.Huang@xxxxxxxxxxxxx> Before running get_cd() recall function to detect whether the card is present, must make sure the power is up. Signed-off-by: Jerry Huang <Chang-Ming.Huang@xxxxxxxxxxxxx> CC: Chris Ball <cjb@xxxxxxxxxx> --- changes for v2: - add the CC changes for v3: - use power_up/off only when get_cd defined drivers/mmc/core/core.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 5278ffb..a863a41 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2066,8 +2066,14 @@ void mmc_rescan(struct work_struct *work) */ mmc_bus_put(host); - if (host->ops->get_cd && host->ops->get_cd(host) == 0) - goto out; + if (host->ops->get_cd) { + int err; + mmc_power_up(host); + err = host->ops->get_cd(host); + mmc_power_off(host); + if (err == 0) + goto out; + } mmc_claim_host(host); for (i = 0; i < ARRAY_SIZE(freqs); i++) { -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html