From patchwork Thu Jun 20 09:12:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lecopzer Chen X-Patchwork-Id: 11006211 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4D52414BB for ; Thu, 20 Jun 2019 09:13:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B191285EE for ; Thu, 20 Jun 2019 09:13:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EBDA2860A; Thu, 20 Jun 2019 09:13:50 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 E65C4285EE for ; Thu, 20 Jun 2019 09:13:48 +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: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 1hdt8a-0007Lg-2G; Thu, 20 Jun 2019 09:13:44 +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 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 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)