Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.19 /drivers/mmc/mmc.c

Filename:/drivers/mmc/mmc.c
Lines Added:20
Lines Deleted:6
Also changed in: (Previous) 2.6.19-rc6  2.6.19-rc5-git7  2.6.19-rc5-git6  2.6.19-rc5-git5  2.6.19-rc5-git4  2.6.19-rc5 
(Following) 2.6.19-git2  2.6.19-git3  2.6.19-git4  2.6.19-git5  2.6.19-git6  2.6.19-git7 

Location
[  2.6.19
  [  drivers
    [  mmc
       o  mmc.c

Patch

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 74eaaee..766bc54 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -475,7 +475,7 @@ static u32 mmc_select_voltage(struct mmc_host *host, u32 ocr)
    if (bit) {
       bit -= 1;
 
-      ocr = 3 << bit;
+      ocr &= 3 << bit;
 
       host->ios.vdd = bit;
       mmc_set_ios(host);
@@ -996,7 +996,6 @@ static void mmc_read_scrs(struct mmc_host *host)
 
       mmc_set_data_timeout(&data, card, 0);
 
-      data.blksz_bits = 3;
       data.blksz = 1 << 3;
       data.blocks = 1;
       data.flags = MMC_DATA_READ;
@@ -1167,9 +1166,9 @@ static void mmc_setup(struct mmc_host *host)
 void mmc_detect_change(struct mmc_host *host, unsigned long delay)
 {
    if (delay)
-      schedule_delayed_work(&host->detect, delay);
+      mmc_schedule_delayed_work(&host->detect, delay);
    else
-      schedule_work(&host->detect);
+      mmc_schedule_work(&host->detect);
 }
 
 EXPORT_SYMBOL(mmc_detect_change);
@@ -1179,14 +1178,29 @@ static void mmc_rescan(void *data)
 {
    struct mmc_host *host = data;
    struct list_head *l, *n;
+   unsigned char power_mode;
 
    mmc_claim_host(host);
 
-   if (host->ios.power_mode == MMC_POWER_ON)
+   /*
+    * Check for removed cards and newly inserted ones. We check for
+    * removed cards first so we can intelligently re-select the VDD.
+    */
+   power_mode = host->ios.power_mode;
+   if (power_mode == MMC_POWER_ON)
       mmc_check_cards(host);
 
    mmc_setup(host);
 
+   /*
+    * Some broken cards process CMD1 even in stand-by state. There is
+    * no reply, but an ILLEGAL_COMMAND error is cached and returned
+    * after next command. We poll for card status here to clear any
+    * possibly pending error.
+    */
+   if (power_mode == MMC_POWER_ON)
+      mmc_check_cards(host);
+
    if (!list_empty(&host->cards)) {
       /*
        * (Re-)calculate the fastest clock rate which the
@@ -1312,7 +1326,7 @@ EXPORT_SYMBOL(mmc_remove_host);
  */
 void mmc_free_host(struct mmc_host *host)
 {
-   flush_scheduled_work();
+   mmc_flush_scheduled_work();
    mmc_free_host_sysfs(host);
 }
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.