aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-4.9/001-4.11-01-mtd-m25p80-consider-max-message-size-in-m25p80_read.patch
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2018-01-13 13:18:10 +0100
committerJonas Gorski <jonas.gorski@gmail.com>2018-02-11 23:15:05 +0100
commitb0c5e8b9274188bf3bb238e013e324542ee747c4 (patch)
tree4cd32d3be6ef96eaa069d2e6cd52b625da07def1 /target/linux/brcm63xx/patches-4.9/001-4.11-01-mtd-m25p80-consider-max-message-size-in-m25p80_read.patch
parenta27d59bb427466311fe7e69da3f0f53be18237aa (diff)
downloadupstream-b0c5e8b9274188bf3bb238e013e324542ee747c4.tar.gz
upstream-b0c5e8b9274188bf3bb238e013e324542ee747c4.tar.bz2
upstream-b0c5e8b9274188bf3bb238e013e324542ee747c4.zip
brcm63xx: add kernel 4.9 support
Add support for kernel 4.9 based on the more upstream comformant partition defintions. Increases compressed kernel size by ~95k compared to 4.4. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Diffstat (limited to 'target/linux/brcm63xx/patches-4.9/001-4.11-01-mtd-m25p80-consider-max-message-size-in-m25p80_read.patch')
-rw-r--r--target/linux/brcm63xx/patches-4.9/001-4.11-01-mtd-m25p80-consider-max-message-size-in-m25p80_read.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.11-01-mtd-m25p80-consider-max-message-size-in-m25p80_read.patch b/target/linux/brcm63xx/patches-4.9/001-4.11-01-mtd-m25p80-consider-max-message-size-in-m25p80_read.patch
new file mode 100644
index 0000000000..e90270156e
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.9/001-4.11-01-mtd-m25p80-consider-max-message-size-in-m25p80_read.patch
@@ -0,0 +1,30 @@
+From 80a79a889ce5df16c5261ab2f1e8e63b94b78102 Mon Sep 17 00:00:00 2001
+From: Heiner Kallweit <hkallweit1@gmail.com>
+Date: Fri, 28 Oct 2016 07:58:46 +0200
+Subject: [PATCH 1/8] mtd: m25p80: consider max message size in m25p80_read
+
+Consider a message size limit when calculating the maximum amount
+of data that can be read.
+
+The message size limit has been introduced with 4.9, so cc it
+to stable.
+
+Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
+Cc: <stable@vger.kernel.org> # 4.9.x
+Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
+---
+ drivers/mtd/devices/m25p80.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/mtd/devices/m25p80.c
++++ b/drivers/mtd/devices/m25p80.c
+@@ -172,7 +172,8 @@ static ssize_t m25p80_read(struct spi_no
+
+ t[1].rx_buf = buf;
+ t[1].rx_nbits = m25p80_rx_nbits(nor);
+- t[1].len = min(len, spi_max_transfer_size(spi));
++ t[1].len = min3(len, spi_max_transfer_size(spi),
++ spi_max_message_size(spi) - t[0].len);
+ spi_message_add_tail(&t[1], &m);
+
+ ret = spi_sync(spi, &m);