Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci virtio at pci: Provide attribution in debug mess...



details:   https://anonhg.NetBSD.org/src/rev/68e888d4835d
branches:  trunk
changeset: 366564:68e888d4835d
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon May 30 20:28:18 2022 +0000

description:
virtio at pci: Provide attribution in debug message.

Also make it only happen in the error case so success doesn't clutter
up the console output.

diffstat:

 sys/dev/pci/virtio_pci.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (43 lines):

diff -r c3c10656e489 -r 68e888d4835d sys/dev/pci/virtio_pci.c
--- a/sys/dev/pci/virtio_pci.c  Mon May 30 17:06:34 2022 +0000
+++ b/sys/dev/pci/virtio_pci.c  Mon May 30 20:28:18 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_pci.c,v 1.37 2022/04/13 22:41:17 uwe Exp $ */
+/* $NetBSD: virtio_pci.c,v 1.38 2022/05/30 20:28:18 riastradh Exp $ */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.37 2022/04/13 22:41:17 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.38 2022/05/30 20:28:18 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -880,9 +880,9 @@
 
        bus_space_write_2(psc->sc_iot, psc->sc_ioh, offset, vector);
        ret = bus_space_read_2(psc->sc_iot, psc->sc_ioh, offset);
-       aprint_debug_dev(sc->sc_dev, "expected=%d, actual=%d\n",
-           vector, ret);
        if (ret != vector) {
+               aprint_debug_dev(sc->sc_dev, "%s: expected=%d, actual=%d\n",
+                   __func__, vector, ret);
                VIRTIO_PCI_LOG(sc, reinit,
                    "can't set config msix vector\n");
                return -1;
@@ -900,9 +900,10 @@
 
                bus_space_write_2(psc->sc_iot, psc->sc_ioh, offset, vector);
                ret = bus_space_read_2(psc->sc_iot, psc->sc_ioh, offset);
-               aprint_debug_dev(sc->sc_dev, "expected=%d, actual=%d\n",
-                   vector, ret);
                if (ret != vector) {
+                       aprint_debug_dev(sc->sc_dev, "%s[qid=%d]:"
+                           " expected=%d, actual=%d\n",
+                           __func__, qid, vector, ret);
                        VIRTIO_PCI_LOG(sc, reinit, "can't set queue %d "
                            "msix vector\n", qid);
                        return -1;



Home | Main Index | Thread Index | Old Index