From b82022461caea290c7bce683816b76f5bad5d78d Mon Sep 17 00:00:00 2001 From: gonzo Date: Sun, 6 Nov 2016 18:40:12 +0000 Subject: MFC r306899, r307059, r307151 r306899: Fix release MSI method for ARM GIC r307059: INTRNG - fix MSI/MSIX release path Use isrc in attached MSI data structure instead of using map's isrc directly. map's isrc is set to NULL on IRQ deactivation which happens prior to pci_release_msi so MSI_RELEASE_MSI receives array of NULLs Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D8206 r307151: INTRNG: Propagate IRQ activation error to API consumer Keep resource state consistent with INTRNG state - if intr_activate_irq fails - deactivate resource and propagate error to calling function Reviewed by: mmel --- sys/arm64/arm64/nexus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys/arm64') diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c index 26e1c6c..3e071cb 100644 --- a/sys/arm64/arm64/nexus.c +++ b/sys/arm64/arm64/nexus.c @@ -346,7 +346,11 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid, rman_set_virtual(r, (void *)vaddr); rman_set_bushandle(r, vaddr); } else if (type == SYS_RES_IRQ) { - intr_activate_irq(child, r); + err = intr_activate_irq(child, r); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } } return (0); } -- cgit v1.1