Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Dec 2008 01:31:07 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185661 - head/sys/dev/sdhci
Message-ID:  <200812060131.mB61V7xX078929@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Dec  6 01:31:07 2008
New Revision: 185661
URL: http://svn.freebsd.org/changeset/base/185661

Log:
  Forget current bus power settings on full reset. Chip must be reconfigured.
  
  Do not issue command if there is no card, clock or power.
  Controller will not detect command timeout without clock active.

Modified:
  head/sys/dev/sdhci/sdhci.c

Modified: head/sys/dev/sdhci/sdhci.c
==============================================================================
--- head/sys/dev/sdhci/sdhci.c	Sat Dec  6 01:11:45 2008	(r185660)
+++ head/sys/dev/sdhci/sdhci.c	Sat Dec  6 01:31:07 2008	(r185661)
@@ -301,8 +301,10 @@ sdhci_reset(struct sdhci_slot *slot, uin
 
 	WR1(slot, SDHCI_SOFTWARE_RESET, mask);
 
-	if (mask & SDHCI_RESET_ALL)
+	if (mask & SDHCI_RESET_ALL) {
 		slot->clock = 0;
+		slot->power = 0;
+	}
 
 	/* Wait max 100 ms */
 	timeout = 100;
@@ -904,8 +906,11 @@ sdhci_start_command(struct sdhci_slot *s
 
 	/* Read controller present state. */
 	state = RD4(slot, SDHCI_PRESENT_STATE);
-	/* Do not issue command if there is no card. */
-	if ((state & SDHCI_CARD_PRESENT) == 0) {
+	/* Do not issue command if there is no card, clock or power.
+	 * Controller will not detect timeout without clock active. */
+	if ((state & SDHCI_CARD_PRESENT) == 0 ||
+	    slot->power == 0 ||
+	    slot->clock == 0) {
 		cmd->error = MMC_ERR_FAILED;
 		slot->req = NULL;
 		slot->curcmd = NULL;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812060131.mB61V7xX078929>