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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to