mmc: Extend wakelock if bus is dead
authorJohn Stultz <john.stultz@linaro.org>
Fri, 4 Dec 2015 20:13:13 +0000 (12:13 -0800)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 16 Feb 2016 21:51:05 +0000 (13:51 -0800)
This patch sets extend_wakelock if the host's
bus is marked dead due to card removal.

This change was originally made in bc4dc52f178828
(mmc: mmcblk: Add support for deferred SD bus resume),
which was reverted due to the majority of the patch
no longer building or making sense. However one small
part of that patch ought to be saved.

Signed-off-by: John Stultz <john.stultz@linaro.org>
drivers/mmc/core/core.c

index 1b34aeb81fec0fa4d936a5aefd91122b68abe5fb..9c9bd3c906375c59669dbef7f99616ffd316bab1 100644 (file)
@@ -2596,6 +2596,12 @@ void mmc_rescan(struct work_struct *work)
 
        host->detect_change = 0;
 
+       /* If the card was removed the bus will be marked
+        * as dead - extend the wakelock so userspace
+        * can respond */
+       if (host->bus_dead)
+               extend_wakelock = 1;
+
        /*
         * Let mmc_bus_put() free the bus/bus_ops if we've found that
         * the card is no longer present.