aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-4.19/450-mtd-m25p80-allow-fallback-from-spi_flash_read-to-reg.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2018-11-01 17:57:55 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2018-12-15 12:50:06 +0100
commit52a82ce3dd901a1536c7d7d9d963e9c2d761c816 (patch)
tree79020fb59420fcea7bdc4b12272f7251e101fe64 /target/linux/generic/pending-4.19/450-mtd-m25p80-allow-fallback-from-spi_flash_read-to-reg.patch
parenta272af75cd8c67d265400f96c1e6bb172315c23c (diff)
downloadupstream-52a82ce3dd901a1536c7d7d9d963e9c2d761c816.tar.gz
upstream-52a82ce3dd901a1536c7d7d9d963e9c2d761c816.tar.bz2
upstream-52a82ce3dd901a1536c7d7d9d963e9c2d761c816.zip
kernel: Copy patches from kernel 4.14 to 4.19
This just copies the files from the kernel 4.14 specific folders into the kernel 4.19 specific folder, no changes are done to the files in this commit. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'target/linux/generic/pending-4.19/450-mtd-m25p80-allow-fallback-from-spi_flash_read-to-reg.patch')
-rw-r--r--target/linux/generic/pending-4.19/450-mtd-m25p80-allow-fallback-from-spi_flash_read-to-reg.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/target/linux/generic/pending-4.19/450-mtd-m25p80-allow-fallback-from-spi_flash_read-to-reg.patch b/target/linux/generic/pending-4.19/450-mtd-m25p80-allow-fallback-from-spi_flash_read-to-reg.patch
new file mode 100644
index 0000000000..accd63df58
--- /dev/null
+++ b/target/linux/generic/pending-4.19/450-mtd-m25p80-allow-fallback-from-spi_flash_read-to-reg.patch
@@ -0,0 +1,36 @@
+From: Felix Fietkau <nbd@nbd.name>
+Date: Fri, 23 Feb 2018 17:12:16 +0100
+Subject: [PATCH] mtd: m25p80: allow fallback from spi_flash_read to regular
+ SPI transfer
+
+Some flash controllers, e.g. on the ath79 platform can support a fast
+flash read via memory mapping, but only if the flash chip is in
+3-byte address mode.
+
+Since spi_flash_read_supported does not have access to the same data as
+spi_flash_read, the driver can't detect an unsupported call until m25p80
+has decided to use spi_flash_read.
+
+Allow the driver to indicate a fallback to a regular SPI transfer by
+returning -EOPNOTSUPP
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+
+--- a/drivers/mtd/devices/m25p80.c
++++ b/drivers/mtd/devices/m25p80.c
+@@ -170,9 +170,11 @@ static ssize_t m25p80_read(struct spi_no
+ msg.data_nbits = data_nbits;
+
+ ret = spi_flash_read(spi, &msg);
+- if (ret < 0)
+- return ret;
+- return msg.retlen;
++ if (ret != -EOPNOTSUPP) {
++ if (ret < 0)
++ return ret;
++ return msg.retlen;
++ }
+ }
+
+ spi_message_init(&m);