From: Kevin Hilman <khilman@ti.com>
To: Tero Kristo <t-kristo@ti.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCHv3 4/6] OMAP3: PM: Use PRCM chain handler
Date: Fri, 24 Jun 2011 14:57:56 -0700 [thread overview]
Message-ID: <87y60qx57f.fsf@ti.com> (raw)
In-Reply-To: <1308760934-9757-5-git-send-email-t-kristo@ti.com> (Tero Kristo's message of "Wed, 22 Jun 2011 19:42:12 +0300")
Tero Kristo <t-kristo@ti.com> writes:
> PRCM interrupts are now handled with the chained handler mechanism. This patch
> also changes the PRCM interrupts to be of one-shot type,
Not sure I understand the change to one-shot. But since I don't think
you need the handlers anymore, I don't think this change matters.
> and the interrupt
> does not clear the wakeup statuses anymore. Clearing of the wakeup interrupts
> is done just before entering idle, as we probably have more time to do this
> during this time.
Possibly, but if events are not cleared and another PRCM IRQ fires
before the idle path, won't the ISR for that event be triggered again
unncessarily?
Personally, I would much rather see the PRCM IRQ handling code be
responsible for clearning the events (as it is today) instead having it
delegated to the idle task. It is difficult to follow when reading
and...
> Changing the wakeup handling logic also fixes an issue with the
> chained PRCM serial interrupts, that prevents clearing of the UART
> wakeup status and hangs the device.
...and seems to be masking a bug in the UART code someplace.
>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
> arch/arm/mach-omap2/pm34xx.c | 31 ++++++++++++++++++-------------
> 1 files changed, 18 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index adab4d5..ff0811a 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -90,6 +90,7 @@ static int (*_omap_save_secure_sram)(u32 *addr);
> static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
> static struct powerdomain *core_pwrdm, *per_pwrdm;
> static struct powerdomain *cam_pwrdm;
> +static int wkup_event, io_event;
>
> static inline void omap3_per_save_context(void)
> {
> @@ -242,20 +243,18 @@ static int prcm_clear_mod_irqs(s16 module, u8 regs)
>
> static irqreturn_t _prcm_int_handle_wakeup(int irq, void *unused)
> {
> - int c;
> + return IRQ_HANDLED;
> +}
>
> - c = prcm_clear_mod_irqs(WKUP_MOD, 1);
> - c += prcm_clear_mod_irqs(CORE_MOD, 1);
> - c += prcm_clear_mod_irqs(OMAP3430_PER_MOD, 1);
> +static void prcm_clear_wakeups(void)
> +{
> + prcm_clear_mod_irqs(WKUP_MOD, 1);
> + prcm_clear_mod_irqs(CORE_MOD, 1);
> + prcm_clear_mod_irqs(OMAP3430_PER_MOD, 1);
> if (omap_rev() > OMAP3430_REV_ES1_0) {
> - c += prcm_clear_mod_irqs(CORE_MOD, 3);
> - c += prcm_clear_mod_irqs(OMAP3430ES2_USBHOST_MOD, 1);
> + prcm_clear_mod_irqs(CORE_MOD, 3);
> + prcm_clear_mod_irqs(OMAP3430ES2_USBHOST_MOD, 1);
> }
> -
> - if (c)
> - return IRQ_HANDLED;
> - else
> - return IRQ_NONE;
> }
>
> /* Function to restore the table entry that was modified for enabling MMU */
> @@ -301,6 +300,10 @@ void omap_sram_idle(void)
> if (!_omap_sram_idle)
> return;
>
> + prcm_clear_wakeups();
> + omap3_prcm_unmask_event(wkup_event);
> + omap3_prcm_unmask_event(io_event);
Hmm, Also, if you move the event clearing into the actual IRQ handling,
you shouldn't need these unmasks here either since this event will be
handled by handle_level_irq(), which should mask/ack on entry, then
unmask after it's handled.
Kevin
> +
> pwrdm_clear_all_prev_pwrst(mpu_pwrdm);
> pwrdm_clear_all_prev_pwrst(neon_pwrdm);
> pwrdm_clear_all_prev_pwrst(core_pwrdm);
> @@ -832,17 +835,19 @@ static int __init omap3_pm_init(void)
> goto err_prcm_irq_init;
> }
>
> + wkup_event = omap_prcm_event_to_id("wkup");
> ret = request_irq(omap_prcm_event_to_irq("wkup"),
> _prcm_int_handle_wakeup,
> - IRQF_NO_SUSPEND, "prcm_wkup", NULL);
> + IRQF_NO_SUSPEND | IRQF_ONESHOT, "prcm_wkup", NULL);
> if (ret) {
> pr_err("request_irq failed to register for PRCM wakeup\n");
> goto err_prcm_irq_wkup;
> }
>
> + io_event = omap_prcm_event_to_id("io");
> ret = request_irq(omap_prcm_event_to_irq("io"),
> _prcm_int_handle_wakeup,
> - IRQF_NO_SUSPEND, "prcm_io", NULL);
> + IRQF_NO_SUSPEND | IRQF_ONESHOT, "prcm_io", NULL);
> if (ret) {
> pr_err("request_irq failed to register for PRCM io\n");
> goto err_prcm_irq_io;
next prev parent reply other threads:[~2011-06-24 21:58 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-22 16:42 [PATCHv3 0/6] PRCM chain handler Tero Kristo
2011-06-22 16:42 ` [PATCHv3 1/6] omap: prcm: switch to a chained IRQ handler mechanism Tero Kristo
2011-06-22 23:53 ` Kevin Hilman
2011-06-23 7:24 ` Tero Kristo
2011-06-23 8:19 ` Tony Lindgren
2011-06-23 9:08 ` Tero Kristo
2011-06-23 9:51 ` Tony Lindgren
2011-06-24 16:00 ` Kevin Hilman
2011-06-24 21:02 ` Kevin Hilman
2011-06-22 16:42 ` [PATCHv3 2/6] PRCM: Add support for PAD wakeup interrupts Tero Kristo
2011-06-23 10:23 ` Govindraj
2011-06-24 21:34 ` Kevin Hilman
2011-06-24 21:21 ` Kevin Hilman
2011-06-22 16:42 ` [PATCHv3 3/6] OMAP: PRCM: Added an api to get id for a PRCM event Tero Kristo
2011-06-24 21:58 ` Kevin Hilman
2011-06-22 16:42 ` [PATCHv3 4/6] OMAP3: PM: Use PRCM chain handler Tero Kristo
2011-06-24 21:57 ` Kevin Hilman [this message]
2011-06-22 16:42 ` [PATCHv3 5/6] OMAP3: Serial: Made serial to work properly with " Tero Kristo
2011-06-22 17:09 ` Tero Kristo
2011-06-23 10:30 ` Govindraj
2011-06-23 8:21 ` Tony Lindgren
2011-06-23 9:11 ` Tero Kristo
2011-06-23 10:00 ` Tony Lindgren
2011-06-23 10:35 ` Govindraj
2011-06-23 11:12 ` Tony Lindgren
2011-06-24 15:15 ` Kevin Hilman
2011-06-24 22:00 ` Kevin Hilman
2011-06-22 16:42 ` [PATCHv3 6/6] OMAP3: Serial tty: Added resume_idle calls to critical points Tero Kristo
2011-06-27 15:02 ` [PATCHv3 0/6] PRCM chain handler Tero Kristo
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=87y60qx57f.fsf@ti.com \
--to=khilman@ti.com \
--cc=linux-omap@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox