]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-omap3-2.6.37-psp04.02.00.07/omap3/0003-mmc-skip-detection-of-nonremovable-cards-on-rescan.patch
linux-omap3: Add supported kernel recipe for am37x-evm and am3517-evm
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-omap3-2.6.37-psp04.02.00.07 / omap3 / 0003-mmc-skip-detection-of-nonremovable-cards-on-rescan.patch
1 From 3627429b1a0cbe9380a9834fb91419fcb81be2ef Mon Sep 17 00:00:00 2001
2 From: Ohad Ben-Cohen <ohad@wizery.com>
3 Date: Sun, 28 Nov 2010 07:21:28 +0200
4 Subject: [PATCH 1/6] mmc: skip detection of nonremovable cards on rescan
6 mmc_rescan() checks whether registered cards are still present before
7 skipping them, by calling the bus-specific ->detect() handler.
9 With buses that support runtime PM, the card may be powered off at
10 this point, so they need to be powered on and fully reinitialized before
11 ->detect() executes.
13 This whole process is redundant with nonremovable cards; in those cases,
14 we can safely skip calling ->detect() and implicitly assume its success.
16 Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
17 Reviewed-by: Chris Ball <cjb@laptop.org>
18 Signed-off-by: Chris Ball <cjb@laptop.org>
19 ---
20  drivers/mmc/core/core.c |    8 ++++++--
21  1 files changed, 6 insertions(+), 2 deletions(-)
23 diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
24 index 57dcf8f..305e2a5 100644
25 --- a/drivers/mmc/core/core.c
26 +++ b/drivers/mmc/core/core.c
27 @@ -1446,8 +1446,12 @@ void mmc_rescan(struct work_struct *work)
29         mmc_bus_get(host);
31 -       /* if there is a card registered, check whether it is still present */
32 -       if ((host->bus_ops != NULL) && host->bus_ops->detect && !host->bus_dead)
33 +       /*
34 +        * if there is a _removable_ card registered, check whether it is
35 +        * still present
36 +        */
37 +       if (host->bus_ops && host->bus_ops->detect && !host->bus_dead
38 +           && mmc_card_is_removable(host))
39                 host->bus_ops->detect(host);
41         mmc_bus_put(host);
42 --
43 1.7.1