From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932775AbcFOMvK (ORCPT ); Wed, 15 Jun 2016 08:51:10 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:33536 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932121AbcFOMvF (ORCPT ); Wed, 15 Jun 2016 08:51:05 -0400 Date: Wed, 15 Jun 2016 13:51:45 +0100 From: Lee Jones To: Richard Fitzgerald Cc: patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 RESEND] mfd: arizona: Check if AOD interrupts are pending before dispatching Message-ID: <20160615125145.GF4948@dell> References: <1465982924-17204-1-git-send-email-rf@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1465982924-17204-1-git-send-email-rf@opensource.wolfsonmicro.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 15 Jun 2016, Richard Fitzgerald wrote: > Previously the arizona_irq_thread implementation would call > handle_nested_irqs() to handle AOD interrupts without checking if any > were actually pending. The kernel will see these as spurious IRQs and > will eventually disable the IRQ. > > This patch ensures we only launch the nested handler if there are AOD > interrupts pending in the codec. > > Signed-off-by: Simon Trimmer > Signed-off-by: Richard Fitzgerald > --- > drivers/mfd/arizona-irq.c | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) Applied, thanks. > diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c > index edeb495..5e18d3c 100644 > --- a/drivers/mfd/arizona-irq.c > +++ b/drivers/mfd/arizona-irq.c > @@ -109,8 +109,20 @@ static irqreturn_t arizona_irq_thread(int irq, void *data) > do { > poll = false; > > - if (arizona->aod_irq_chip) > - handle_nested_irq(irq_find_mapping(arizona->virq, 0)); > + if (arizona->aod_irq_chip) { > + /* > + * Check the AOD status register to determine whether > + * the nested IRQ handler should be called. > + */ > + ret = regmap_read(arizona->regmap, > + ARIZONA_AOD_IRQ1, &val); > + if (ret) > + dev_warn(arizona->dev, > + "Failed to read AOD IRQ1 %d\n", ret); > + else if (val) > + handle_nested_irq( > + irq_find_mapping(arizona->virq, 0)); > + } > > /* > * Check if one of the main interrupts is asserted and only -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog