linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: <lee.jones@linaro.org>
Cc: <linux-kernel@vger.kernel.org>, <patches@opensource.wolfsonmicro.com>
Subject: [PATCH 2/3] mfd: arizona: Disable IRQs during driver remove
Date: Mon, 14 Nov 2016 17:15:56 +0000	[thread overview]
Message-ID: <1479143757-30531-2-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1479143757-30531-1-git-send-email-ckeepax@opensource.wolfsonmicro.com>

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>
---
 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

  reply	other threads:[~2016-11-14 17:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-14 17:15 [PATCH v2 1/3] mfd: arizona: Correctly clean up after IRQs Charles Keepax
2016-11-14 17:15 ` Charles Keepax [this message]
2016-11-22 12:59   ` [PATCH 2/3] mfd: arizona: Disable IRQs during driver remove Lee Jones
2016-11-14 17:15 ` [PATCH 3/3] mfd: arizona: Use arizona_map_irq instead of hard coding it Charles Keepax
2016-11-22 13:01   ` Lee Jones
2016-11-22 15:54     ` Lee Jones
2016-11-22 16:07       ` Charles Keepax
2016-11-22 12:57 ` [PATCH v2 1/3] mfd: arizona: Correctly clean up after IRQs Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479143757-30531-2-git-send-email-ckeepax@opensource.wolfsonmicro.com \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.wolfsonmicro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).