public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: linux-kernel@vger.kernel.org, patches@opensource.wolfsonmicro.com
Subject: Re: [PATCH 2/3] mfd: arizona: Disable IRQs during driver remove
Date: Tue, 22 Nov 2016 12:59:14 +0000	[thread overview]
Message-ID: <20161122125914.GB316@dell.lan> (raw)
In-Reply-To: <1479143757-30531-2-git-send-email-ckeepax@opensource.wolfsonmicro.com>

On Mon, 14 Nov 2016, Charles Keepax wrote:

> 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(+)

I'm convinced.

Applied, thanks.

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

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2016-11-22 13:05 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 ` [PATCH 2/3] mfd: arizona: Disable IRQs during driver remove Charles Keepax
2016-11-22 12:59   ` Lee Jones [this message]
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=20161122125914.GB316@dell.lan \
    --to=lee.jones@linaro.org \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --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