diff options
author | Florian Fainelli <florian@openwrt.org> | 2014-09-27 19:10:51 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2014-09-27 19:10:51 +0000 |
commit | 6918ea2484861cbf806c812b95a814ab40063c05 (patch) | |
tree | 3f4d53baabebad9339cadd1bbfaaf07ed61b9c1e /target/linux/brcm2708/patches-3.10/0182-fix-sign-in-sdhci_bcm2708_raw_writel-wait-calculatio.patch | |
parent | ff6b0d57b8e4dd9c72b13ac0586c523c8d6e8841 (diff) | |
download | upstream-6918ea2484861cbf806c812b95a814ab40063c05.tar.gz upstream-6918ea2484861cbf806c812b95a814ab40063c05.tar.bz2 upstream-6918ea2484861cbf806c812b95a814ab40063c05.zip |
brcm2708: update 3.10 patches with raspberrypi/rpi-3.10.y of 27 Apr. 2014
Update the 3.10 rasperry patches by rebasing raspberry/rpi-3.10-y
against linux-stable/v3.10.49.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
SVN-Revision: 42678
Diffstat (limited to 'target/linux/brcm2708/patches-3.10/0182-fix-sign-in-sdhci_bcm2708_raw_writel-wait-calculatio.patch')
-rw-r--r-- | target/linux/brcm2708/patches-3.10/0182-fix-sign-in-sdhci_bcm2708_raw_writel-wait-calculatio.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-3.10/0182-fix-sign-in-sdhci_bcm2708_raw_writel-wait-calculatio.patch b/target/linux/brcm2708/patches-3.10/0182-fix-sign-in-sdhci_bcm2708_raw_writel-wait-calculatio.patch new file mode 100644 index 0000000000..ac46325d6b --- /dev/null +++ b/target/linux/brcm2708/patches-3.10/0182-fix-sign-in-sdhci_bcm2708_raw_writel-wait-calculatio.patch @@ -0,0 +1,28 @@ +From c62717f4dbf933743d3bcde958062d790587ecef Mon Sep 17 00:00:00 2001 +From: Matt Whitlock <raspberrypi@mattwhitlock.name> +Date: Tue, 25 Mar 2014 03:45:21 -0400 +Subject: [PATCH 182/196] fix sign in sdhci_bcm2708_raw_writel wait calculation + +The ns_wait variable is intended to hold a lower bound on the number of nanoseconds that have elapsed since the last sdhci register write. However, the actual calculation of it was incorrect, as the subtraction was inverted. This commit fixes the calculation. + +Note that this correction has no bearing when running with the default cycle_delay of 2 and the default clock rate of 50 MHz, under which conditions ns_2clk is 40 nanoseconds and ns_wait, regardless of whether the subtraction is done correctly or incorrectly, cannot possibly be less than 40 except for during the one-microsecond period just before the tick counter wraps around to meet last_write_hpt (i.e., approximately 4295 seconds after the preceding sdhci register write). The correction in this commit only comes into play if ns_2clk > 1000, which requires a cycle_delay of 51 or greater when using the default clock rate. Under those conditions, sdhci_bcm2708_raw_writel will not wait for the full cycle_delay count if at least 1000 nanoseconds have elapsed since the last register write. +--- + drivers/mmc/host/sdhci-bcm2708.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c +index 2797ae6..9beab6a 100644 +--- a/drivers/mmc/host/sdhci-bcm2708.c ++++ b/drivers/mmc/host/sdhci-bcm2708.c +@@ -263,7 +263,7 @@ static void sdhci_bcm2708_raw_writel(struct sdhci_host *host, u32 val, int reg) + { + /* we must have waited at least this many ns: */ + unsigned int ns_wait = HPTIME_CLK_NS * +- (last_write_hpt - now - 1); ++ (now - last_write_hpt - 1); + if (ns_wait < ns_2clk) + ndelay(ns_2clk - ns_wait); + } +-- +1.9.1 + |