From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E745C43613 for ; Thu, 20 Jun 2019 09:13:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 24E7D208CB for ; Thu, 20 Jun 2019 09:13:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="N+HneWEl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24E7D208CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=k3kHTUlUsxwknqmNCMou6PFbRpW2ORGOw7GQr7AyQGU=; b=N+HneWElNa06ZE rz4QqEga+bK6TJbvNvuLE+6+1O6c5BBliL/8nUvcF/m2hCUZRlXZUnXGT0zueXkNwuKFWDBT/WSA9 gKm6HhHVLzupoD0a9pyc/6+BTzQxG6N09DaKEhpDol/BaVEEfg+5QzL0tOw8Xq9sRwKQE0KyJewsC mV/10k4k6Wa2o30JgXeYmQRMXT99A+FQMHSWNBTDN28LViVBzVFIXXezg4GUynkhYLUli5az9WzX4 D9HLQDd6UFDyfY4CbcpLTR1XwXRtpgttUuxBpD9Sz2FJzoY0LMSQcHAcKJyidAZckhPUOXdDfE/gI +zzB6NAv1M8N5tivroLw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdt8Z-0007Lg-FO; Thu, 20 Jun 2019 09:13:43 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdt8X-0007LD-2M for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2019 09:13:42 +0000 X-UUID: 1b4a654402d640cf818d05742b596e2a-20190620 X-UUID: 1b4a654402d640cf818d05742b596e2a-20190620 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 614963788; Thu, 20 Jun 2019 01:12:54 -0800 Received: from mtkmbs05n1.mediatek.inc (172.21.101.15) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 20 Jun 2019 02:12:52 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 20 Jun 2019 17:12:50 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 20 Jun 2019 17:12:51 +0800 From: Lecopzer Chen To: Subject: [PATCH] genirq: Remove warning on preemptible in prepare_percpu_nmi() Date: Thu, 20 Jun 2019 17:12:33 +0800 Message-ID: <20190620091233.22731-1-lecopzer.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190620_021341_122880_AD59C6CE X-CRM114-Status: UNSURE ( 9.84 ) X-CRM114-Notice: Please train this message. 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: Lecopzer Chen , Julien Thierry , Peter Zijlstra , YJ Chiang , Marc Zyngier , Thomas Gleixner , Ingo Molnar , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org prepare_percpu_nmi() acquires lock first by irq_get_desc_lock(), no matter whether preempt enabled or not, acquiring lock forces preempt off. This simplifies the usage of prepare_percpu_nmi() and we don't need to acquire extra lock or explicitly call preempt_[disable,enable](). Signed-off-by: Lecopzer Chen Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Marc Zyngier Cc: Julien Thierry Cc: YJ Chiang Cc: Lecopzer Chen --- kernel/irq/manage.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 78f3ddeb7fe4..aa03640cd7fb 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -2509,9 +2509,6 @@ int request_percpu_nmi(unsigned int irq, irq_handler_t handler, * This call prepares an interrupt line to deliver NMI on the current CPU, * before that interrupt line gets enabled with enable_percpu_nmi(). * - * As a CPU local operation, this should be called from non-preemptible - * context. - * * If the interrupt line cannot be used to deliver NMIs, function * will fail returning a negative value. */ @@ -2521,8 +2518,6 @@ int prepare_percpu_nmi(unsigned int irq) struct irq_desc *desc; int ret = 0; - WARN_ON(preemptible()); - desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_PERCPU); if (!desc) @@ -2554,17 +2549,12 @@ int prepare_percpu_nmi(unsigned int irq) * This call undoes the setup done by prepare_percpu_nmi(). * * IRQ line should not be enabled for the current CPU. - * - * As a CPU local operation, this should be called from non-preemptible - * context. */ void teardown_percpu_nmi(unsigned int irq) { unsigned long flags; struct irq_desc *desc; - WARN_ON(preemptible()); - desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_PERCPU); if (!desc) -- 2.18.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16495C43613 for ; Thu, 20 Jun 2019 09:13:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E7FA62084B for ; Thu, 20 Jun 2019 09:13:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726168AbfFTJNJ (ORCPT ); Thu, 20 Jun 2019 05:13:09 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:32273 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725889AbfFTJNJ (ORCPT ); Thu, 20 Jun 2019 05:13:09 -0400 X-UUID: f04cb5f347ec4fff93e6234c72477d7a-20190620 X-UUID: f04cb5f347ec4fff93e6234c72477d7a-20190620 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1172524557; Thu, 20 Jun 2019 17:12:52 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 20 Jun 2019 17:12:50 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 20 Jun 2019 17:12:51 +0800 From: Lecopzer Chen To: CC: , Lecopzer Chen , Thomas Gleixner , Peter Zijlstra , Ingo Molnar , Marc Zyngier , Julien Thierry , YJ Chiang Subject: [PATCH] genirq: Remove warning on preemptible in prepare_percpu_nmi() Date: Thu, 20 Jun 2019 17:12:33 +0800 Message-ID: <20190620091233.22731-1-lecopzer.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org prepare_percpu_nmi() acquires lock first by irq_get_desc_lock(), no matter whether preempt enabled or not, acquiring lock forces preempt off. This simplifies the usage of prepare_percpu_nmi() and we don't need to acquire extra lock or explicitly call preempt_[disable,enable](). Signed-off-by: Lecopzer Chen Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Marc Zyngier Cc: Julien Thierry Cc: YJ Chiang Cc: Lecopzer Chen --- kernel/irq/manage.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 78f3ddeb7fe4..aa03640cd7fb 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -2509,9 +2509,6 @@ int request_percpu_nmi(unsigned int irq, irq_handler_t handler, * This call prepares an interrupt line to deliver NMI on the current CPU, * before that interrupt line gets enabled with enable_percpu_nmi(). * - * As a CPU local operation, this should be called from non-preemptible - * context. - * * If the interrupt line cannot be used to deliver NMIs, function * will fail returning a negative value. */ @@ -2521,8 +2518,6 @@ int prepare_percpu_nmi(unsigned int irq) struct irq_desc *desc; int ret = 0; - WARN_ON(preemptible()); - desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_PERCPU); if (!desc) @@ -2554,17 +2549,12 @@ int prepare_percpu_nmi(unsigned int irq) * This call undoes the setup done by prepare_percpu_nmi(). * * IRQ line should not be enabled for the current CPU. - * - * As a CPU local operation, this should be called from non-preemptible - * context. */ void teardown_percpu_nmi(unsigned int irq) { unsigned long flags; struct irq_desc *desc; - WARN_ON(preemptible()); - desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_PERCPU); if (!desc) -- 2.18.0