[PATCH 10/10] fix-glamo-mci-no-wait-ack-deselect.patch

Andy Green andy at openmoko.com
Mon Dec 1 02:25:59 CET 2008


Now the card is powered when we send the last command from the stack,
SELECT CARD with arg 0, we learn that the card can't reply when
deselected.  So detect SELECT CARD and arg 0 and don't bother waiting
for an ack that isn't coming.  This chops three seconds off suspend :-)

Signed-off-by: Andy Green <andy at openmoko.com>
---

 drivers/mfd/glamo/glamo-mci.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mfd/glamo/glamo-mci.c
index b867438..238f6b9 100644
--- a/drivers/mfd/glamo/glamo-mci.c
+++ b/drivers/mfd/glamo/glamo-mci.c
@@ -626,6 +626,11 @@ static void glamo_mci_send_request(struct mmc_host *mmc)
 
 	if (glamo_mci_send_command(host, cmd))
 		goto bail;
+
+	/* we are deselecting card?  because it isn't going to ack then... */
+	if ((cmd->opcode == 7) && (cmd->arg == 0))
+		goto done;
+
 	/*
 	 * we must spin until response is ready or timed out
 	 * -- we don't get interrupts unless there is a bulk rx
@@ -641,7 +646,9 @@ static void glamo_mci_send_request(struct mmc_host *mmc)
 
 	if (insanity_timeout < 0) {
 		cmd->error = -ETIMEDOUT;
-		dev_err(&host->pdev->dev, "****** insanity timeout\n");
+		dev_err(&host->pdev->dev, "***** insanity timeout    cmd 0x%x, "
+		 "arg 0x%x data=%p mrq->stop=%p flags 0x%x\n",
+		 cmd->opcode, cmd->arg, cmd->data, cmd->mrq->stop, cmd->flags);
 	}
 
 	if (status & (GLAMO_STAT1_MMC_RTOUT |




More information about the openmoko-kernel mailing list