From patchwork Thu Sep 24 04:42:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuichi Ito X-Patchwork-Id: 11796097 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A9E3092C for ; Thu, 24 Sep 2020 04:45:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 74EDE235F7 for ; Thu, 24 Sep 2020 04:45:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="R7GXKTeG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74EDE235F7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fujitsu.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EezmVhUpDuAzQDQkC3v3Fcvnre/RFGuDS8spWpAZ2iU=; b=R7GXKTeG58yleo+yqHjXtbhjZ nxhF4s+ZJ7BDgv5Qm0vkgFJtZJqMrDCfWvOjwMsgY87uaGseYjkS1c1uuXfkXHL5QZxlPTuOsRtsK VmaTN2Sr16tNuI2wIn+tlywuhrYj1ilUth60G9jI02abkSCE+ujJzPtudUI3GB9y2XM5HuIIstBG6 OI2bejEMNF75g0YcPVIAfAQsNkaYecpsCVXxhlUnhW2uZgDQHQrNuz1WHtMvvgszJ0V/K6miNk2CX /WDKfCpDZeRTheEDMVzWcfkIg2Qh9zujRN56+OKkmtpyHtKzFyiqVzSrM+5Phe3rKmx+6PkXr5CEk fpNj7qg+g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLJ6u-0001dL-7F; Thu, 24 Sep 2020 04:44:00 +0000 Received: from mgwym03.jp.fujitsu.com ([211.128.242.42]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLJ6m-0001aQ-TG for linux-arm-kernel@lists.infradead.org; Thu, 24 Sep 2020 04:43:53 +0000 Received: from yt-mxoi1.gw.nic.fujitsu.com (unknown [192.168.229.67]) by mgwym03.jp.fujitsu.com with smtp id 2792_5ff7_ce30488a_8c12_4b64_a8f1_da032634e244; Thu, 24 Sep 2020 13:43:44 +0900 Received: from pumpkin.openstacklocal (pumpkin.fct.css.fujitsu.com [10.130.70.189]) by yt-mxoi1.gw.nic.fujitsu.com (Postfix) with ESMTP id E8FFCAC0111 for ; Thu, 24 Sep 2020 13:43:43 +0900 (JST) Received: by pumpkin.openstacklocal (Postfix, from userid 1016) id 5C1B31C014; Thu, 24 Sep 2020 13:42:45 +0900 (JST) From: Yuichi Ito To: maz@kernel.org, sumit.garg@linaro.org, tglx@linutronix.de, jason@lakedaemon.net, catalin.marinas@arm.com, will@kernel.org Subject: [PATCH 1/2] irqchip/gic-v3: Enable support for SGIs to act as NMIs Date: Thu, 24 Sep 2020 13:42:35 +0900 Message-Id: <20200924044236.1245808-2-ito-yuichi@fujitsu.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200924044236.1245808-1-ito-yuichi@fujitsu.com> References: <20200924044236.1245808-1-ito-yuichi@fujitsu.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200924_004353_277156_58DD0220 X-CRM114-Status: GOOD ( 11.99 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [211.128.242.42 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Sumit Garg Add support to handle SGIs as regular NMIs. As SGIs or IPIs defaults to a special flow handler: handle_percpu_devid_fasteoi_ipi(), so skip NMI handler update in case of SGIs. Also, enable NMI support prior to gic_smp_init() as allocation of SGIs as IRQs/NMIs happen as part of this routine. Signed-off-by: Sumit Garg --- drivers/irqchip/irq-gic-v3.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 262bc7377abd..2eda18d1df59 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -477,6 +477,11 @@ static int gic_irq_nmi_setup(struct irq_data *d) if (WARN_ON(gic_irq(d) >= 8192)) return -EINVAL; + if (get_intid_range(d) == SGI_RANGE) { + gic_irq_set_prio(d, GICD_INT_NMI_PRI); + return 0; + } + /* desc lock should already be held */ if (gic_irq_in_rdist(d)) { u32 idx = gic_get_ppi_index(d); @@ -514,6 +519,11 @@ static void gic_irq_nmi_teardown(struct irq_data *d) if (WARN_ON(gic_irq(d) >= 8192)) return; + if (get_intid_range(d) == SGI_RANGE) { + gic_irq_set_prio(d, GICD_INT_DEF_PRI); + return; + } + /* desc lock should already be held */ if (gic_irq_in_rdist(d)) { u32 idx = gic_get_ppi_index(d); @@ -1708,6 +1718,7 @@ static int __init gic_init_bases(void __iomem *dist_base, gic_dist_init(); gic_cpu_init(); + gic_enable_nmi_support(); gic_smp_init(); gic_cpu_pm_init(); @@ -1719,8 +1730,6 @@ static int __init gic_init_bases(void __iomem *dist_base, gicv2m_init(handle, gic_data.domain); } - gic_enable_nmi_support(); - return 0; out_free: