mmc: core: Retry claim host in mmc_sd_detect

Use mmc_try_claim_host with a timeout instead of mmc_claim_host in
mmc_sd_detect. This is to ensure that mmc rescan work item is doesn't
get blocked on claim_host for longer period.

In the pm_suspend path, we cancel the mmc_rescan work item.
If this work item is already scheduled, suspend would be blocked till
mmc_rescan gets finished. In case, mmc_rescan is blocked on claim_host
lock, pm_suspend could get blocked for longer period.  This can result
in momentary UI freeze since pm_suspend is blocked for longer duration.
This change is to prevent this scenario.

Change-Id: Ib93bae6745a153bad3579ae42f46c3c3a7c1b95a
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 227b1e2..b718105 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -214,6 +214,7 @@
 
 extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort);
 extern void mmc_release_host(struct mmc_host *host);
+extern int mmc_try_claim_host(struct mmc_host *host, unsigned int delay);
 
 extern void mmc_get_card(struct mmc_card *card);
 extern void mmc_put_card(struct mmc_card *card);