diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2021-10-10 16:23:18 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2021-10-10 16:23:18 +0000 |
commit | b338f56ff31d3f66877a619bf7a74ecd97470adf (patch) | |
tree | 43cd6f5009812f0b678209a425663cf32c612514 | |
parent | f7948f85defce0b8ea5cf7ac0145268fde4add92 (diff) |
Only check whether we have an MSI interrupt controller when we try to
establish an MSI or MSI-X interrupt. Fixes establishing legacy INTx
interrupts on machines without a (usable) MSI interrupt controller.
ok patrick@
-rw-r--r-- | sys/arch/arm64/dev/acpipci.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/arch/arm64/dev/acpipci.c b/sys/arch/arm64/dev/acpipci.c index b7248cbed15..72162fafa11 100644 --- a/sys/arch/arm64/dev/acpipci.c +++ b/sys/arch/arm64/dev/acpipci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpipci.c,v 1.30 2021/06/25 17:41:22 patrick Exp $ */ +/* $OpenBSD: acpipci.c,v 1.31 2021/10/10 16:23:17 kettenis Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -531,24 +531,24 @@ acpipci_intr_establish(void *v, pci_intr_handle_t ih, int level, struct cpu_info *ci, int (*func)(void *), void *arg, char *name) { struct acpipci_softc *sc = v; - struct interrupt_controller *ic; struct acpipci_intr_handle *aih; - bus_dma_segment_t seg; void *cookie; - extern LIST_HEAD(, interrupt_controller) interrupt_controllers; - LIST_FOREACH(ic, &interrupt_controllers, ic_list) { - if (ic->ic_establish_msi) - break; - } - if (ic == NULL) - return NULL; - KASSERT(ih.ih_type != PCI_NONE); if (ih.ih_type != PCI_INTX) { + struct interrupt_controller *ic; + bus_dma_segment_t seg; uint64_t addr, data; + extern LIST_HEAD(, interrupt_controller) interrupt_controllers; + LIST_FOREACH(ic, &interrupt_controllers, ic_list) { + if (ic->ic_establish_msi) + break; + } + if (ic == NULL) + return NULL; + /* Map Requester ID through IORT to get sideband data. */ data = acpipci_iort_map_msi(ih.ih_pc, ih.ih_tag); cookie = ic->ic_establish_msi(ic->ic_cookie, &addr, |