From patchwork Sat Feb 4 02:49:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 723990 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vFdY13gSjz9s7P for ; Sat, 4 Feb 2017 13:51:33 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FxchxEO1"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vFdY11Ck6zDqD7 for ; Sat, 4 Feb 2017 13:51:33 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FxchxEO1"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vFdWZ04jYzDqCL for ; Sat, 4 Feb 2017 13:50:18 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FxchxEO1"; dkim-atps=neutral Received: by mail-pg0-x243.google.com with SMTP id 75so3448859pgf.3 for ; Fri, 03 Feb 2017 18:50:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:organization :mime-version:content-transfer-encoding; bh=0QSBzbQ6eY2RJpPckznKmwdJRz1Cv7n1LIJBtnbgMyI=; b=FxchxEO1gs89kr8Xr7oWFVxrwQw3LygDuu2gvf3TwrGslLM+0Nblj/t8TnRT8Sk5c7 2oBC2SqdIG6tfE/Q/kQCp1CqHN0d/e5RUee6KYlzIjO1wzaAlRIOkGyfhIbHwunTk3iN s7XI3RnlbE1pRailavIAS+bIp41U2gz1rawugvqEWLLfGTDVhPbpqdyWkcwSIWk6nHo5 2WcH7otn4TfkzSdIOQhSKX3OGMH8zOMR0Ln6C1bspd1uZt0UU0ui6soNFsbLQfWUjqF3 Z5w7orjIgK9dE4I/14Zcv2yydf/js2e624iK22c2yRBMxwX2p/okRSKh2hWFD0LUZQbO RkDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=0QSBzbQ6eY2RJpPckznKmwdJRz1Cv7n1LIJBtnbgMyI=; b=t9t+fWFgtLQW4Hnh0sL6PAecgfJjZFqulYdC4rvw1xb7m7bUtLkI0/KYzbPFOQT2YV eZIqR+1pAmHqjsPWhcV+3LKzoNltF1wk4KLkSHJKJ4BXJX/yFQhk8klMKwD4umPnsiT0 0Mf8qaB1n5QYbq8JcxxJgoX9bCYYlIJIfAUOvQW+XdG0ET38PnKXVXfPBZdyIpAnd7vH 0Y/upSNtJc2MB13M5wnuI1XJMlWCeNH8KzpmIW3Bbyg5IeZgVVoQ5tSDU3nakiztzFwO //NIDcVNFmBLzEJxnjxURYalVtJNInVc3nmQF/Nx8q7+0ZzUNwolPc52Md3stGJIkORx 0ZnQ== X-Gm-Message-State: AIkVDXIMSHbpOXj07ISL84QGM5jLfTZM1ARahgfe0/sWPAWe++haOE/F0mahcRxCFKVvFA== X-Received: by 10.99.107.130 with SMTP id g124mr294313pgc.108.1486176615648; Fri, 03 Feb 2017 18:50:15 -0800 (PST) Received: from roar.ozlabs.ibm.com ([203.220.153.130]) by smtp.gmail.com with ESMTPSA id j78sm70237240pfk.39.2017.02.03.18.50.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2017 18:50:14 -0800 (PST) Date: Sat, 4 Feb 2017 12:49:59 +1000 From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org, Michael Ellerman Subject: Re: [PATCH 07/10] powerpc: add NMI IPI infrastructure Message-ID: <20170204124959.76d786f2@roar.ozlabs.ibm.com> In-Reply-To: <20170203214524.3ad3729a@roar.ozlabs.ibm.com> References: <20161219183011.28310-1-npiggin@gmail.com> <20161219183011.28310-8-npiggin@gmail.com> <20170203214524.3ad3729a@roar.ozlabs.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, 3 Feb 2017 21:45:24 +1000 Nicholas Piggin wrote: > On Tue, 20 Dec 2016 04:30:08 +1000 > Nicholas Piggin 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 */