Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933195AbcKVNFg (ORCPT ); Tue, 22 Nov 2016 08:05:36 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:36843 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932469AbcKVNFf (ORCPT ); Tue, 22 Nov 2016 08:05:35 -0500 Date: Tue, 22 Nov 2016 12:59:14 +0000 From: Lee Jones To: Charles Keepax Cc: linux-kernel@vger.kernel.org, patches@opensource.wolfsonmicro.com Subject: Re: [PATCH 2/3] mfd: arizona: Disable IRQs during driver remove Message-ID: <20161122125914.GB316@dell.lan> References: <1479143757-30531-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> <1479143757-30531-2-git-send-email-ckeepax@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1479143757-30531-2-git-send-email-ckeepax@opensource.wolfsonmicro.com> User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1736 Lines: 45 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 > --- > 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