aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-09-14 06:57:07 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-09-14 06:57:07 +0000
commitdc4e09656adc02de5af848fae5d20bd51db9fec2 (patch)
tree8e9e2fb798d7925466c04181b3ae973856f3d831 /target/linux/ramips
parentb0b76c8782e4eb9059e497040eeeecc710f2e1fc (diff)
downloadupstream-dc4e09656adc02de5af848fae5d20bd51db9fec2.tar.gz
upstream-dc4e09656adc02de5af848fae5d20bd51db9fec2.tar.bz2
upstream-dc4e09656adc02de5af848fae5d20bd51db9fec2.zip
ramips: fix chunked-io support for big flash chips (#20504)
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Backport of r46904 git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@46905 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips')
-rw-r--r--target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch9
1 files changed, 6 insertions, 3 deletions
diff --git a/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch b/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch
index 2bffa1f696..1716e1cc49 100644
--- a/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch
+++ b/target/linux/ramips/patches-3.18/0044-mtd-add-chunked-read-io-to-m25p80.patch
@@ -16,7 +16,7 @@
u8 command[MAX_CMD_SIZE];
};
-@@ -157,6 +159,58 @@ static int m25p80_read(struct spi_nor *n
+@@ -157,6 +159,61 @@ static int m25p80_read(struct spi_nor *n
return 0;
}
@@ -31,6 +31,9 @@
+ if (!chunk_size)
+ chunk_size = _len;
+
++ if (nor->addr_width > 3)
++ chunk_size -= nor->addr_width - 3;
++
+ while (retlen < _len) {
+ size_t len = min_t(int, chunk_size, _len - retlen);
+ const u_char *buf = _buf + retlen;
@@ -75,7 +78,7 @@
static int m25p80_erase(struct spi_nor *nor, loff_t offset)
{
struct m25p *flash = nor->priv;
-@@ -197,6 +251,7 @@ static int m25p_probe(struct spi_device
+@@ -197,6 +254,7 @@ static int m25p_probe(struct spi_device
struct spi_nor *nor;
enum read_mode mode = SPI_NOR_NORMAL;
char *flash_name = NULL;
@@ -83,7 +86,7 @@
int ret;
data = dev_get_platdata(&spi->dev);
-@@ -244,6 +299,14 @@ static int m25p_probe(struct spi_device
+@@ -244,6 +302,14 @@ static int m25p_probe(struct spi_device
if (ret)
return ret;