linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v4.1.10-rt10][PATCH 0/2] PCI: dra7xx/dwc: fix "WARNING: CPU: 1 PID: 82 at kernel/irq/handle.c:150 handle_irq_event_percpu"
@ 2015-11-02 19:30 Grygorii Strashko
  2015-11-02 19:30 ` [v4.1.10-rt10][PATCH 1/2] genirq: introduce new generic_handle_irq_rt_wa() api Grygorii Strashko
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Grygorii Strashko @ 2015-11-02 19:30 UTC (permalink / raw)
  To: bigeasy, Thomas Gleixner, linux-rt-users
  Cc: linux-kernel, Sekhar Nori, Grygorii Strashko

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 series
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().

And generic_handle_irq_rt_wa() is used then to W/A similar issues
in pcie-designware.c and pcie-dra7xx.c.

Grygorii Strashko (2):
  genirq: introduce new generic_handle_irq_rt_wa() api
  PCI: dra7xx: fix "WARNING: CPU: 1 PID: 82 at  kernel/irq/handle.c:150
    handle_irq_event_percpu"

 drivers/pci/host/pci-dra7xx.c      |  3 ++-
 drivers/pci/host/pcie-designware.c |  2 +-
 include/linux/irqdesc.h            |  5 +++++
 kernel/irq/irqdesc.c               | 19 +++++++++++++++++++
 4 files changed, 27 insertions(+), 2 deletions(-)

-- 
2.6.2

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-11-05 16:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-02 19:30 [v4.1.10-rt10][PATCH 0/2] PCI: dra7xx/dwc: fix "WARNING: CPU: 1 PID: 82 at kernel/irq/handle.c:150 handle_irq_event_percpu" Grygorii Strashko
2015-11-02 19:30 ` [v4.1.10-rt10][PATCH 1/2] genirq: introduce new generic_handle_irq_rt_wa() api Grygorii Strashko
2015-11-02 19:38   ` Thomas Gleixner
2015-11-03 19:11     ` Grygorii Strashko
2015-11-03 19:51       ` Thomas Gleixner
2015-11-03 20:18         ` Sebastian Andrzej Siewior
2015-11-05 16:44           ` Grygorii Strashko
2015-11-02 19:30 ` [v4.1.10-rt10] [PATCH 2/2] PCI: dra7xx: fix "WARNING: CPU: 1 PID: 82 at kernel/irq/handle.c:150 handle_irq_event_percpu" Grygorii Strashko
2015-11-03 13:46 ` [v4.1.10-rt10][PATCH 0/2] PCI: dra7xx/dwc: " Sebastian Andrzej Siewior
2015-11-03 19:11   ` Grygorii Strashko
2015-11-03 20:01     ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).