brcm2708: update 3.10 patches with raspberrypi/rpi-3.10.y of 27 Apr. 2014
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0018-Use-ndelay-rather-than-udelay.-Thanks-lb.patch
1 From 3755210aaea18a4531069911f36a4771339565c4 Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Fri, 22 Jun 2012 12:57:42 +0100
4 Subject: [PATCH 018/196] Use ndelay rather than udelay. Thanks lb
5
6 ---
7  drivers/mmc/host/sdhci-bcm2708.c | 8 ++++----
8  1 file changed, 4 insertions(+), 4 deletions(-)
9
10 diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c
11 index b0cdd7d..7bba950 100644
12 --- a/drivers/mmc/host/sdhci-bcm2708.c
13 +++ b/drivers/mmc/host/sdhci-bcm2708.c
14 @@ -249,14 +249,14 @@ static void sdhci_bcm2708_raw_writel(struct sdhci_host *host, u32 val, int reg)
15                 if (now == last_write_hpt || now == last_write_hpt+1) {
16                          /* we can't guarantee any significant time has
17                           * passed - we'll have to wait anyway ! */
18 -                       udelay((ns_2clk+1000-1)/1000);
19 +                       ndelay(ns_2clk);
20                 } else
21                 {
22                         /* we must have waited at least this many ns: */
23                         unsigned int ns_wait = HPTIME_CLK_NS *
24                                                (last_write_hpt - now - 1);
25                         if (ns_wait < ns_2clk)
26 -                               udelay((ns_2clk-ns_wait+500)/1000);
27 +                               ndelay(ns_2clk - ns_wait);
28                 }
29                 last_write_hpt = now;
30         }
31 @@ -272,13 +272,13 @@ static void sdhci_bcm2708_raw_writel(struct sdhci_host *host, u32 val, int reg)
32                 ier &= ~SDHCI_INT_DATA_TIMEOUT;
33                 writel(ier, host->ioaddr + SDHCI_SIGNAL_ENABLE);
34                 timeout_disabled = true;
35 -               udelay((ns_2clk+1000-1)/1000);
36 +               ndelay(ns_2clk);
37         } else if (timeout_disabled) {
38                 ier = readl(host->ioaddr + SDHCI_SIGNAL_ENABLE);
39                 ier |= SDHCI_INT_DATA_TIMEOUT;
40                 writel(ier, host->ioaddr + SDHCI_SIGNAL_ENABLE);
41                 timeout_disabled = false;
42 -               udelay((ns_2clk+1000-1)/1000);
43 +               ndelay(ns_2clk);
44         }
45  #endif
46         writel(val, host->ioaddr + reg);
47 -- 
48 1.9.1
49