Patchwork [PATCHi,v2] linux-omap-psp: Added patch by Steve Sakoman to fix timeout errors

login
register
mail settings
Submitter Joel A Fernandes
Date July 14, 2011, 9:52 p.m.
Message ID <1310680353-1980-1-git-send-email-agnel.joel@gmail.com>
Download mbox | patch
Permalink /patch/7615/
State New, archived
Headers show

Comments

Joel A Fernandes - July 14, 2011, 9:52 p.m.
This fixes MMC errors due to timeouts, and is borrowed from linux-omap-2.6.39 recipe (as noticed by Jason Kridner)

Signed-off-by: Joel A Fernandes <agnel.joel@gmail.com>
---
Changes since earlier patch:
 * Fixed commit summary

Some useful links shared by Jason:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42214.html
http://cgit.openembedded.net/cgit.cgi/openembedded/tree/recipes/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patchRelevant links:

The link to the patch in org.openembedded.dev:
http://cgit.openembedded.org/cgit.cgi/openembedded/tree/recipes/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch?h=org.openembedded.dev

 ...mc-Adjust-dto-to-eliminate-timeout-errors.patch |   22 ++++++++++++++++++++
 recipes/linux/linux-omap_2.6.32.bb                 |    1 +
 2 files changed, 23 insertions(+), 0 deletions(-)
 create mode 100644 recipes/linux/linux-omap-2.6.32/0010-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch

Patch

diff --git a/recipes/linux/linux-omap-2.6.32/0010-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch b/recipes/linux/linux-omap-2.6.32/0010-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch
new file mode 100644
index 0000000..ae5a7aa
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.32/0010-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch
@@ -0,0 +1,22 @@ 
+From 26a79f408bd41ad7b4a47f2683909d3fc1575eab Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Wed, 12 Jan 2011 05:54:55 -0800
+Subject: [PATCH 24/31] omap: mmc: Adjust dto to eliminate timeout errors
+
+A number of SD card types were experiencing timeout errors.  This
+could also lead to data corruption in some cases.
+
+This fix proposed by Sukumar Ghoral of TI.
+---
+diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
+index 9646a75..ef458d6 100644
+--- a/drivers/mmc/host/omap_hsmmc.c
++++ b/drivers/mmc/host/omap_hsmmc.c
+@@ -1032,6 +1032,7 @@ static void set_data_timeout(struct omap_hsmmc_host *host,
+ 	cycle_ns = 1000000000 / (clk_get_rate(host->fclk) / clkd);
+ 	timeout = timeout_ns / cycle_ns;
+ 	timeout += timeout_clks;
++	timeout *= 2;
+ 	if (timeout) {
+ 		while ((timeout & 0x80000000) == 0) {
+ 			dto += 1;
diff --git a/recipes/linux/linux-omap_2.6.32.bb b/recipes/linux/linux-omap_2.6.32.bb
index 348ec96..404387f 100644
--- a/recipes/linux/linux-omap_2.6.32.bb
+++ b/recipes/linux/linux-omap_2.6.32.bb
@@ -33,6 +33,7 @@  file://0005-ARM-OMAP-add-support-for-TCT-Zippy-to-Beagle-board.patch \
 file://0006-ARM-OMAP-Make-beagle-u-boot-partition-writable.patch \
 file://0007-ASoC-enable-audio-capture-by-default-for-twl4030.patch \
 file://0009-MTD-NAND-omap2-proper-fix-for-subpage-read-ECC-error.patch \
+file://0010-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch \
 file://madc/0009-drivers-mfd-add-twl4030-madc-driver.patch \
 file://madc/0010-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch \
 file://madc/0011-ARM-OMAP-Add-twl4030-madc-support-to-Beagle.patch \