svn commit: r307151 - in head/sys: arm/arm arm64/arm64 mips/mips
Oleksandr Tymoshenko
gonzo at FreeBSD.org
Wed Oct 12 17:11:01 UTC 2016
Author: gonzo
Date: Wed Oct 12 17:10:59 2016
New Revision: 307151
URL: https://svnweb.freebsd.org/changeset/base/307151
Log:
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
Modified:
head/sys/arm/arm/nexus.c
head/sys/arm64/arm64/nexus.c
head/sys/mips/mips/nexus.c
Modified: head/sys/arm/arm/nexus.c
==============================================================================
--- head/sys/arm/arm/nexus.c Wed Oct 12 15:49:20 2016 (r307150)
+++ head/sys/arm/arm/nexus.c Wed Oct 12 17:10:59 2016 (r307151)
@@ -383,7 +383,11 @@ nexus_activate_resource(device_t bus, de
return (0);
} else if (type == SYS_RES_IRQ) {
#ifdef INTRNG
- intr_activate_irq(child, r);
+ err = intr_activate_irq(child, r);
+ if (err != 0) {
+ rman_deactivate_resource(r);
+ return (err);
+ }
#endif
}
return (0);
Modified: head/sys/arm64/arm64/nexus.c
==============================================================================
--- head/sys/arm64/arm64/nexus.c Wed Oct 12 15:49:20 2016 (r307150)
+++ head/sys/arm64/arm64/nexus.c Wed Oct 12 17:10:59 2016 (r307151)
@@ -347,7 +347,11 @@ nexus_activate_resource(device_t bus, de
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);
}
Modified: head/sys/mips/mips/nexus.c
==============================================================================
--- head/sys/mips/mips/nexus.c Wed Oct 12 15:49:20 2016 (r307150)
+++ head/sys/mips/mips/nexus.c Wed Oct 12 17:10:59 2016 (r307151)
@@ -433,7 +433,11 @@ nexus_activate_resource(device_t bus, de
} else if (type == SYS_RES_IRQ) {
#ifdef INTRNG
#ifdef FDT
- intr_activate_irq(child, r);
+ err = intr_activate_irq(child, r);
+ if (err != 0) {
+ rman_deactivate_resource(r);
+ return (err);
+ }
#else
/*
* INTRNG without FDT needs to have the interrupt properly
More information about the svn-src-all
mailing list