Module Name:    src
Committed By:   tsutsui
Date:           Sun Mar 13 09:12:16 UTC 2016

Modified Files:
        src/sys/dev/sdmmc: sdmmc_mem.c

Log Message:
Call the second sdmmc_mem_send_if_cond() only where it's necessary.

This makes SMC_CAPS_SPI_MODE devices (currently evbsh3 only) work again.
"Maybe ok" from nonaka@.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/sdmmc/sdmmc_mem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sdmmc/sdmmc_mem.c
diff -u src/sys/dev/sdmmc/sdmmc_mem.c:1.50 src/sys/dev/sdmmc/sdmmc_mem.c:1.51
--- src/sys/dev/sdmmc/sdmmc_mem.c:1.50	Tue Dec 22 09:56:06 2015
+++ src/sys/dev/sdmmc/sdmmc_mem.c	Sun Mar 13 09:12:16 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdmmc_mem.c,v 1.50 2015/12/22 09:56:06 mlelstv Exp $	*/
+/*	$NetBSD: sdmmc_mem.c,v 1.51 2016/03/13 09:12:16 tsutsui Exp $	*/
 /*	$OpenBSD: sdmmc_mem.c,v 1.10 2009/01/09 10:55:22 jsg Exp $	*/
 
 /*
@@ -45,7 +45,7 @@
 /* Routines for SD/MMC memory cards. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.50 2015/12/22 09:56:06 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.51 2016/03/13 09:12:16 tsutsui Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -198,15 +198,14 @@ mmc_mode:
 		goto out;
 	}
 
-	/* Tell the card(s) to enter the idle state (again). */
-	sdmmc_go_idle_state(sc);
-
 	DPRINTF(("%s: host_ocr 0x%08x\n", SDMMCDEVNAME(sc), host_ocr));
 	DPRINTF(("%s: card_ocr 0x%08x\n", SDMMCDEVNAME(sc), card_ocr));
 
 	host_ocr &= card_ocr; /* only allow the common voltages */
 	if (!ISSET(sc->sc_caps, SMC_CAPS_SPI_MODE)) {
 		if (ISSET(sc->sc_flags, SMF_SD_MODE)) {
+			/* Tell the card(s) to enter the idle state (again). */
+			sdmmc_go_idle_state(sc);
 			/* Check SD Ver.2 */
 			error = sdmmc_mem_send_if_cond(sc, 0x1aa, &card_ocr);
 			if (error == 0 && card_ocr == 0x1aa)

Reply via email to