From patchwork Wed Jan 17 12:04:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Thierry X-Patchwork-Id: 10169215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D6BA1601D3 for ; Wed, 17 Jan 2018 12:05:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2F3E28571 for ; Wed, 17 Jan 2018 12:05:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6DD028587; Wed, 17 Jan 2018 12:05:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3FE9428571 for ; Wed, 17 Jan 2018 12:05:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=vshVTK9GJ5HqRiTkmOfz7VyZYV3WYiAdLjNIkQDKNOY=; b=kvt91lnQbs0DW6nYIpdT6uDgFu 8uUH9TevsPZ49iYomedZ0m1oagABhkA4GV6xkX0IdiZNRROgnlje34BC94/A2Qs5DPA6J69BFSl4n 4wOonfY2kvVDz3R18c4R/vOTWWm47hKL8fRNYVK9FwqBUjH/WcaxLmKkO+nHMrrM/zdlfuHN0+PX4 STfghtIm6Wys2nLk5KQMzgywpWhHTWJXNnu79fbsI1Xv7m2EE+6RFnKa+0yGLJH6Rzak8dovsUX4t SQLPolyEBNxCvigfb8HAuk5M48m3eC/sCmJVq5b/KCB2jx/rcAarC9Yshw8DT9lS8y+YXyjaao7BY UtWDuzkA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ebmT7-0006uh-7Z; Wed, 17 Jan 2018 12:05:25 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ebmSl-0005RE-8z for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2018 12:05:09 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D000C1610; Wed, 17 Jan 2018 04:04:58 -0800 (PST) Received: from e112298-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 337073F53D; Wed, 17 Jan 2018 04:04:57 -0800 (PST) From: Julien Thierry To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/3] arm64: perf: Set PMU interrupt as NMI Date: Wed, 17 Jan 2018 12:04:45 +0000 Message-Id: <1516190685-20048-4-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516190685-20048-1-git-send-email-julien.thierry@arm.com> References: <1516190685-20048-1-git-send-email-julien.thierry@arm.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, daniel.thompson@linaro.org, Julien Thierry , marc.zyngier@arm.com, will.deacon@arm.com, acme@kernel.org, peterz@infradead.org, mingo@redhat.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If pseudo-NMIs are supported by the kernel, treat PMU interrupt as such. Signed-off-by: Julien Thierry Cc: Will Deacon Cc: Mark Rutland --- drivers/perf/arm_pmu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index 40ad36f..c18d425 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -545,6 +545,7 @@ void armpmu_free_irq(struct arm_pmu *armpmu, int cpu) return; } + irq_set_irqchip_state(irq, IRQCHIP_STATE_NMI, false); free_irq(irq, per_cpu_ptr(&hw_events->percpu_pmu, cpu)); } @@ -597,6 +598,7 @@ int armpmu_request_irq(struct arm_pmu *armpmu, int cpu) IRQF_NO_THREAD; } + irq_set_irqchip_state(irq, IRQCHIP_STATE_NMI, true); err = request_irq(irq, handler, irq_flags, "arm-pmu", per_cpu_ptr(&hw_events->percpu_pmu, cpu)); } @@ -609,6 +611,7 @@ int armpmu_request_irq(struct arm_pmu *armpmu, int cpu) err_out: pr_err("unable to request IRQ%d for ARM PMU counters\n", irq); + irq_set_irqchip_state(irq, IRQCHIP_STATE_NMI, false); return err; } @@ -650,6 +653,7 @@ static int arm_perf_starting_cpu(unsigned int cpu, struct hlist_node *node) irq = armpmu_get_cpu_irq(pmu, cpu); if (irq) { if (irq_is_percpu_devid(irq)) { + irq_set_irqchip_state(irq, IRQCHIP_STATE_NMI, true); enable_percpu_irq(irq, IRQ_TYPE_NONE); return 0; } @@ -667,8 +671,10 @@ static int arm_perf_teardown_cpu(unsigned int cpu, struct hlist_node *node) return 0; irq = armpmu_get_cpu_irq(pmu, cpu); - if (irq && irq_is_percpu_devid(irq)) + if (irq && irq_is_percpu_devid(irq)) { disable_percpu_irq(irq); + irq_set_irqchip_state(irq, IRQCHIP_STATE_NMI, false); + } return 0; }