Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sdmmc Be less noisy for some commands.



details:   https://anonhg.NetBSD.org/src/rev/0702e0628ab5
branches:  trunk
changeset: 847802:0702e0628ab5
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Jan 04 22:28:26 2020 +0000

description:
Be less noisy for some commands.

diffstat:

 sys/dev/sdmmc/sdmmc_io.c  |  22 ++++++++++++----------
 sys/dev/sdmmc/sdmmc_mem.c |   6 +++---
 2 files changed, 15 insertions(+), 13 deletions(-)

diffs (124 lines):

diff -r ad32180f87fd -r 0702e0628ab5 sys/dev/sdmmc/sdmmc_io.c
--- a/sys/dev/sdmmc/sdmmc_io.c  Sat Jan 04 22:22:34 2020 +0000
+++ b/sys/dev/sdmmc/sdmmc_io.c  Sat Jan 04 22:28:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdmmc_io.c,v 1.18 2019/10/28 06:20:01 mlelstv Exp $    */
+/*     $NetBSD: sdmmc_io.c,v 1.19 2020/01/04 22:28:26 mlelstv Exp $    */
 /*     $OpenBSD: sdmmc_io.c,v 1.10 2007/09/17 01:33:33 krw Exp $       */
 
 /*
@@ -20,7 +20,7 @@
 /* Routines for SD I/O cards. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdmmc_io.c,v 1.18 2019/10/28 06:20:01 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc_io.c,v 1.19 2020/01/04 22:28:26 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -52,7 +52,7 @@
 };
 
 static int     sdmmc_io_rw_direct(struct sdmmc_softc *,
-                   struct sdmmc_function *, int, u_char *, int);
+                   struct sdmmc_function *, int, u_char *, int, bool);
 static int     sdmmc_io_rw_extended(struct sdmmc_softc *,
                    struct sdmmc_function *, int, u_char *, int, int);
 #if 0
@@ -341,7 +341,7 @@
 
 static int
 sdmmc_io_rw_direct(struct sdmmc_softc *sc, struct sdmmc_function *sf,
-    int reg, u_char *datap, int arg)
+    int reg, u_char *datap, int arg, bool toutok)
 {
        struct sdmmc_command cmd;
        int error;
@@ -364,12 +364,14 @@
        cmd.c_opcode = SD_IO_RW_DIRECT;
        cmd.c_arg = arg;
        cmd.c_flags = SCF_CMD_AC | SCF_RSP_R5;
+       if (toutok)
+               cmd.c_flags |= SCF_TOUT_OK;
 
        error = sdmmc_mmc_command(sc, &cmd);
        if (error == 0)
                *datap = SD_R5_DATA(cmd.c_resp);
 
-       if (error) {
+       if (error && error != ETIMEDOUT) {
                device_printf(sc->sc_dev,
                    "direct I/O error %d, r=%d p=%p %s\n",
                    error, reg, datap,
@@ -439,7 +441,7 @@
        /* Don't lock */
 
        (void)sdmmc_io_rw_direct(sf->sc, sf, reg, (u_char *)&data,
-           SD_ARG_CMD52_READ);
+           SD_ARG_CMD52_READ, false);
        return data;
 }
 
@@ -450,7 +452,7 @@
        /* Don't lock */
 
        (void)sdmmc_io_rw_direct(sf->sc, sf, reg, (u_char *)&data,
-           SD_ARG_CMD52_WRITE);
+           SD_ARG_CMD52_WRITE, false);
 }
 
 uint16_t
@@ -622,7 +624,7 @@
        /* Don't lock */
 
        return sdmmc_io_rw_direct(sc, sf, reg, datap,
-           SD_ARG_CMD52_WRITE|SD_ARG_CMD52_EXCHANGE);
+           SD_ARG_CMD52_WRITE|SD_ARG_CMD52_EXCHANGE, false);
 }
 #endif
 
@@ -635,7 +637,7 @@
        u_char data = CCCR_CTL_AS(sf->number);
 
        return sdmmc_io_rw_direct(sf->sc, NULL, SD_IO_CCCR_CTL, &data,
-           SD_ARG_CMD52_WRITE);
+           SD_ARG_CMD52_WRITE, true);
 }
 
 /*
@@ -647,7 +649,7 @@
        u_char data = CCCR_CTL_RES;
 
        if (sdmmc_io_rw_direct(sc, NULL, SD_IO_CCCR_CTL, &data,
-           SD_ARG_CMD52_WRITE) == 0)
+           SD_ARG_CMD52_WRITE, true) == 0)
                sdmmc_pause(100000, NULL); /* XXX SDMMC_LOCK */
 }
 
diff -r ad32180f87fd -r 0702e0628ab5 sys/dev/sdmmc/sdmmc_mem.c
--- a/sys/dev/sdmmc/sdmmc_mem.c Sat Jan 04 22:22:34 2020 +0000
+++ b/sys/dev/sdmmc/sdmmc_mem.c Sat Jan 04 22:28:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdmmc_mem.c,v 1.70 2019/10/28 06:31:39 mlelstv Exp $   */
+/*     $NetBSD: sdmmc_mem.c,v 1.71 2020/01/04 22:28:26 mlelstv 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.70 2019/10/28 06:31:39 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.71 2020/01/04 22:28:26 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -676,7 +676,7 @@
 
        memset(&cmd, 0, sizeof(cmd));
        cmd.c_arg = ocr;
-       cmd.c_flags = SCF_CMD_BCR | SCF_RSP_R7 | SCF_RSP_SPI_R7;
+       cmd.c_flags = SCF_CMD_BCR | SCF_RSP_R7 | SCF_RSP_SPI_R7 | SCF_TOUT_OK;
        cmd.c_opcode = SD_SEND_IF_COND;
 
        error = sdmmc_mmc_command(sc, &cmd);



Home | Main Index | Thread Index | Old Index