Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 May 2011 14:03:05 +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: r221738 - head/sys/powerpc/powerpc
Message-ID:  <201105101403.p4AE35b4047116@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Tue May 10 14:03:05 2011
New Revision: 221738
URL: http://svn.freebsd.org/changeset/base/221738

Log:
  Only try to set up IPIs at boot on systems that actually have more than one
  CPU. This fixes a panic observed on Heathrow-based systems without
  SMP-capable PICs when the kernel had both options SMP and INVARIANTS.
  
  MFC after:	5 days

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

Modified: head/sys/powerpc/powerpc/intr_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/intr_machdep.c	Tue May 10 13:59:33 2011	(r221737)
+++ head/sys/powerpc/powerpc/intr_machdep.c	Tue May 10 14:03:05 2011	(r221738)
@@ -397,18 +397,22 @@ powerpc_enable_intr(void)
 
 #ifdef SMP
 	/* Install an IPI handler. */
-	for (n = 0; n < npics; n++) {
-		if (piclist[n].dev != root_pic)
-			continue;
-
-		KASSERT(piclist[n].ipis != 0, ("%s", __func__));
-		error = powerpc_setup_intr("IPI",
-		    MAP_IRQ(piclist[n].node, piclist[n].irqs),
-		    powerpc_ipi_handler, NULL, NULL,
-		    INTR_TYPE_MISC | INTR_EXCL, &ipi_cookie);
-		if (error) {
-			printf("unable to setup IPI handler\n");
-			return (error);
+	if (mp_ncpus > 1) {
+		for (n = 0; n < npics; n++) {
+			if (piclist[n].dev != root_pic)
+				continue;
+
+			KASSERT(piclist[n].ipis != 0,
+			    ("%s: SMP root PIC does not supply any IPIs",
+			    __func__));
+			error = powerpc_setup_intr("IPI",
+			    MAP_IRQ(piclist[n].node, piclist[n].irqs),
+			    powerpc_ipi_handler, NULL, NULL,
+			    INTR_TYPE_MISC | INTR_EXCL, &ipi_cookie);
+			if (error) {
+				printf("unable to setup IPI handler\n");
+				return (error);
+			}
 		}
 	}
 #endif



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