linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] ARM: at91: fix irq_pm_install_action WARNING
@ 2014-12-15 16:15 Boris Brezillon
  2014-12-15 16:15 ` [PATCH 1/5] genirq: Support mixing IRQF_NO_SUSPEND/IRQF_SUSPEND on shared irqs Boris Brezillon
                   ` (5 more replies)
  0 siblings, 6 replies; 23+ messages in thread
From: Boris Brezillon @ 2014-12-15 16:15 UTC (permalink / raw)
  To: linux-arm-kernel

Commit cab303be91dc47942bc25de33dc1140123540800 [1] introduced a WARN_ON
test which triggers a WARNING backtrace on at91 platforms.
While this WARN_ON is absolutely necessary to warn users that they should
not mix request with and without IRQF_NO_SUSPEND flags on shared IRQs,
there is no easy way to solve this issue on at91 platforms.

The main reason is that the init timer is often using a shared irq line
and thus request this irq with IRQF_NO_SUSPEND flag set, while other
peripherals request the same irq line without this flag.

We could deal with that by identifying whether a given peripheral is
connected to the init timer shared irq line and add the IRQF_NO_SUSPEND
in this case, but this implies adding the logic in all peripheral drivers
that could be connected to this shared irq.

This series takes the reverse approach: force IRQ users to specify that
they take care of disabling peripheral interrupts and that IRQ core can
safely leave the handler in a suspended state without having to bother
about spurious interrupts.
This is done by mean of a new IRQF_SUSPEND_NOACTION flag which tells the
core to move the action handler to a suspended list, thus preventing its
execution when we are in suspend mode.
Of course, specifying the IRQF_SUSPEND_NOACTION flag implies taking care
of masking/unmasking the peripheral interrupts in the suspend/resume
implementation.

The WARN_ON is kept, but now it is only triggered when (no_suspend_depth +
suspend_noaction_depth) and nr_actions are unbalanced.

The first patch introduces the IRQF_SUSPEND_NOACTION logic, while other
patches modify existing at91 drivers to specify this flag (and implement
suspend/resume if needed).


Best Regards,

Boris

[1]https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/kernel/irq/pm.c?id=cab303be91dc47942bc25de33dc1140123540800

Boris Brezillon (5):
  genirq: Support mixing IRQF_NO_SUSPEND/IRQF_SUSPEND on shared irqs
  clk: at91: implement suspend/resume for the PMC irqchip
  watchdog: at91sam9: request the irq with IRQF_NO_SUSPEND
  rtc: at91: request IRQs with IRQF_SUSPEND_NOACTION
  tty: serial: atmel: request IRQ with IRQF_SUSPEND_NOACTION

 drivers/clk/at91/pmc.c            | 20 ++++++++++-
 drivers/clk/at91/pmc.h            |  1 +
 drivers/rtc/rtc-at91rm9200.c      |  2 +-
 drivers/rtc/rtc-at91sam9.c        |  3 +-
 drivers/tty/serial/atmel_serial.c |  3 +-
 drivers/watchdog/at91sam9_wdt.c   |  3 +-
 include/linux/interrupt.h         | 11 ++++++
 include/linux/irqdesc.h           |  3 ++
 kernel/irq/pm.c                   | 71 +++++++++++++++++++++++++++++++++++++--
 9 files changed, 109 insertions(+), 8 deletions(-)

-- 
1.9.1

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

end of thread, other threads:[~2015-01-13 17:31 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-15 16:15 [PATCH 0/5] ARM: at91: fix irq_pm_install_action WARNING Boris Brezillon
2014-12-15 16:15 ` [PATCH 1/5] genirq: Support mixing IRQF_NO_SUSPEND/IRQF_SUSPEND on shared irqs Boris Brezillon
2014-12-15 21:45   ` Rafael J. Wysocki
2014-12-15 16:15 ` [PATCH 2/5] clk: at91: implement suspend/resume for the PMC irqchip Boris Brezillon
2014-12-15 16:15 ` [PATCH 3/5] watchdog: at91sam9: request the irq with IRQF_NO_SUSPEND Boris Brezillon
2014-12-15 16:15 ` [PATCH 4/5] rtc: at91: request IRQs with IRQF_SUSPEND_NOACTION Boris Brezillon
2014-12-15 16:15 ` [PATCH 5/5] tty: serial: atmel: request IRQ " Boris Brezillon
2014-12-15 22:20 ` [PATCH 0/5] ARM: at91: fix irq_pm_install_action WARNING Rafael J. Wysocki
2014-12-15 22:48   ` Rafael J. Wysocki
2014-12-16  9:07     ` Boris Brezillon
2014-12-16 10:03       ` Thomas Gleixner
2014-12-16 11:25         ` Boris Brezillon
2014-12-16 12:56           ` Thomas Gleixner
2014-12-16 14:20             ` Boris Brezillon
2014-12-16 14:52               ` Thomas Gleixner
2014-12-16 18:26         ` Boris Brezillon
2014-12-16 20:37           ` Thomas Gleixner
2015-01-08 13:52             ` [RFC PATCH] irqchip: add dumb demultiplexer implementation Boris Brezillon
2015-01-13 10:38               ` Thomas Gleixner
2015-01-13 10:58                 ` Boris Brezillon
2015-01-13 12:41                   ` Thomas Gleixner
2015-01-13 17:00                 ` Boris Brezillon
2015-01-13 17:31                   ` 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).