tools/flex: Revert "tools/flex: add autoreconf"
[openwrt/openwrt.git] / target / linux / lantiq / patches-4.9 / 0093-spi-double-time-out-tolerance.patch
1 From 833bfade96561216aa2129516a5926a0326860a2 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Mon, 17 Apr 2017 01:38:05 +0200
4 Subject: spi: double time out tolerance
5
6 The generic SPI code calculates how long the issued transfer would take
7 and adds 100ms in addition to the timeout as tolerance. On my 500 MHz
8 Lantiq Mips SoC I am getting timeouts from the SPI like this when the
9 system boots up:
10
11 m25p80 spi32766.4: SPI transfer timed out
12 blk_update_request: I/O error, dev mtdblock3, sector 2
13 SQUASHFS error: squashfs_read_data failed to read block 0x6e
14
15 After increasing the tolerance for the timeout to 200ms I haven't seen
16 these SPI transfer time outs any more.
17 The Lantiq SPI driver in use here has an extra work queue in between,
18 which gets triggered when the controller send the last word and the
19 hardware FIFOs used for reading and writing are only 8 words long.
20
21 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 Signed-off-by: Mark Brown <broonie@kernel.org>
23 ---
24 drivers/spi/spi.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27 --- a/drivers/spi/spi.c
28 +++ b/drivers/spi/spi.c
29 @@ -1004,7 +1004,7 @@ static int spi_transfer_one_message(stru
30 ret = 0;
31 ms = 8LL * 1000LL * xfer->len;
32 do_div(ms, xfer->speed_hz);
33 - ms += ms + 100; /* some tolerance */
34 + ms += ms + 200; /* some tolerance */
35
36 if (ms > UINT_MAX)
37 ms = UINT_MAX;