linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: akpm@osdl.org
Cc: paulus@samba.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ppc64: Fix rtas_set_indicator(9005)
Date: Tue, 11 Jan 2005 01:43:39 +1100	[thread overview]
Message-ID: <20050110144339.GW14239@krispykreme.ozlabs.ibm.com> (raw)
In-Reply-To: <20050110143536.GV14239@krispykreme.ozlabs.ibm.com>


It turns out we were passing in the wrong thing to the
rtas_set_indicator call. Luckily we got away with it because it looks
like firmware does not check arguments and just inserts or removes the
current cpu from the global server group.

Fix it.

Anton

Signed-off-by: Anton Blanchard <anton@samba.org>

diff -puN arch/ppc64/kernel/pSeries_smp.c~fix_gqirm_set_indicator arch/ppc64/kernel/pSeries_smp.c
--- foobar2/arch/ppc64/kernel/pSeries_smp.c~fix_gqirm_set_indicator	2005-01-11 00:03:35.491865383 +1100
+++ foobar2-anton/arch/ppc64/kernel/pSeries_smp.c	2005-01-11 00:03:35.521863094 +1100
@@ -265,7 +265,8 @@ static void __devinit smp_xics_setup_cpu
 	 * necessary from a secondary thread as the OF start-cpu interface
 	 * performs this function for us on primary threads.
 	 */
-	rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, default_distrib_server, 1);
+	rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
+		(1UL << interrupt_server_size) - 1 - default_distrib_server, 1);
 #endif
 }
 
diff -puN arch/ppc64/kernel/xics.c~fix_gqirm_set_indicator arch/ppc64/kernel/xics.c
--- foobar2/arch/ppc64/kernel/xics.c~fix_gqirm_set_indicator	2005-01-11 00:03:35.496865001 +1100
+++ foobar2-anton/arch/ppc64/kernel/xics.c	2005-01-11 00:03:35.524862865 +1100
@@ -91,6 +91,7 @@ static int xics_irq_8259_cascade_real = 
 static unsigned int default_server = 0xFF;
 /* also referenced in smp.c... */
 unsigned int default_distrib_server = 0;
+unsigned int interrupt_server_size = 8;
 
 /*
  * XICS only has a single IPI, so encode the messages per CPU
@@ -511,6 +512,10 @@ nextnode:
 				default_server = ireg[0];
 				default_distrib_server = ireg[i-1]; /* take last element */
 			}
+			ireg = (uint *)get_property(np,
+					"ibm,interrupt-server#-size", NULL);
+			if (ireg)
+				interrupt_server_size = *ireg;
 			break;
 		}
 	}
@@ -650,9 +655,9 @@ void xics_migrate_irqs_away(void)
 	ops->cppr_info(cpu, 0);
 	iosync();
 
-	/* Refuse any new interrupts... */
+	/* remove ourselves from the global interrupt queue */
 	status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,
-				    hard_smp_processor_id(), 0);
+		(1UL << interrupt_server_size) - 1 - default_distrib_server, 0);
 	WARN_ON(status != 0);
 
 	/* Allow IPIs again... */
diff -puN include/asm-ppc64/xics.h~fix_gqirm_set_indicator include/asm-ppc64/xics.h
--- foobar2/include/asm-ppc64/xics.h~fix_gqirm_set_indicator	2005-01-11 00:03:35.502864543 +1100
+++ foobar2-anton/include/asm-ppc64/xics.h	2005-01-11 00:03:35.525862789 +1100
@@ -31,5 +31,6 @@ struct xics_ipi_struct {
 extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
 
 extern unsigned int default_distrib_server;
+extern unsigned int interrupt_server_size;
 
 #endif /* _PPC64_KERNEL_XICS_H */
_

  reply	other threads:[~2005-01-10 14:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-10 13:38 [PATCH] ppc64: PCI cleanup Anton Blanchard
2005-01-10 13:41 ` [PATCH] ppc64: Remove flush_instruction_cache Anton Blanchard
2005-01-10 14:35   ` [PATCH] ppc64: interrupt code cleanup Anton Blanchard
2005-01-10 14:43     ` Anton Blanchard [this message]
2005-01-10 15:19       ` [PATCH] ppc64: Make NUMA code handle unexpected layouts Anton Blanchard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050110144339.GW14239@krispykreme.ozlabs.ibm.com \
    --to=anton@samba.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).