Module Name:    src
Committed By:   jmcneill
Date:           Sun Aug  9 13:01:21 UTC 2015

Modified Files:
        src/sys/dev/ic: dwc_mmc.c

Log Message:
wait for command done status before doing pio transfer


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/dwc_mmc.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/ic/dwc_mmc.c
diff -u src/sys/dev/ic/dwc_mmc.c:1.6 src/sys/dev/ic/dwc_mmc.c:1.7
--- src/sys/dev/ic/dwc_mmc.c:1.6	Thu Jan 22 17:06:15 2015
+++ src/sys/dev/ic/dwc_mmc.c	Sun Aug  9 13:01:21 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_mmc.c,v 1.6 2015/01/22 17:06:15 jmcneill Exp $ */
+/* $NetBSD: dwc_mmc.c,v 1.7 2015/08/09 13:01:21 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill <[email protected]>
@@ -29,7 +29,7 @@
 #include "opt_dwc_mmc.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.6 2015/01/22 17:06:15 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.7 2015/08/09 13:01:21 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -482,12 +482,6 @@ dwc_mmc_exec_command(sdmmc_chipset_handl
 
 	cmd->c_resid = cmd->c_datalen;
 	MMC_WRITE(sc, DWC_MMC_CMD_REG, cmdval | cmd->c_opcode);
-	if (cmd->c_datalen > 0) {
-		cmd->c_error = dwc_mmc_pio_transfer(sc, cmd);
-		if (cmd->c_error) {
-			goto done;
-		}
-	}
 
 	cmd->c_error = dwc_mmc_wait_rint(sc,
 	    DWC_MMC_INT_ERROR|DWC_MMC_INT_CD, hz * 10);
@@ -506,6 +500,11 @@ dwc_mmc_exec_command(sdmmc_chipset_handl
 	}
 
 	if (cmd->c_datalen > 0) {
+		cmd->c_error = dwc_mmc_pio_transfer(sc, cmd);
+		if (cmd->c_error) {
+			goto done;
+		}
+
 		cmd->c_error = dwc_mmc_wait_rint(sc,
 		    DWC_MMC_INT_ERROR|DWC_MMC_INT_ACD|DWC_MMC_INT_DTO,
 		    hz * 10);

Reply via email to