diff mbox

[1/1] twl4030: Fix chained irq handling on resume from suspend

Message ID 1350399575-13240-1-git-send-email-kalle.jokiniemi@jollamobile.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kalle Jokiniemi Oct. 16, 2012, 2:59 p.m. UTC
The irqs are enabled one-by-one in pm core resume_noirq phase.
This leads to situation where the twl4030 primary interrupt
handler (PIH) is enabled before the chained secondary handlers
(SIH). As the PIH cannot clear the pending interrupt, and
SIHs have not been enabled yet, a flood of interrupts hangs
the device.

Fixed the issue by setting the SIH irqs with IRQF_EARLY_RESUME
flags, so they get enabled before the PIH.

Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@jollamobile.com>
---
 drivers/mfd/twl4030-irq.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Kalle Jokiniemi Oct. 16, 2012, 3:04 p.m. UTC | #1
Hi,

ti, 2012-10-16 kello 17:59 +0300, Kalle Jokiniemi kirjoitti:
> The irqs are enabled one-by-one in pm core resume_noirq phase.
> This leads to situation where the twl4030 primary interrupt
> handler (PIH) is enabled before the chained secondary handlers
> (SIH). As the PIH cannot clear the pending interrupt, and
> SIHs have not been enabled yet, a flood of interrupts hangs
> the device.
> 
> Fixed the issue by setting the SIH irqs with IRQF_EARLY_RESUME
> flags, so they get enabled before the PIH.

Did it this way now, since the tl4030_irq is not really a driver that
could do normal suspend / resume calls... and this is what the flag is
for.

Added Samuel to recipients, as get_maintainer reported him as
maintainer.

- Kalle

> 
> Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@jollamobile.com>
> ---
>  drivers/mfd/twl4030-irq.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
> index ad733d7..cdd1173 100644
> --- a/drivers/mfd/twl4030-irq.c
> +++ b/drivers/mfd/twl4030-irq.c
> @@ -672,7 +672,8 @@ int twl4030_sih_setup(struct device *dev, int module, int irq_base)
>  	irq = sih_mod + twl4030_irq_base;
>  	irq_set_handler_data(irq, agent);
>  	agent->irq_name = kasprintf(GFP_KERNEL, "twl4030_%s", sih->name);
> -	status = request_threaded_irq(irq, NULL, handle_twl4030_sih, 0,
> +	status = request_threaded_irq(irq, NULL, handle_twl4030_sih,
> +				      IRQF_EARLY_RESUME,
>  				      agent->irq_name ?: sih->name, NULL);
>  
>  	dev_info(dev, "%s (irq %d) chaining IRQs %d..%d\n", sih->name,


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kevin Hilman Oct. 16, 2012, 11:52 p.m. UTC | #2
Kalle Jokiniemi <kalle.jokiniemi@jollamobile.com> writes:

> The irqs are enabled one-by-one in pm core resume_noirq phase.
> This leads to situation where the twl4030 primary interrupt
> handler (PIH) is enabled before the chained secondary handlers
> (SIH). As the PIH cannot clear the pending interrupt, and
> SIHs have not been enabled yet, a flood of interrupts hangs
> the device.
>
> Fixed the issue by setting the SIH irqs with IRQF_EARLY_RESUME
> flags, so they get enabled before the PIH.
>
> Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@jollamobile.com>

Acked-by: Kevin Hilman <khilman@ti.com>

Thanks, I like this better than the I2C driver fix.  

Samuel, feel free to take this for v3.7

Kevin

> ---
>  drivers/mfd/twl4030-irq.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
> index ad733d7..cdd1173 100644
> --- a/drivers/mfd/twl4030-irq.c
> +++ b/drivers/mfd/twl4030-irq.c
> @@ -672,7 +672,8 @@ int twl4030_sih_setup(struct device *dev, int module, int irq_base)
>  	irq = sih_mod + twl4030_irq_base;
>  	irq_set_handler_data(irq, agent);
>  	agent->irq_name = kasprintf(GFP_KERNEL, "twl4030_%s", sih->name);
> -	status = request_threaded_irq(irq, NULL, handle_twl4030_sih, 0,
> +	status = request_threaded_irq(irq, NULL, handle_twl4030_sih,
> +				      IRQF_EARLY_RESUME,
>  				      agent->irq_name ?: sih->name, NULL);
>  
>  	dev_info(dev, "%s (irq %d) chaining IRQs %d..%d\n", sih->name,
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Samuel Ortiz Nov. 21, 2012, 4:47 p.m. UTC | #3
Hi Kalle,

On Tue, Oct 16, 2012 at 05:59:35PM +0300, Kalle Jokiniemi wrote:
> The irqs are enabled one-by-one in pm core resume_noirq phase.
> This leads to situation where the twl4030 primary interrupt
> handler (PIH) is enabled before the chained secondary handlers
> (SIH). As the PIH cannot clear the pending interrupt, and
> SIHs have not been enabled yet, a flood of interrupts hangs
> the device.
> 
> Fixed the issue by setting the SIH irqs with IRQF_EARLY_RESUME
> flags, so they get enabled before the PIH.
> 
> Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@jollamobile.com>
> ---
>  drivers/mfd/twl4030-irq.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
Thanks, patch applied to my for-linus branch.

Cheers,
Samuel.
diff mbox

Patch

diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
index ad733d7..cdd1173 100644
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -672,7 +672,8 @@  int twl4030_sih_setup(struct device *dev, int module, int irq_base)
 	irq = sih_mod + twl4030_irq_base;
 	irq_set_handler_data(irq, agent);
 	agent->irq_name = kasprintf(GFP_KERNEL, "twl4030_%s", sih->name);
-	status = request_threaded_irq(irq, NULL, handle_twl4030_sih, 0,
+	status = request_threaded_irq(irq, NULL, handle_twl4030_sih,
+				      IRQF_EARLY_RESUME,
 				      agent->irq_name ?: sih->name, NULL);
 
 	dev_info(dev, "%s (irq %d) chaining IRQs %d..%d\n", sih->name,