Module Name:    src
Committed By:   riastradh
Date:           Mon May 30 20:28:18 UTC 2022

Modified Files:
        src/sys/dev/pci: virtio_pci.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/pci/virtio_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/virtio_pci.c
diff -u src/sys/dev/pci/virtio_pci.c:1.37 src/sys/dev/pci/virtio_pci.c:1.38
--- src/sys/dev/pci/virtio_pci.c:1.37	Wed Apr 13 22:41:17 2022
+++ src/sys/dev/pci/virtio_pci.c	Mon May 30 20:28:18 2022
@@ -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 @@ virtio_pci_setup_interrupts_09(struct vi
 
 	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 @@ virtio_pci_setup_interrupts_09(struct vi
 
 		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;

Reply via email to