This diff allows drivers to disable MSI for certain hardware variants
by clearing the flag just like we support on other hardware platforms.
I deliberately didn't include rkpcie(4) in this diff since we don't
have MSI support for the interrupt controller on the RK3399 yet.
ok?
Index: dev/fdt/dwpcie.c
===================================================================
RCS file: /cvs/src/sys/dev/fdt/dwpcie.c,v
retrieving revision 1.6
diff -u -p -r1.6 dwpcie.c
--- dev/fdt/dwpcie.c 1 Jul 2018 18:58:06 -0000 1.6
+++ dev/fdt/dwpcie.c 23 Jul 2018 15:24:16 -0000
@@ -324,6 +324,7 @@ dwpcie_attach(struct device *parent, str
pba.pba_ioex = sc->sc_ioex;
pba.pba_domain = pci_ndomains++;
pba.pba_bus = sc->sc_bus;
+ pba.pba_flags |= PCI_FLAGS_MSI_ENABLED;
config_found(self, &pba, NULL);
}
@@ -534,7 +535,8 @@ dwpcie_intr_map_msi(struct pci_attach_ar
pcitag_t tag = pa->pa_tag;
struct dwpcie_intr_handle *ih;
- if (pci_get_capability(pc, tag, PCI_CAP_MSI, NULL, NULL) == 0)
+ if ((pa->pa_flags & PCI_FLAGS_MSI_ENABLED) == 0 ||
+ pci_get_capability(pc, tag, PCI_CAP_MSI, NULL, NULL) == 0)
return -1;
ih = malloc(sizeof(struct dwpcie_intr_handle), M_DEVBUF, M_WAITOK);
Index: arch/arm64/dev/acpipci.c
===================================================================
RCS file: /cvs/src/sys/arch/arm64/dev/acpipci.c,v
retrieving revision 1.2
diff -u -p -r1.2 acpipci.c
--- arch/arm64/dev/acpipci.c 10 Jul 2018 17:11:42 -0000 1.2
+++ arch/arm64/dev/acpipci.c 23 Jul 2018 15:24:16 -0000
@@ -200,6 +200,7 @@ acpipci_attach(struct device *parent, st
pba.pba_memex = sc->sc_memex;
pba.pba_domain = pci_ndomains++;
pba.pba_bus = sc->sc_bus;
+ pba.pba_flags |= PCI_FLAGS_MSI_ENABLED;
config_found(self, &pba, NULL);
}
@@ -397,7 +398,8 @@ acpipci_intr_map_msi(struct pci_attach_a
pcitag_t tag = pa->pa_tag;
struct acpipci_intr_handle *ih;
- if (pci_get_capability(pc, tag, PCI_CAP_MSI, NULL, NULL) == 0)
+ if ((pa->pa_flags & PCI_FLAGS_MSI_ENABLED) == 0 ||
+ pci_get_capability(pc, tag, PCI_CAP_MSI, NULL, NULL) == 0)
return -1;
ih = malloc(sizeof(struct acpipci_intr_handle), M_DEVBUF, M_WAITOK);
Index: arch/arm64/dev/pciecam.c
===================================================================
RCS file: /cvs/src/sys/arch/arm64/dev/pciecam.c,v
retrieving revision 1.3
diff -u -p -r1.3 pciecam.c
--- arch/arm64/dev/pciecam.c 9 Apr 2018 18:35:13 -0000 1.3
+++ arch/arm64/dev/pciecam.c 23 Jul 2018 15:24:16 -0000
@@ -241,6 +241,7 @@ pciecam_attach(struct device *parent, st
pba.pba_pc = &sc->sc_pc;
pba.pba_domain = pci_ndomains++;
pba.pba_bus = 0;
+ pba.pba_flags |= PCI_FLAGS_MSI_ENABLED;
config_found(self, &pba, NULL);
}
@@ -334,7 +335,8 @@ pciecam_intr_map_msi(struct pci_attach_a
pcitag_t tag = pa->pa_tag;
struct pciecam_intr_handle *ih;
- if (pci_get_capability(pc, tag, PCI_CAP_MSI, NULL, NULL) == 0)
+ if ((pa->pa_flags & PCI_FLAGS_MSI_ENABLED) == 0 ||
+ pci_get_capability(pc, tag, PCI_CAP_MSI, NULL, NULL) == 0)
return 1;
ih = malloc(sizeof(struct pciecam_intr_handle), M_DEVBUF, M_WAITOK);