Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Oct 2016 17:10:59 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r307151 - in head/sys: arm/arm arm64/arm64 mips/mips
Message-ID:  <201610121710.u9CHAx9c087600@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610121710.u9CHAx9c087600>