Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jan 2009 17:50:53 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r187691 - head/sys/powerpc/powerpc
Message-ID:  <200901251750.n0PHorku023771@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Sun Jan 25 17:50:53 2009
New Revision: 187691
URL: http://svn.freebsd.org/changeset/base/187691

Log:
  Fix a race condition where interrupts set up after boot could be enabled in
  the PIC before the interrupt handler was set. If the interrupt triggered in
  that window, then the interrupt vector would be disabled.
  
  Reported by:	Marco Trillo

Modified:
  head/sys/powerpc/powerpc/intr_machdep.c

Modified: head/sys/powerpc/powerpc/intr_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/intr_machdep.c	Sun Jan 25 16:59:29 2009	(r187690)
+++ head/sys/powerpc/powerpc/intr_machdep.c	Sun Jan 25 17:50:53 2009	(r187691)
@@ -243,7 +243,7 @@ powerpc_setup_intr(const char *name, u_i
     driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep)
 {
 	struct powerpc_intr *i;
-	int error;
+	int error, enable = 0;
 
 	i = intr_lookup(irq);
 	if (i == NULL)
@@ -258,13 +258,16 @@ powerpc_setup_intr(const char *name, u_i
 
 		i->cntp = &intrcnt[i->vector];
 
-		if (!cold)
-			PIC_ENABLE(pic, i->irq, i->vector);
+		enable = 1;
 	}
 
 	error = intr_event_add_handler(i->event, name, filter, handler, arg,
 	    intr_priority(flags), flags, cookiep);
 	intrcnt_setname(i->event->ie_fullname, i->vector);
+
+	if (!cold && enable)
+		PIC_ENABLE(pic, i->irq, i->vector);
+
 	return (error);
 }
 



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