summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2014-03-30 19:03:55 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2014-03-30 19:03:55 +0000
commitc8dae2fc2f7b6c8f6fd428f09a7b014ab8728919 (patch)
treef90aa74c8425c551856ca0f21341b3187c5f57fe
parent95f088ab0ce79529fbb5a3d143053d363d90b0a6 (diff)
ralink: fix chuncked-io module
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40342 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/ramips/patches-3.10/0131-mtd-add-chunked-read-io-to-m25p80.patch17
1 files changed, 10 insertions, 7 deletions
diff --git a/target/linux/ramips/patches-3.10/0131-mtd-add-chunked-read-io-to-m25p80.patch b/target/linux/ramips/patches-3.10/0131-mtd-add-chunked-read-io-to-m25p80.patch
index 6a4f8abf35..6123ec1105 100644
--- a/target/linux/ramips/patches-3.10/0131-mtd-add-chunked-read-io-to-m25p80.patch
+++ b/target/linux/ramips/patches-3.10/0131-mtd-add-chunked-read-io-to-m25p80.patch
@@ -8,9 +8,11 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
drivers/mtd/devices/m25p80.c | 127 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 127 insertions(+)
---- a/drivers/mtd/devices/m25p80.c
-+++ b/drivers/mtd/devices/m25p80.c
-@@ -392,6 +392,57 @@ static int m25p80_read(struct mtd_info *
+Index: linux-3.10.34/drivers/mtd/devices/m25p80.c
+===================================================================
+--- linux-3.10.34.orig/drivers/mtd/devices/m25p80.c 2014-03-30 19:40:10.135292951 +0100
++++ linux-3.10.34/drivers/mtd/devices/m25p80.c 2014-03-30 19:44:40.151295482 +0100
+@@ -392,6 +392,58 @@
return 0;
}
@@ -34,6 +36,8 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ spi_message_add_tail(&t[0], &m);
+ spi_message_add_tail(&t[1], &m);
+
++ *retlen = 0;
++
+ while (idx < len) {
+ int rlen = (len - idx > 4) ? (4) : (len - idx);
+
@@ -56,8 +60,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+
+ spi_sync(flash->spi, &m);
+
-+ *retlen = m.actual_length - m25p_cmdsz(flash) -
-+ (flash->fast_read ? 1 : 0);
++ *retlen += m.actual_length - m25p_cmdsz(flash);
+
+ mutex_unlock(&flash->lock);
+ idx += rlen;
@@ -68,7 +71,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
/*
* Write an address range to the flash chip. Data must be written in
* FLASH_PAGESIZE chunks. The address range may be any size provided
-@@ -479,6 +530,76 @@ static int m25p80_write(struct mtd_info
+@@ -479,6 +531,76 @@
return 0;
}
@@ -145,7 +148,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
-@@ -1058,6 +1179,12 @@ static int m25p_probe(struct spi_device
+@@ -1058,6 +1180,12 @@
flash->fast_read = true;
#endif