]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-3.18/mmc-omap-fix-the-maximum-timeout-setting.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / queue-3.18 / mmc-omap-fix-the-maximum-timeout-setting.patch
1 From f4c403a5bab34857b1d6e157b5e33cc54f77cdd9 Mon Sep 17 00:00:00 2001
2 From: Aaro Koskinen <aaro.koskinen@iki.fi>
3 Date: Sun, 3 Feb 2019 00:14:33 +0200
4 Subject: mmc: omap: fix the maximum timeout setting
5
6 [ Upstream commit a6327b5e57fdc679c842588c3be046c0b39cc127 ]
7
8 When running OMAP1 kernel on QEMU, MMC access is annoyingly noisy:
9
10 MMC: CTO of 0xff and 0xfe cannot be used!
11 MMC: CTO of 0xff and 0xfe cannot be used!
12 MMC: CTO of 0xff and 0xfe cannot be used!
13 [ad inf.]
14
15 Emulator warnings appear to be valid. The TI document SPRU680 [1]
16 ("OMAP5910 Dual-Core Processor MultiMedia Card/Secure Data Memory Card
17 (MMC/SD) Reference Guide") page 36 states that the maximum timeout is 253
18 cycles and "0xff and 0xfe cannot be used".
19
20 Fix by using 0xfd as the maximum timeout.
21
22 Tested using QEMU 2.5 (Siemens SX1 machine, OMAP310), and also checked on
23 real hardware using Palm TE (OMAP310), Nokia 770 (OMAP1710) and Nokia N810
24 (OMAP2420) that MMC works as before.
25
26 [1] http://www.ti.com/lit/ug/spru680/spru680.pdf
27
28 Fixes: 730c9b7e6630f ("[MMC] Add OMAP MMC host driver")
29 Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
30 Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
31 Signed-off-by: Sasha Levin <sashal@kernel.org>
32 ---
33 drivers/mmc/host/omap.c | 2 +-
34 1 file changed, 1 insertion(+), 1 deletion(-)
35
36 diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
37 index 11e5bfedab70..b9f4f39f9359 100644
38 --- a/drivers/mmc/host/omap.c
39 +++ b/drivers/mmc/host/omap.c
40 @@ -921,7 +921,7 @@ static inline void set_cmd_timeout(struct mmc_omap_host *host, struct mmc_reques
41 reg &= ~(1 << 5);
42 OMAP_MMC_WRITE(host, SDIO, reg);
43 /* Set maximum timeout */
44 - OMAP_MMC_WRITE(host, CTO, 0xff);
45 + OMAP_MMC_WRITE(host, CTO, 0xfd);
46 }
47
48 static inline void set_data_timeout(struct mmc_omap_host *host, struct mmc_request *req)
49 --
50 2.19.1
51