summaryrefslogtreecommitdiff
path: root/packages/linux/linux-openzaurus-2.6.16+git/rmk-mmc1.patch
diff options
context:
space:
mode:
authorErik Hovland <erik@hovland.org>2006-05-08 18:59:10 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-05-08 18:59:10 +0000
commit7ed412e1e868f20a0e803e91e3d7e3529f61b44e (patch)
treee8fb8fb8ea912ff29dca4bfdc0ce0e1aca3bc0a5 /packages/linux/linux-openzaurus-2.6.16+git/rmk-mmc1.patch
parent07423bdbbb7ce2d14455d6b886d4b0156cd28a18 (diff)
parent9e3e9161817697df633d46cc88f0ce9e8365c032 (diff)
merge of 406934f50b9f92db47af1cb9d9777b268c5484b5
and 6ba2bb7b7ce5ef334cf514386df28b8d6a2aad86
Diffstat (limited to 'packages/linux/linux-openzaurus-2.6.16+git/rmk-mmc1.patch')
-rw-r--r--packages/linux/linux-openzaurus-2.6.16+git/rmk-mmc1.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/packages/linux/linux-openzaurus-2.6.16+git/rmk-mmc1.patch b/packages/linux/linux-openzaurus-2.6.16+git/rmk-mmc1.patch
new file mode 100644
index 0000000000..054b48d28d
--- /dev/null
+++ b/packages/linux/linux-openzaurus-2.6.16+git/rmk-mmc1.patch
@@ -0,0 +1,61 @@
+
+The CSD contains a "read2write factor" which determines the multiplier to
+be applied to the read timeout to obtain the write timeout. We were
+ignoring this parameter, resulting in the possibility for writes being
+timed out too early.
+
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+
+diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
+--- a/drivers/mmc/mmc.c
++++ b/drivers/mmc/mmc.c
+@@ -549,6 +549,7 @@ static void mmc_decode_csd(struct mmc_ca
+ csd->read_partial = UNSTUFF_BITS(resp, 79, 1);
+ csd->write_misalign = UNSTUFF_BITS(resp, 78, 1);
+ csd->read_misalign = UNSTUFF_BITS(resp, 77, 1);
++ csd->r2w_factor = UNSTUFF_BITS(resp, 26, 3);
+ csd->write_blkbits = UNSTUFF_BITS(resp, 22, 4);
+ csd->write_partial = UNSTUFF_BITS(resp, 21, 1);
+ } else {
+@@ -583,6 +584,7 @@ static void mmc_decode_csd(struct mmc_ca
+ csd->read_partial = UNSTUFF_BITS(resp, 79, 1);
+ csd->write_misalign = UNSTUFF_BITS(resp, 78, 1);
+ csd->read_misalign = UNSTUFF_BITS(resp, 77, 1);
++ csd->r2w_factor = UNSTUFF_BITS(resp, 26, 3);
+ csd->write_blkbits = UNSTUFF_BITS(resp, 22, 4);
+ csd->write_partial = UNSTUFF_BITS(resp, 21, 1);
+ }
+diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c
+--- a/drivers/mmc/mmc_block.c
++++ b/drivers/mmc/mmc_block.c
+@@ -187,6 +187,12 @@ static int mmc_blk_issue_rq(struct mmc_q
+ brq.cmd.opcode = MMC_WRITE_BLOCK;
+ brq.data.flags |= MMC_DATA_WRITE;
+ brq.data.blocks = 1;
++
++ /*
++ * Scale up the timeout by the r2w factor
++ */
++ brq.data.timeout_ns <<= card->csd.r2w_factor;
++ brq.data.timeout_clks <<= card->csd.r2w_factor;
+ }
+
+ if (brq.data.blocks > 1) {
+diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
+--- a/include/linux/mmc/card.h
++++ b/include/linux/mmc/card.h
+@@ -28,6 +28,7 @@ struct mmc_csd {
+ unsigned short cmdclass;
+ unsigned short tacc_clks;
+ unsigned int tacc_ns;
++ unsigned int r2w_factor;
+ unsigned int max_dtr;
+ unsigned int read_blkbits;
+ unsigned int write_blkbits;
+
+
+-------------------------------------------------------------------
+List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
+FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
+Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
+