[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1418660152-17185-1-git-send-email-boris.brezillon@free-electrons.com>
Date: Mon, 15 Dec 2014 17:15:47 +0100
From: Boris Brezillon <boris.brezillon@...e-electrons.com>
To: Thomas Gleixner <tglx@...utronix.de>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.cz>, linux-serial@...r.kernel.org,
Alessandro Zummo <a.zummo@...ertech.it>,
rtc-linux@...glegroups.com, Mike Turquette <mturquette@...aro.org>,
Nicolas Ferre <nicolas.ferre@...el.com>,
Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
Andrew Victor <linux@...im.org.za>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Boris Brezillon <boris.brezillon@...e-electrons.com>
Subject: [PATCH 0/5] ARM: at91: fix irq_pm_install_action WARNING
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists