From: kettenis Date: Sun, 10 Oct 2021 16:23:17 +0000 (+0000) Subject: Only check whether we have an MSI interrupt controller when we try to X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f2ee0c128242a14ebbf6adcd7db68a433518b610;p=openbsd 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@ --- 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,