mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lecopzer Chen <lecopzer.chen@mediatek.com>
To: <linux-kernel@vger.kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>,
	Lecopzer Chen <lecopzer.chen@mediatek.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Julien Thierry <julien.thierry@arm.com>,
	YJ Chiang <yj.chiang@mediatek.com>
Subject: [PATCH] genirq: Remove warning on preemptible in prepare_percpu_nmi()
Date: Thu, 20 Jun 2019 17:12:33 +0800	[thread overview]
Message-ID: <20190620091233.22731-1-lecopzer.chen@mediatek.com> (raw)

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 <lecopzer.chen@mediatek.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Julien Thierry <julien.thierry@arm.com>
Cc: YJ Chiang <yj.chiang@mediatek.com>
Cc: Lecopzer Chen <lecopzer.chen@mediatek.com>
---
 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


             reply	other threads:[~2019-06-20  9:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20  9:12 Lecopzer Chen [this message]
2019-06-20  9:40 ` Marc Zyngier
2019-06-20  9:44 ` Julien Thierry
2019-06-20 10:50 ` Lecopzer Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190620091233.22731-1-lecopzer.chen@mediatek.com \
    --to=lecopzer.chen@mediatek.com \
    --cc=julien.thierry@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=yj.chiang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®