linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: sh_mmcif: Support MMC_SLEEP_AWAKE command
@ 2012-06-12 20:56 Laurent Pinchart
  2012-06-13  1:12 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Laurent Pinchart @ 2012-06-12 20:56 UTC (permalink / raw)
  To: linux-mmc; +Cc: Guennadi Liakhovetski, Simon Horman, linux-sh

The MMC_SLEEP_AWAKE and SD_IO_SEND_OP_COND commands share the same
opcode. SD_IO_SEND_OP_COND isn't supported by the SH MMCIF, but
MMC_SLEEP_AWAKE is. Discriminate between the two commands using the
command flags, and reject SD_IO_SEND_OP_COND only.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/mmc/host/sh_mmcif.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

Not supporting the MMC_SLEEP_AWAKE command makes system suspend fail if an MMC
or eMMC device supporting sleep/wake is connected. The issue has been first
noticed on the Armadillo 800 EVA board.

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 724b35e..e32da11 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -892,21 +892,15 @@ static void sh_mmcif_request(struct mmc_host *mmc, struct mmc_request *mrq)
 
 	switch (mrq->cmd->opcode) {
 	/* MMCIF does not support SD/SDIO command */
-	case SD_IO_SEND_OP_COND:
+	case MMC_SLEEP_AWAKE: /* = SD_IO_SEND_OP_COND (5) */
+	case MMC_SEND_EXT_CSD: /* = SD_SEND_IF_COND (8) */
+		if ((mrq->cmd->flags & MMC_CMD_MASK) != MMC_CMD_BCR)
+			break;
 	case MMC_APP_CMD:
 		host->state = STATE_IDLE;
 		mrq->cmd->error = -ETIMEDOUT;
 		mmc_request_done(mmc, mrq);
 		return;
-	case MMC_SEND_EXT_CSD: /* = SD_SEND_IF_COND (8) */
-		if (!mrq->data) {
-			/* send_if_cond cmd (not support) */
-			host->state = STATE_IDLE;
-			mrq->cmd->error = -ETIMEDOUT;
-			mmc_request_done(mmc, mrq);
-			return;
-		}
-		break;
 	default:
 		break;
 	}
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-06-20 13:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-12 20:56 [PATCH] mmc: sh_mmcif: Support MMC_SLEEP_AWAKE command Laurent Pinchart
2012-06-13  1:12 ` Simon Horman
2012-06-13  7:39   ` Laurent Pinchart
2012-06-20  6:42     ` Simon Horman
2012-06-20 10:51       ` Laurent Pinchart
2012-06-13 13:27 ` Guennadi Liakhovetski
2012-06-20  6:21   ` Chris Ball
2012-06-20 11:54 ` Ulf Hansson
2012-06-20 13:06   ` Laurent Pinchart

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).