diff mbox

mmc: core: Do not rescan non-removable devices

Message ID 1345722055-12459-1-git-send-email-johan.rudholm@stericsson.com (mailing list archive)
State New, archived
Headers show

Commit Message

Johan Rudholm Aug. 23, 2012, 11:40 a.m. UTC
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>
---
 drivers/mmc/core/core.c  |    5 +++++
 include/linux/mmc/host.h |    1 +
 2 files changed, 6 insertions(+)

Comments

Linus Walleij Aug. 23, 2012, 1:56 p.m. UTC | #1
On Thu, Aug 23, 2012 at 1:40 PM, Johan Rudholm
<johan.rudholm@stericsson.com> wrote:

> 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>

Seems logical...
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chris Ball Aug. 27, 2012, 11:13 p.m. UTC | #2
Hi,

On Thu, Aug 23 2012, Linus Walleij wrote:
> On Thu, Aug 23, 2012 at 1:40 PM, Johan Rudholm
> <johan.rudholm@stericsson.com> wrote:
>
>> 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>
>
> Seems logical...
> Acked-by: Linus Walleij <linus.walleij@linaro.org>

Thanks, pushed to mmc-next for 3.7.

- Chris.
diff mbox

Patch

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 8ac5246..2f4e273 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2052,6 +2052,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 */