linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: linuxppc-dev@lists.ozlabs.org, Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH 07/10] powerpc: add NMI IPI infrastructure
Date: Sat, 4 Feb 2017 12:49:59 +1000	[thread overview]
Message-ID: <20170204124959.76d786f2@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <20170203214524.3ad3729a@roar.ozlabs.ibm.com>

On Fri, 3 Feb 2017 21:45:24 +1000
Nicholas Piggin <npiggin@gmail.com> wrote:

> On Tue, 20 Dec 2016 04:30:08 +1000
> Nicholas Piggin <npiggin@gmail.com> wrote:
> 
> > +static void do_smp_send_nmi_ipi(int cpu)
> > +{
> > +	if (cpu >= 0) {
> > +		do_message_pass(cpu, PPC_MSG_NMI_IPI);
> > +	} else {
> > +		unsigned int c;
> > +
> > +		for_each_online_cpu(c) {
> > +			if (c == raw_smp_processor_id())
> > +				continue;
> > +			do_message_pass(cpu, PPC_MSG_NMI_IPI);  
> 
> Okay this has a bug in the fallback path. Needs the following
> incremental patch. sysrq+x works okay with this (tested in mambo),
> and also recovers with "x" okay.

Also requires removal of get_online_cpus/put_online_cpus.

---
 arch/powerpc/kernel/smp.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 81256522985d..e1a429251a7d 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -448,8 +448,6 @@ static int smp_send_nmi_ipi(int cpu, void (*fn)(struct pt_regs *), u64 delay_us)
 	if (unlikely(!smp_ops))
 		return 0;
 
-	get_online_cpus();
-
 	/* Take the nmi_ipi_busy count/lock with interrupts hard disabled */
 	nmi_ipi_lock_start(&flags);
 	while (nmi_ipi_busy_count) {
@@ -491,8 +489,6 @@ static int smp_send_nmi_ipi(int cpu, void (*fn)(struct pt_regs *), u64 delay_us)
 	nmi_ipi_busy_count--;
 	nmi_ipi_unlock_end(&flags);
 
-	put_online_cpus();
-
 	return ret;
 }
 #endif /* CONFIG_NMI_IPI */
-- 
2.11.0

  reply	other threads:[~2017-02-04  2:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19 18:30 [PATCH 00/10] Improving debugging with NMIs Nicholas Piggin
2016-12-19 18:30 ` [PATCH 01/10] powerpc/64s: add exception macro that does not enable RI Nicholas Piggin
2017-05-01  2:58   ` [01/10] " Michael Ellerman
2016-12-19 18:30 ` [PATCH 02/10] powerpc/64s: exception macro for stack frame and initial register save Nicholas Piggin
2016-12-19 18:30 ` [PATCH 03/10] powerpc/64s: fix system reset vs general interrupt reentrancy Nicholas Piggin
2016-12-19 18:30 ` [PATCH 04/10] powerpc/64s: disallow system reset vs system reset reentrancy Nicholas Piggin
2016-12-19 18:30 ` [PATCH 05/10] powerpc/64s: dedicated system reset interrupt stack Nicholas Piggin
2016-12-19 18:30 ` [PATCH 06/10] powerpc: nmi_enter for system reset Nicholas Piggin
2017-02-07  4:06   ` Michael Ellerman
2016-12-19 18:30 ` [PATCH 07/10] powerpc: add NMI IPI infrastructure Nicholas Piggin
2017-02-03 11:45   ` Nicholas Piggin
2017-02-04  2:49     ` Nicholas Piggin [this message]
2016-12-19 18:30 ` [PATCH 08/10] powerpc: add struct smp_ops_t.cause_nmi_ipi operation Nicholas Piggin
2016-12-19 18:30 ` [PATCH 09/10] powerpc/pseries: implement NMI IPI with H_SIGNAL_SYS_RESET Nicholas Piggin
2016-12-19 18:30 ` [PATCH 10/10] powerpc: xmon wait for secondaries before sending IPI Nicholas Piggin

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=20170204124959.76d786f2@roar.ozlabs.ibm.com \
    --to=npiggin@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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).