Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1260906

Re: [v4.1.10-rt10][PATCH 1/2] genirq: introduce new generic_handle_irq_rt_wa() api

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [v4.1.10-rt10][PATCH 1/2] genirq: introduce new generic_handle_irq_rt_wa() api
Date Mon, 02 Nov 2015 20:40:01 +0100
Message-ID <qqt7r-R4-5@gated-at.bofh.it> (permalink)
References <qqt7r-R4-7@gated-at.bofh.it> <qqt7r-R4-9@gated-at.bofh.it>
X-Original-To Grygorii Strashko <grygorii.strashko@ti.com>
User-Agent Alpine 2.11 (DEB 23 2013-08-11)
MIME-Version 1.0
Content-Type TEXT/PLAIN; charset=US-ASCII
X-Linutronix-Spam-Score -1.0
X-Linutronix-Spam-Level -
X-Linutronix-Spam-Status No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 43
Organization linux.* mail to news gateway
X-Original-Cc bigeasy@linutronix.de, linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, Sekhar Nori <nsekhar@ti.com>
X-Original-Date Mon, 2 Nov 2015 20:38:20 +0100 (CET)
X-Original-Message-ID <alpine.DEB.2.11.1511022036500.4032@nanos>
X-Original-References <1446492626-24396-1-git-send-email-grygorii.strashko@ti.com> <1446492626-24396-2-git-send-email-grygorii.strashko@ti.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1260906

Show key headers only | View raw


On Mon, 2 Nov 2015, Grygorii Strashko wrote:
> Now in kernel below code pattern is used by many drivers:
> static irqreturn_t driver_xx_hw_irq_handler(int irq, void *arg)
> {
> 	<read IRQ status register>
>   	<perform HW specific operations>
> 
> 	for (<each set bit in IRQ status register>) {
> 		<get Linux IRQ number>
> 		generic_handle_irq(<Linux IRQ number>);
> 		|- handle_simple_irq()
> 		|-or- handle_level_irq()
> 		|-or- handle_edge_irq()
> 		   |-handle_irq_event()
> 		     |-handle_irq_event_percpu()
> ===
> "WARNING: CPU: 1 PID: 82 at kernel/irq/handle.c:150 handle_irq_event_percpu+0x14c/0x174()
>  irq 460 handler irq_default_primary_handler+0x0/0x14 enabled interrupts"
> ===
> 	}
> }
> 
> On -RT above code will generate warnings, because driver_xx_hw_irq_handler()
> will be forced threaded (by default) and, as result, generic_handle_irq()
> will be called with IRQs enabled. To W/A this issue generic_handle_irq() can
> be surrounded by raw_spin_lock_irqsave/irqrestore(wa_lock).
> 
> Instead of spreading this W/A directly in many drivers this patch
> introduces -RT specific version of generic_handle_irq() API -
> generic_handle_irq_rt_wa(). This new generic_handle_irq_rt_wa() just calls
> generic_handle_irq() surrounded by raw_spin_lock_irqsave/irqrestore().
> If -RT is disabled It will fallback to generic_handle_irq().

Why aren't you simply marking these demultiplex handlers with IRQ_NO_THREAD?

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [v4.1.10-rt10][PATCH 1/2] genirq: introduce new generic_handle_irq_rt_wa()  api Thomas Gleixner <tglx@linutronix.de> - 2015-11-02 20:40 +0100
  Re: [v4.1.10-rt10][PATCH 1/2] genirq: introduce new  generic_handle_irq_rt_wa() api Grygorii Strashko <grygorii.strashko@ti.com> - 2015-11-03 20:20 +0100
    Re: [v4.1.10-rt10][PATCH 1/2] genirq: introduce new generic_handle_irq_rt_wa()  api Thomas Gleixner <tglx@linutronix.de> - 2015-11-03 21:00 +0100
      Re: [v4.1.10-rt10][PATCH 1/2] genirq: introduce new  generic_handle_irq_rt_wa() api Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2015-11-03 21:20 +0100
        Re: [v4.1.10-rt10][PATCH 1/2] genirq: introduce new  generic_handle_irq_rt_wa() api Grygorii Strashko <grygorii.strashko@ti.com> - 2015-11-05 17:50 +0100

csiph-web