Module Name:    src
Committed By:   jdolecek
Date:           Tue Nov 27 20:08:05 UTC 2018

Modified Files:
        src/sys/arch/arm/pci: pci_msi_machdep.c
        src/sys/arch/x86/pci: pci_intr_machdep.c

Log Message:
make pci_intr_alloc() try also MSI-X by default (with NULL count);
there are boards/emulators which only have MSI-X and no MSI, and
so far there is no evidence there are devices which support both
and don't work in MSI-X mode

this change is supposed to reduce amount of needed cut&paste code in drivers

discussed briefly with jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/pci/pci_msi_machdep.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/x86/pci/pci_intr_machdep.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/arch/arm/pci/pci_msi_machdep.c
diff -u src/sys/arch/arm/pci/pci_msi_machdep.c:1.3 src/sys/arch/arm/pci/pci_msi_machdep.c:1.4
--- src/sys/arch/arm/pci/pci_msi_machdep.c:1.3	Fri Nov 16 15:06:22 2018
+++ src/sys/arch/arm/pci/pci_msi_machdep.c	Tue Nov 27 20:08:05 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_msi_machdep.c,v 1.3 2018/11/16 15:06:22 jmcneill Exp $ */
+/* $NetBSD: pci_msi_machdep.c,v 1.4 2018/11/27 20:08:05 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.3 2018/11/16 15:06:22 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.4 2018/11/27 20:08:05 jdolecek Exp $");
 
 #include <sys/kernel.h>
 #include <sys/kmem.h>
@@ -188,7 +188,7 @@ pci_intr_alloc(const struct pci_attach_a
 	error = EINVAL;
 	intx_count = 1;
 	msi_count = 1;
-	msix_count = 0;
+	msix_count = 1;
 
 	if (counts != NULL) {
 		switch (max_type) {

Index: src/sys/arch/x86/pci/pci_intr_machdep.c
diff -u src/sys/arch/x86/pci/pci_intr_machdep.c:1.45 src/sys/arch/x86/pci/pci_intr_machdep.c:1.46
--- src/sys/arch/x86/pci/pci_intr_machdep.c:1.45	Sun Sep 23 02:51:06 2018
+++ src/sys/arch/x86/pci/pci_intr_machdep.c	Tue Nov 27 20:08:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_intr_machdep.c,v 1.45 2018/09/23 02:51:06 cherry Exp $	*/
+/*	$NetBSD: pci_intr_machdep.c,v 1.46 2018/11/27 20:08:05 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2009 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.45 2018/09/23 02:51:06 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.46 2018/11/27 20:08:05 jdolecek Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -514,6 +514,7 @@ pci_intr_alloc(const struct pci_attach_a
 
 	intx_count = msi_count = msix_count = 0;
 	if (counts == NULL) { /* simple pattern */
+		msix_count = 1;
 		msi_count = 1;
 		intx_count = 1;
 	} else {

Reply via email to