Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic wait for command done status before doing pio tra...



details:   https://anonhg.NetBSD.org/src/rev/0ccee4c70d99
branches:  trunk
changeset: 339774:0ccee4c70d99
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Aug 09 13:01:21 2015 +0000

description:
wait for command done status before doing pio transfer

diffstat:

 sys/dev/ic/dwc_mmc.c |  15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diffs (43 lines):

diff -r 025f0feecf99 -r 0ccee4c70d99 sys/dev/ic/dwc_mmc.c
--- a/sys/dev/ic/dwc_mmc.c      Sun Aug 09 12:17:30 2015 +0000
+++ b/sys/dev/ic/dwc_mmc.c      Sun Aug 09 13:01:21 2015 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
 
        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 @@
        }
 
        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);



Home | Main Index | Thread Index | Old Index