kernel: bump 4.9 to 4.9.137
[openwrt/staging/chunkeey.git] / target / linux / bcm53xx / patches-4.14 / 081-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch
1 From 940ec770c295682993d1cccce3081fd7c74fece8 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Thu, 11 Oct 2018 09:42:17 +0200
4 Subject: [PATCH] spi: bcm-qspi: switch back to reading flash using smaller
5 chunks
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Fixing/optimizing bcm_qspi_bspi_read() performance introduced two
11 changes:
12 1) It added a loop to read all requested data using multiple BSPI ops.
13 2) It bumped max size of a single BSPI block request from 256 to 512 B.
14
15 The later change resulted in occasional BSPI timeouts causing a
16 regression.
17
18 For some unknown reason hardware doesn't always handle reads as expected
19 when using 512 B chunks. In such cases it may happen that BSPI returns
20 amount of requested bytes without the last 1-3 ones. It provides the
21 remaining bytes later but doesn't raise an interrupt until another LR
22 start.
23
24 Switching back to 256 B reads fixes that problem and regression.
25
26 Fixes: 345309fa7c0c ("spi: bcm-qspi: Fix bcm_qspi_bspi_read() performance")
27 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
28 Signed-off-by: Mark Brown <broonie@kernel.org>
29 Cc: stable@vger.kernel.org
30 ---
31 drivers/spi/spi-bcm-qspi.c | 2 +-
32 1 file changed, 1 insertion(+), 1 deletion(-)
33
34 --- a/drivers/spi/spi-bcm-qspi.c
35 +++ b/drivers/spi/spi-bcm-qspi.c
36 @@ -88,7 +88,7 @@
37 #define BSPI_BPP_MODE_SELECT_MASK BIT(8)
38 #define BSPI_BPP_ADDR_SELECT_MASK BIT(16)
39
40 -#define BSPI_READ_LENGTH 512
41 +#define BSPI_READ_LENGTH 256
42
43 /* MSPI register offsets */
44 #define MSPI_SPCR0_LSB 0x000