LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Philip Langdale <philipl@overt.org>
To: linux-kernel@vger.kernel.org, Pierre Ossman <drzeus-list@drzeus.cx>
Cc: Alex Dubov <oakad@yahoo.com>, Pavel Pisa <ppisa@pikron.com>
Subject: [PATCH 2.6.19] mmc: Fix handling of response types in imxmmc and tifm drivers
Date: Thu, 04 Jan 2007 07:04:47 -0800	[thread overview]
Message-ID: <459D178F.8000607@overt.org> (raw)

This change depends on my SDHC patch and fixes a bug that was revealed during the
development of that patch. The R6 response type should be identical to R1 (and R7)
but was incorrectly defined differently. Fixing the R6 definition breaks assumptions
in these two drivers that response type flags are unique. Pierre and Alex both
believe that treating R6 and R7 as R1 will be sufficient. ie: The controllers do
not care about the differences between them. Due to lack of hardware, I have done
no testing.

Signed-off-by: Philip Langdale <philipl@overt.org>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: Pavel Pisa <ppisa@pikron.com>
---
 drivers/mmc/imxmmc.c    |    3 ---
 drivers/mmc/omap.c      |    2 +-
 drivers/mmc/pxamci.c    |    2 +-
 drivers/mmc/tifm_sd.c   |    3 ---
 include/linux/mmc/mmc.h |    2 +-
 5 files changed, 3 insertions(+), 9 deletions(-)

diff -ur linux-2.6.19-sdhc/drivers/mmc/imxmmc.c linux-2.6.19-rspfix/drivers/mmc/imxmmc.c
--- linux-2.6.19-sdhc/drivers/mmc/imxmmc.c	2007-01-04 06:52:12.000000000 -0800
+++ linux-2.6.19-rspfix/drivers/mmc/imxmmc.c	2007-01-04 06:53:16.000000000 -0800
@@ -351,9 +351,6 @@
 	case MMC_RSP_R3: /* short */
 		cmdat |= CMD_DAT_CONT_RESPONSE_FORMAT_R3;
 		break;
-	case MMC_RSP_R6: /* short CRC */
-		cmdat |= CMD_DAT_CONT_RESPONSE_FORMAT_R6;
-		break;
 	default:
 		break;
 	}
diff -ur linux-2.6.19-sdhc/drivers/mmc/omap.c linux-2.6.19-rspfix/drivers/mmc/omap.c
--- linux-2.6.19-sdhc/drivers/mmc/omap.c	2007-01-04 06:52:12.000000000 -0800
+++ linux-2.6.19-rspfix/drivers/mmc/omap.c	2007-01-04 05:46:24.000000000 -0800
@@ -206,7 +206,7 @@
 	/* Our hardware needs to know exact type */
 	switch (RSP_TYPE(mmc_resp_type(cmd))) {
 	case RSP_TYPE(MMC_RSP_R1):
-		/* resp 1, resp 1b */
+		/* resp 1, 1b, 6, 7 */
 		resptype = 1;
 		break;
 	case RSP_TYPE(MMC_RSP_R2):
diff -ur linux-2.6.19-sdhc/drivers/mmc/pxamci.c linux-2.6.19-rspfix/drivers/mmc/pxamci.c
--- linux-2.6.19-sdhc/drivers/mmc/pxamci.c	2007-01-04 06:52:12.000000000 -0800
+++ linux-2.6.19-rspfix/drivers/mmc/pxamci.c	2007-01-04 05:46:36.000000000 -0800
@@ -171,7 +171,7 @@

 #define RSP_TYPE(x)	((x) & ~(MMC_RSP_BUSY|MMC_RSP_OPCODE))
 	switch (RSP_TYPE(mmc_resp_type(cmd))) {
-	case RSP_TYPE(MMC_RSP_R1): /* r1, r1b, r6 */
+	case RSP_TYPE(MMC_RSP_R1): /* r1, r1b, r6, r7 */
 		cmdat |= CMDAT_RESP_SHORT;
 		break;
 	case RSP_TYPE(MMC_RSP_R3):
diff -ur linux-2.6.19-sdhc/drivers/mmc/tifm_sd.c linux-2.6.19-rspfix/drivers/mmc/tifm_sd.c
--- linux-2.6.19-sdhc/drivers/mmc/tifm_sd.c	2007-01-04 06:52:12.000000000 -0800
+++ linux-2.6.19-rspfix/drivers/mmc/tifm_sd.c	2007-01-04 06:53:38.000000000 -0800
@@ -173,9 +173,6 @@
 	case MMC_RSP_R3:
 		rc |= TIFM_MMCSD_RSP_R3;
 		break;
-	case MMC_RSP_R6:
-		rc |= TIFM_MMCSD_RSP_R6;
-		break;
 	default:
 		BUG();
 	}
diff -ur linux-2.6.19-sdhc/include/linux/mmc/mmc.h linux-2.6.19-rspfix/include/linux/mmc/mmc.h
--- linux-2.6.19-sdhc/include/linux/mmc/mmc.h	2007-01-04 06:51:09.000000000 -0800
+++ linux-2.6.19-rspfix/include/linux/mmc/mmc.h	2007-01-04 05:41:49.000000000 -0800
@@ -42,7 +42,7 @@
 #define MMC_RSP_R1B	(MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY)
 #define MMC_RSP_R2	(MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC)
 #define MMC_RSP_R3	(MMC_RSP_PRESENT)
-#define MMC_RSP_R6	(MMC_RSP_PRESENT|MMC_RSP_CRC)
+#define MMC_RSP_R6	(MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
 #define MMC_RSP_R7	(MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)

 #define mmc_resp_type(cmd)	((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE))

             reply	other threads:[~2007-01-04 15:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-04 15:04 Philip Langdale [this message]
2007-01-07 17:34 ` Pavel Pisa
2007-01-10 19:02   ` Pierre Ossman
2007-01-19  1:50     ` mmc: correct semantics of the mmc_host_remove Alex Dubov
2007-01-19  8:47       ` Pierre Ossman
2007-01-20  3:46         ` Alex Dubov
2007-01-20 10:21           ` Pierre Ossman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=459D178F.8000607@overt.org \
    --to=philipl@overt.org \
    --cc=drzeus-list@drzeus.cx \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oakad@yahoo.com \
    --cc=ppisa@pikron.com \
    --subject='Re: [PATCH 2.6.19] mmc: Fix handling of response types in imxmmc and tifm drivers' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).