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 a bit more verbose about errors, also pass ...



details:   https://anonhg.NetBSD.org/src/rev/579ef5957279
branches:  trunk
changeset: 802805:579ef5957279
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Thu Oct 02 18:16:13 2014 +0000

description:
Be a bit more verbose about errors, also pass through error code
from lower layer like other drivers.

diffstat:

 sys/dev/sdmmc/ld_sdmmc.c |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (50 lines):

diff -r c9d9819b6c6e -r 579ef5957279 sys/dev/sdmmc/ld_sdmmc.c
--- a/sys/dev/sdmmc/ld_sdmmc.c  Thu Oct 02 18:14:38 2014 +0000
+++ b/sys/dev/sdmmc/ld_sdmmc.c  Thu Oct 02 18:16:13 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ld_sdmmc.c,v 1.12 2013/10/12 16:49:01 christos Exp $   */
+/*     $NetBSD: ld_sdmmc.c,v 1.13 2014/10/02 18:16:13 mlelstv Exp $    */
 
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.12 2013/10/12 16:49:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.13 2014/10/02 18:16:13 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -211,9 +211,10 @@
        /* is everything done in terms of blocks? */
        if (bp->b_rawblkno >= sc->sc_sf->csd.capacity) {
                /* trying to read or write past end of device */
-               DPRINTF(("%s: blkno exceeds capacity 0x%x\n",
-                   device_xname(sc->sc_ld.sc_dv), sc->sc_sf->csd.capacity));
-               bp->b_error = EIO; /* XXX  */
+               aprint_error_dev(sc->sc_ld.sc_dv,
+                   "blkno 0x%" PRIu64 " exceeds capacity %d\n",
+                   bp->b_rawblkno, sc->sc_sf->csd.capacity);
+               bp->b_error = EINVAL;
                bp->b_resid = bp->b_bcount;
                lddone(&sc->sc_ld, bp);
                return;
@@ -229,7 +230,7 @@
        if (error) {
                DPRINTF(("%s: error %d\n", device_xname(sc->sc_ld.sc_dv),
                    error));
-               bp->b_error = EIO;      /* XXXX */
+               bp->b_error = error;
                bp->b_resid = bp->b_bcount;
        } else {
                bp->b_resid = 0;
@@ -257,6 +258,8 @@
        sdmmc_del_task(&task->task);
        splx(s);
 
+       aprint_error_dev(sc->sc_ld.sc_dv, "task timeout");
+
        lddone(&sc->sc_ld, bp);
 }
 



Home | Main Index | Thread Index | Old Index