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
6 From: Adrian Hunter <adrian.hunter@nokia.com>
8 commit cda56ac29f2d8288d62978272856884d26e0b47b upstream.
10 Commit 0d3e0460f307e84904968aad6cff97bd688583d8
11 "MMC: CSD and CID timeout values" inadvertently broke
12 the timeout for the MMC command SEND_EXT_CSD.
14 This patch puts it back again.
16 Depending on the characteristics of the controller,
17 this bug may prevent the use of MMC cards.
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>
24 drivers/mmc/core/mmc_ops.c | 15 +++++++++------
25 1 file changed, 9 insertions(+), 6 deletions(-)
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,
31 sg_init_one(&sg, data_buf, len);
34 - * The spec states that CSR and CID accesses have a timeout
35 - * of 64 clock cycles.
37 - data.timeout_ns = 0;
38 - data.timeout_clks = 64;
39 + if (opcode == MMC_SEND_CSD || opcode == MMC_SEND_CID) {
41 + * The spec states that CSR and CID accesses have a timeout
42 + * of 64 clock cycles.
44 + data.timeout_ns = 0;
45 + data.timeout_clks = 64;
47 + mmc_set_data_timeout(&data, card);
49 mmc_wait_for_req(host, &mrq);