linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 RESEND] mfd: arizona: Check if AOD interrupts are pending before dispatching
@ 2016-06-15  9:28 Richard Fitzgerald
  2016-06-15 12:51 ` Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Fitzgerald @ 2016-06-15  9:28 UTC (permalink / raw)
  To: lee.jones; +Cc: patches, linux-kernel

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 <simont@opensource.wolfsonmicro.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
---
 drivers/mfd/arizona-irq.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

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

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

* Re: [PATCH v2 RESEND] mfd: arizona: Check if AOD interrupts are pending before dispatching
  2016-06-15  9:28 [PATCH v2 RESEND] mfd: arizona: Check if AOD interrupts are pending before dispatching Richard Fitzgerald
@ 2016-06-15 12:51 ` Lee Jones
  0 siblings, 0 replies; 3+ messages in thread
From: Lee Jones @ 2016-06-15 12:51 UTC (permalink / raw)
  To: Richard Fitzgerald; +Cc: patches, linux-kernel

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 <simont@opensource.wolfsonmicro.com>
> Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
> ---
>  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

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

* [PATCH v2 RESEND] mfd: arizona: Check if AOD interrupts are pending before dispatching
@ 2016-05-23  9:23 Richard Fitzgerald
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2016-05-23  9:23 UTC (permalink / raw)
  To: lee.jones; +Cc: patches, linux-kernel

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 <simont@opensource.wolfsonmicro.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
---
 drivers/mfd/arizona-irq.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

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

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

end of thread, other threads:[~2016-06-15 12:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-15  9:28 [PATCH v2 RESEND] mfd: arizona: Check if AOD interrupts are pending before dispatching Richard Fitzgerald
2016-06-15 12:51 ` Lee Jones
  -- strict thread matches above, loose matches on Subject: below --
2016-05-23  9:23 Richard Fitzgerald

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