brcm2708: update against latest rpi-3.10.y branch
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0010-sdcard-patch-improvements-from-naren.patch
1 From 7063eab83522ea1f24934b971418bfdd4c5578f1 Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Thu, 17 May 2012 14:44:19 +0100
4 Subject: [PATCH 010/174] sdcard patch improvements from naren
5
6 ---
7  drivers/mmc/host/sdhci-bcm2708.c | 23 +++++++----------------
8  1 file changed, 7 insertions(+), 16 deletions(-)
9
10 --- a/drivers/mmc/host/sdhci-bcm2708.c
11 +++ b/drivers/mmc/host/sdhci-bcm2708.c
12 @@ -886,8 +886,7 @@ static void sdhci_bcm2708_dma_complete_i
13                    We get CRC and DEND errors unless we wait for
14                    the SD controller to finish reading/writing to the card. */
15                 u32 state_mask;
16 -               int timeout=1000000;
17 -               hptime_t now = hptime();
18 +               int timeout=1000;
19  
20                 DBG("PDMA over - sync card\n");
21                 if (data->flags & MMC_DATA_READ)
22 @@ -895,17 +894,12 @@ static void sdhci_bcm2708_dma_complete_i
23                 else
24                         state_mask = SDHCI_DOING_WRITE;
25  
26 -               while (0 != (sdhci_bcm2708_raw_readl(host,
27 -                                                    SDHCI_PRESENT_STATE) &
28 -                            state_mask) && --timeout > 0)
29 +               while (0 != (sdhci_bcm2708_raw_readl(host, SDHCI_PRESENT_STATE) 
30 +                       & state_mask) && --timeout > 0)
31 +               {
32 +                       udelay(100);
33                         continue;
34 -
35 -               if (1000000-timeout > 4000) /*ave. is about 3250*/
36 -                       DBG("%s: note - long %s sync %luns - "
37 -                              "%d its.\n",
38 -                              mmc_hostname(host->mmc),
39 -                              data->flags & MMC_DATA_READ? "read": "write",
40 -                              since_ns(now), 1000000-timeout);
41 +               }
42                 if (timeout <= 0)
43                         printk(KERN_ERR"%s: final %s to SD card still "
44                                "running\n",
45 @@ -1175,10 +1169,7 @@ static unsigned int sdhci_bcm2708_uhs_br
46  
47  static unsigned int sdhci_bcm2708_missing_status(struct sdhci_host *host)
48  {
49 -       if(host->last_cmdop == MMC_SEND_STATUS)
50 -               return 1;
51 -       else
52 -               return 0;
53 +       return 1;
54  }
55  
56  /***************************************************************************** \