]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.28.8/mmc-fix-data-timeout-for-send_ext_csd.patch
Linux 4.14.107
[thirdparty/kernel/stable-queue.git] / releases / 2.6.28.8 / mmc-fix-data-timeout-for-send_ext_csd.patch
1 From cda56ac29f2d8288d62978272856884d26e0b47b Mon Sep 17 00:00:00 2001
2 From: Adrian Hunter <adrian.hunter@nokia.com>
3 Date: Tue, 10 Feb 2009 16:32:33 +0200
4 Subject: mmc: fix data timeout for SEND_EXT_CSD
5
6 From: Adrian Hunter <adrian.hunter@nokia.com>
7
8 commit cda56ac29f2d8288d62978272856884d26e0b47b upstream.
9
10 Commit 0d3e0460f307e84904968aad6cff97bd688583d8
11 "MMC: CSD and CID timeout values" inadvertently broke
12 the timeout for the MMC command SEND_EXT_CSD.
13
14 This patch puts it back again.
15
16 Depending on the characteristics of the controller,
17 this bug may prevent the use of MMC cards.
18
19 Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
20 Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
22
23 ---
24 drivers/mmc/core/mmc_ops.c | 15 +++++++++------
25 1 file changed, 9 insertions(+), 6 deletions(-)
26
27 --- a/drivers/mmc/core/mmc_ops.c
28 +++ b/drivers/mmc/core/mmc_ops.c
29 @@ -248,12 +248,15 @@ mmc_send_cxd_data(struct mmc_card *card,
30
31 sg_init_one(&sg, data_buf, len);
32
33 - /*
34 - * The spec states that CSR and CID accesses have a timeout
35 - * of 64 clock cycles.
36 - */
37 - data.timeout_ns = 0;
38 - data.timeout_clks = 64;
39 + if (opcode == MMC_SEND_CSD || opcode == MMC_SEND_CID) {
40 + /*
41 + * The spec states that CSR and CID accesses have a timeout
42 + * of 64 clock cycles.
43 + */
44 + data.timeout_ns = 0;
45 + data.timeout_clks = 64;
46 + } else
47 + mmc_set_data_timeout(&data, card);
48
49 mmc_wait_for_req(host, &mrq);
50