diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-07-28 13:59:09 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-07-28 13:59:09 +0000 |
commit | 69e8e2a0ec59dd8fdd5d412181125aa611652d02 (patch) | |
tree | 64421bf80028733be79418781d9b149dae538c23 /sys/arch | |
parent | d9ce75352fb48bb12143d4fca35f64ee385c564c (diff) |
Make use of PCI_FLAGS_MSI_ENABLED such that drivers for hardware with broken
MSI support can selectively disable the use of MSI.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/arm64/dev/acpipci.c | 6 | ||||
-rw-r--r-- | sys/arch/arm64/dev/pciecam.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/arch/arm64/dev/acpipci.c b/sys/arch/arm64/dev/acpipci.c index 7ed534c478d..b0877656bb6 100644 --- a/sys/arch/arm64/dev/acpipci.c +++ b/sys/arch/arm64/dev/acpipci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpipci.c,v 1.2 2018/07/10 17:11:42 kettenis Exp $ */ +/* $OpenBSD: acpipci.c,v 1.3 2018/07/28 13:59:08 kettenis Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -200,6 +200,7 @@ acpipci_attach(struct device *parent, struct device *self, void *aux) 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_args *pa, pci_intr_handle_t *ihp) 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); diff --git a/sys/arch/arm64/dev/pciecam.c b/sys/arch/arm64/dev/pciecam.c index 3d68b9d33a6..65eaacfc9ea 100644 --- a/sys/arch/arm64/dev/pciecam.c +++ b/sys/arch/arm64/dev/pciecam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pciecam.c,v 1.3 2018/04/09 18:35:13 kettenis Exp $ */ +/* $OpenBSD: pciecam.c,v 1.4 2018/07/28 13:59:08 kettenis Exp $ */ /* * Copyright (c) 2013,2017 Patrick Wildt <patrick@blueri.se> * @@ -241,6 +241,7 @@ pciecam_attach(struct device *parent, struct device *self, void *aux) 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_args *pa, 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); |