hi,
 the commit below causes my wifi to disappear on suspend and never
 reappear.
 Unfortunately the commentary says what the patch does but not why, so I
 cannot tell if simply reverting it is correct, or if something more subtle
 in needed.

 My wifi chip is a "libertas" driven "Marvell" chip.  It is permanently
 attached to port 1 on an OMAP3 'hsmmc' interface.  So MMC_CAP_NONREMOVABLE
 seem appropriate and is set.

 It is normally inactive and when the suspend code notices this it doesn't
 bother trying to suspend through the driver but just removes the core:
                        /*
                         * We simply "remove" the card in this case.
                         * It will be redetected on resume.  (Calling
                         * bus_ops->remove() with a claimed host can
                         * deadlock.)
                         */
 (in mmc_suspend_host).  Only it isn't redetected on resume because
 rescan_entered is set.

 I guess we could clear rescan_entered at this point.  Would that make sense?
 It seems to work.

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 06c42cf..65b8935 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2433,6 +2433,7 @@ int mmc_suspend_host(struct mmc_host *host)
                        mmc_claim_host(host);
                        mmc_detach_bus(host);
                        mmc_power_off(host);
+                       host->rescan_entered = 0;
                        mmc_release_host(host);
                        host->pm_flags = 0;
                        err = 0;


Thanks,
NeilBrown



From 3339d1e33185798a45dbdb5ea6c0bec1c27ca5fd Mon Sep 17 00:00:00 2001
From: Johan Rudholm <[email protected]>
Date: Thu, 23 Aug 2012 13:40:55 +0200
Subject: [PATCH] mmc: core: Do not rescan non-removable devices

If MMC_CAP_NONREMOVABLE is set, only issue a detect job on init.

Signed-off-by: Johan Rudholm <[email protected]>
Acked-by: Ulf Hansson <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Chris Ball <[email protected]>

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 835c9f0..af2c4d2 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2053,6 +2053,11 @@ void mmc_rescan(struct work_struct *work)
        if (host->rescan_disable)
                return;
 
+       /* If there is a non-removable card registered, only scan once */
+       if ((host->caps & MMC_CAP_NONREMOVABLE) && host->rescan_entered)
+               return;
+       host->rescan_entered = 1;
+
        mmc_bus_get(host);
 
        /*
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index f578a71..d5d9bd4 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -300,6 +300,7 @@ struct mmc_host {
 #endif
 
        int                     rescan_disable; /* disable card detection */
+       int                     rescan_entered; /* used with nonremovable 
devices */
 
        struct mmc_card         *card;          /* device attached to this host 
*/
 

Attachment: signature.asc
Description: PGP signature

Reply via email to