All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: t-kristo@ti.com
Cc: "Mohammed, Afzal" <afzal@ti.com>, Paul Walmsley <paul@pwsan.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: OMAP3EVM not booting on l-o master
Date: Fri, 27 Apr 2012 16:15:21 -0700	[thread overview]
Message-ID: <87fwbowyuu.fsf@ti.com> (raw)
In-Reply-To: <1335532591.2149.163.camel@sokoban> (Tero Kristo's message of "Fri, 27 Apr 2012 16:16:31 +0300")

Tero Kristo <t-kristo@ti.com> writes:

> On Tue, 2012-04-24 at 10:07 -0700, Kevin Hilman wrote:

[...]

>> > From 26733dd988ccc9e72355a39e01b2d6e9215a892d Mon Sep 17 00:00:00 2001
>> > From: Tero Kristo <t-kristo@ti.com>
>> > Date: Mon, 23 Apr 2012 12:14:46 +0300
>> > Subject: [PATCH] ARM: OMAP3: PM: move wakeup event ack to hwmod_io handler
>> >
>> > PRCM IO interrupts are handled with a shared interrupt handler logic.
>> > Currently hwmod_io is processing the actual event, but the acking
>> > of the IO wakeups is done from the PM code with a separate handler.
>> > If a wakeup event is detected during init before the PM code is in
>> > place, the interrupt handler can hang in an infinite loop. Fix this
>> > by removing the pm_io handler, and calling its functionality from
>> > within the hwmod_io handler. This fix applies only to OMAP3, as
>> > OMAP4 does not have similar wakeup handling logic.
>> >
>> > Signed-off-by: Tero Kristo <t-kristo@ti.com>
>> 
>> 
>> Doesn't this mean that even on a !PM kernel that IO events might still
>> be firing for nothing?
>
> I actually disabled the IO handler in !PM kernel, as I thought this
> would be a problem there.

OK

>> Seems like it would be better to ensure that these interrupts are just
>> disabled until the PM core initializes and can enable them.
>
> I thought about this but I couldn't figure out a clean way to do this.
> If I do irq_request, it automatically enables the interrupt, and if
> there is an interrupt pending it will fire immediately and get stuck. 

hmm, I thought there was a flag for disabling the auto-enable feature...
/me looks

Yup, from <linux/irq.h>

 * IRQ_NOAUTOEN			- Interrupt is not automatically enabled in
 *				  request/setup_irq()

With that, we can just set all the PRCM IRQs to be disabled until
explicitly enabled using enable_irq().  The following patch (only boot
tested on OMAP3530/Overo and OMAP4430/Panda) should take care of it.

Do you think that should solve this problem?

Afzal, care to test the patch below to see if it fixes your boot problem
on OMAP3EVM with the IO chain series?

Thanks,

Kevin



From: Kevin Hilman <khilman@ti.com>
Date: Fri, 27 Apr 2012 16:05:51 -0700
Subject: [PATCH] ARM: OMAP2+: PM: leave PRCM interrupts disabled until
 explicitly enabled.

By default, request_irq() will auto-enable the requested IRQ.

For PRCM interrupts, we want to avoid that until the PM core code is
fully ready to handle the interrupts.  This is particularily true for
IO pad interrupts, which are shared between the hwmod core and the PRM
core.  This is also important for !PM kernels where we don't need
any PRCM interrupts firing at all.

In order to avoid PRCM interrupts until ready, set the IRQ_NOAUTOEN
flag for the PRCM chained handler which means PRCM interrupts will
remain disabled after request_irq().

Then, explicitly enable the PRCM interrupts after the request_irq() in
the PM core (but not in the hwmod core.)

Cc: Tero Kristo <t-kristo@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
 arch/arm/mach-omap2/pm34xx.c     |    2 ++
 arch/arm/mach-omap2/prm_common.c |    3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 66ff828..ba17813 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -722,6 +722,7 @@ static int __init omap3_pm_init(void)
 
 	ret = request_irq(omap_prcm_event_to_irq("wkup"),
 		_prcm_int_handle_wakeup, IRQF_NO_SUSPEND, "pm_wkup", NULL);
+	enable_irq(omap_prcm_event_to_irq("wkup"));
 
 	if (ret) {
 		pr_err("pm: Failed to request pm_wkup irq\n");
@@ -732,6 +733,7 @@ static int __init omap3_pm_init(void)
 	ret = request_irq(omap_prcm_event_to_irq("io"),
 		_prcm_int_handle_io, IRQF_SHARED | IRQF_NO_SUSPEND, "pm_io",
 		omap3_pm_init);
+	enable_irq(omap_prcm_event_to_irq("io"));
 
 	if (ret) {
 		pr_err("pm: Failed to request pm_io irq\n");
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index d28f848..c805775 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -307,7 +307,8 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup)
 		ct->regs.ack = irq_setup->ack + i * 4;
 		ct->regs.mask = irq_setup->mask + i * 4;
 
-		irq_setup_generic_chip(gc, mask[i], 0, IRQ_NOREQUEST, 0);
+		irq_setup_generic_chip(gc, mask[i], 0, IRQ_NOREQUEST,
+				       IRQ_NOAUTOEN);
 		prcm_irq_chips[i] = gc;
 	}
 
-- 
1.7.9.2


  reply	other threads:[~2012-04-27 23:15 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04  5:36 OMAP3EVM not booting on l-o master Mohammed, Afzal
2012-04-04  9:11 ` Mohammed, Afzal
2012-04-05  9:33   ` Paul Walmsley
2012-04-05 10:07     ` Paul Walmsley
2012-04-05 16:22       ` Mohammed, Afzal
2012-04-05 19:52         ` Paul Walmsley
2012-04-06  5:09           ` Mohammed, Afzal
2012-04-06  7:13             ` Paul Walmsley
2012-04-06  7:52               ` Mohammed, Afzal
2012-04-23  9:24                 ` Tero Kristo
2012-04-23 10:07                   ` Mohammed, Afzal
2012-04-23 10:13                     ` Tero Kristo
2012-04-23 10:43                       ` Mohammed, Afzal
2012-04-23 11:59                         ` Tero Kristo
2012-04-24 12:00                           ` Mohammed, Afzal
2012-04-24 12:23                             ` Tero Kristo
2012-04-24 17:07                   ` Kevin Hilman
2012-04-27 13:16                     ` Tero Kristo
2012-04-27 23:15                       ` Kevin Hilman [this message]
2012-04-28 11:51                         ` Mohammed, Afzal
2012-04-30 12:46                         ` Tero Kristo
2012-04-30 20:40                           ` Kevin Hilman
2012-05-01 12:55                             ` Mohammed, Afzal
2012-05-01 14:08                               ` Kevin Hilman
2012-05-02  5:48                                 ` Mohammed, Afzal
2012-05-02  8:39                                   ` Tero Kristo
2012-05-02  8:45                             ` Paul Walmsley
2012-05-02 14:27                               ` Kevin Hilman
2012-05-11 22:39                                 ` Paul Walmsley
2012-04-05 21:21       ` Kevin Hilman
2012-04-05 10:11     ` Mohammed, Afzal
2012-04-05 10:17       ` Paul Walmsley
2012-04-05 10:23         ` Raja, Govindraj
2012-04-05 16:19           ` Mohammed, Afzal
2012-04-05 17:16             ` Tony Lindgren
2012-04-06  4:54               ` Mohammed, Afzal
2012-04-06 17:41                 ` Tony Lindgren
2012-04-06 18:08                   ` Paul Walmsley
2012-04-06 18:24                     ` Tony Lindgren

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=87fwbowyuu.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=afzal@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=t-kristo@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.