public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/4] mfd: arizona: Disable IRQs during driver remove
@ 2016-11-22 16:10 Charles Keepax
  2016-11-22 16:10 ` [PATCH v2 2/4] mfd: arizona: Use arizona_map_irq instead of hard coding it Charles Keepax
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Charles Keepax @ 2016-11-22 16:10 UTC (permalink / raw)
  To: lee.jones; +Cc: linux-kernel, patches

As DCVDD will often be supplied by a child node of the MFD, we
can't call mfd_remove_devices as the first step in arizona_dev_exit
as might be expected (tidy up the children before we tidy up the
MFD). We need to disable and put the DCVDD regulator before we call
mfd_remove_devices, to prevent PM runtime from turning this back on we
also need to disable the PM runtime before we do this. Finally we can
not clean up the IRQs until all the MFD children have been removed, as
they may have registered IRQs themselves.

This creates a window of time where the interrupts are enabled but
the PM runtime, on which the IRQ handler depends, is not available,
any interrupts in this window will go unhandled and fill the log with
failed to resume device messages. To avoid this we simply disable the
main IRQ at the start of arizona_dev_exit, we don't need to actually
handle any IRQs in this window as we are removing the driver.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---

Changes since v1:
 - Just a rebase

Thanks,
Charles

 drivers/mfd/arizona-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 41767f7..b6d4bc6 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -1553,6 +1553,7 @@ EXPORT_SYMBOL_GPL(arizona_dev_init);
 
 int arizona_dev_exit(struct arizona *arizona)
 {
+	disable_irq(arizona->irq);
 	pm_runtime_disable(arizona->dev);
 
 	regulator_disable(arizona->dcvdd);
-- 
2.1.4

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

end of thread, other threads:[~2016-12-09 10:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-22 16:10 [PATCH v2 1/4] mfd: arizona: Disable IRQs during driver remove Charles Keepax
2016-11-22 16:10 ` [PATCH v2 2/4] mfd: arizona: Use arizona_map_irq instead of hard coding it Charles Keepax
2016-12-09 10:50   ` Lee Jones
2016-11-22 16:10 ` [PATCH 3/4] mfd: arizona: Add defines for IRQs on the main Arizona IRQ domain Charles Keepax
2016-12-09 10:51   ` Lee Jones
2016-11-22 16:10 ` [PATCH v4 4/4] mfd: arizona: Correctly clean up after IRQs Charles Keepax
2016-12-09 10:57   ` Lee Jones
2016-12-09  9:30 ` [PATCH v2 1/4] mfd: arizona: Disable IRQs during driver remove Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox