]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
mmc: core: Do not rescan non-removable devices
authorJohan Rudholm <johan.rudholm@stericsson.com>
Thu, 23 Aug 2012 11:40:55 +0000 (13:40 +0200)
committerChris Ball <cjb@laptop.org>
Tue, 4 Sep 2012 17:58:27 +0000 (13:58 -0400)
If MMC_CAP_NONREMOVABLE is set, only issue a detect job on init.

Signed-off-by: Johan Rudholm <johan.rudholm@stericsson.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/core/core.c
include/linux/mmc/host.h

index 835c9f001a10e0beea374a5f37bcc7ec1a369292..af2c4d2fd69e6eb9ad24c382388a9f754cd36ebc 100644 (file)
@@ -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);
 
        /*
index f578a71d82a6b71bd1c9203b53e77713c4543065..d5d9bd4c5aa83678fbbd4bedfa4155e9c0fb2d60 100644 (file)
@@ -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 */