Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ata more detailed debug info; also sync DEBUG_* valu...



details:   https://anonhg.NetBSD.org/src/rev/f02f73b85d64
branches:  trunk
changeset: 827197:f02f73b85d64
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Thu Oct 19 20:45:07 2017 +0000

description:
more detailed debug info; also sync DEBUG_* values in wd.c with ata.c

diffstat:

 sys/dev/ata/ata.c      |  12 ++++++------
 sys/dev/ata/ata_subr.c |  16 ++++++++++++----
 sys/dev/ata/wd.c       |  19 ++++++++++++-------
 3 files changed, 30 insertions(+), 17 deletions(-)

diffs (145 lines):

diff -r 0006f67793bd -r f02f73b85d64 sys/dev/ata/ata.c
--- a/sys/dev/ata/ata.c Thu Oct 19 20:27:12 2017 +0000
+++ b/sys/dev/ata/ata.c Thu Oct 19 20:45:07 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ata.c,v 1.138 2017/10/18 08:38:35 jdolecek Exp $       */
+/*     $NetBSD: ata.c,v 1.139 2017/10/19 20:45:07 jdolecek Exp $       */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.138 2017/10/18 08:38:35 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.139 2017/10/19 20:45:07 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -1132,15 +1132,15 @@
 again:
        KASSERT(chq->queue_active <= chq->queue_openings);
        if (chq->queue_active == chq->queue_openings) {
-               ATADEBUG_PRINT(("%s: channel completely busy\n", __func__),
-                   DEBUG_XFERS);
+               ATADEBUG_PRINT(("%s(chp=%p): channel %d completely busy\n",
+                   __func__, chp, chp->ch_channel), DEBUG_XFERS);
                goto out;
        }
 
        /* is there a xfer ? */
        if ((xfer = TAILQ_FIRST(&chp->ch_queue->queue_xfer)) == NULL) {
-               ATADEBUG_PRINT(("%s: queue_xfer is empty\n", __func__),
-                   DEBUG_XFERS);
+               ATADEBUG_PRINT(("%s(chp=%p): channel %d queue_xfer is empty\n",
+                   __func__, chp, chp->ch_channel), DEBUG_XFERS);
                goto out;
        }
 
diff -r 0006f67793bd -r f02f73b85d64 sys/dev/ata/ata_subr.c
--- a/sys/dev/ata/ata_subr.c    Thu Oct 19 20:27:12 2017 +0000
+++ b/sys/dev/ata/ata_subr.c    Thu Oct 19 20:45:07 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ata_subr.c,v 1.2 2017/10/17 18:52:50 jdolecek Exp $    */
+/*     $NetBSD: ata_subr.c,v 1.3 2017/10/19 20:45:07 jdolecek Exp $    */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata_subr.c,v 1.2 2017/10/17 18:52:50 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_subr.c,v 1.3 2017/10/19 20:45:07 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -248,8 +248,9 @@
        uint32_t avail, slot, mask;
        int error;
 
-       ATADEBUG_PRINT(("%s: channel %d flags %x openings %d\n",
-           __func__, chp->ch_channel, flags, openings),
+       ATADEBUG_PRINT(("%s: channel %d fl 0x%x op %d qavail 0x%x qact %d",
+           __func__, chp->ch_channel, flags, openings,
+           chq->queue_xfers_avail, chq->queue_active),
            DEBUG_XFERS);
 
        ata_channel_lock(chp);
@@ -307,6 +308,8 @@
 
 out:
        ata_channel_unlock(chp);
+
+       ATADEBUG_PRINT((" xfer %p\n", xfer), DEBUG_XFERS);
        return xfer;
 }
 
@@ -352,6 +355,11 @@
        }
 
        ata_channel_unlock(chp);
+
+       ATADEBUG_PRINT(("%s: channel %d xfer %p qavail 0x%x qact %d\n",
+           __func__, chp->ch_channel, xfer, chq->queue_xfers_avail,
+           chq->queue_active),
+           DEBUG_XFERS);
 }
 
 /*
diff -r 0006f67793bd -r f02f73b85d64 sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c  Thu Oct 19 20:27:12 2017 +0000
+++ b/sys/dev/ata/wd.c  Thu Oct 19 20:45:07 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wd.c,v 1.432 2017/10/14 13:20:32 jdolecek Exp $ */
+/*     $NetBSD: wd.c,v 1.433 2017/10/19 20:45:07 jdolecek Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.432 2017/10/14 13:20:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.433 2017/10/19 20:45:07 jdolecek Exp $");
 
 #include "opt_ata.h"
 #include "opt_wd.h"
@@ -102,11 +102,10 @@
 
 #define        WDLABELDEV(dev) (MAKEWDDEV(major(dev), WDUNIT(dev), RAW_PART))
 
-#define DEBUG_INTR   0x01
-#define DEBUG_XFERS  0x02
-#define DEBUG_STATUS 0x04
 #define DEBUG_FUNCS  0x08
 #define DEBUG_PROBE  0x10
+#define DEBUG_DETACH 0x20
+#define        DEBUG_XFERS  0x40
 #ifdef ATADEBUG
 int wdcdebug_wd_mask = 0x0;
 #define ATADEBUG_PRINT(args, level) \
@@ -659,15 +658,21 @@
         * once flush is pending, it will get handled as soon as xfer
         * is available.
         */
-       if (ISSET(wd->sc_flags, WDF_FLUSH_PEND))
+       if (ISSET(wd->sc_flags, WDF_FLUSH_PEND)) {
+               ATADEBUG_PRINT(("wdstart %s flush pend\n",
+                   device_xname(wd->sc_dev)), DEBUG_XFERS);
                goto out;
+       }
 
        while (bufq_peek(wd->sc_q) != NULL) {
                /* First try to get xfer. Limit to drive openings iff NCQ. */
                xfer = ata_get_xfer_ext(wd->drvp->chnl_softc, 0,
                    WD_USE_NCQ(wd) ? WD_MAX_OPENINGS(wd) : 0);
-               if (xfer == NULL)
+               if (xfer == NULL) {
+                       ATADEBUG_PRINT(("wdstart %s no xfer\n",
+                           device_xname(wd->sc_dev)), DEBUG_XFERS);
                        break;
+               }
 
                /* There is got to be a buf for us */
                bp = bufq_get(wd->sc_q);



Home | Main Index | Thread Index | Old Index