All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: Tero Kristo <t-kristo@ti.com>
Cc: linux-omap@vger.kernel.org, paul@pwsan.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC 1/6] ARM: OMAP3: PRM: move prcm interrupt handlers to PRM driver code
Date: Mon, 30 Jul 2012 17:31:14 -0700	[thread overview]
Message-ID: <87ipd4g4a5.fsf@ti.com> (raw)
In-Reply-To: <1342197459-7920-2-git-send-email-t-kristo@ti.com> (Tero Kristo's message of "Fri, 13 Jul 2012 19:37:34 +0300")

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

> PM code doesn't really care about the PRCM wakeup + io interrupts on
> OMAP3, as these are used only for acking PRCM internal events, and the
> IO chain handler is taken care of by hwmod code. Thus move the interrupt
> handling logic from pm34xx.c to prm2xxx_3xxx.c file. This patch also
> includes a minor cleanup for removing the priority handling and replacing
> it with a mechanism for acking pending events. This gets rid of the need
> for registering the shared interrupt handlers in specific order.
>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>

Like Rajendra, I found this combination a bit difficult to review, so I
decided to apply it and test it first.

Testing with just this patch (on top of Paul's omap4_warnings_fix_3.6
branch, which has the setup_preprogram hooks), and I get a hang on
3530 and 3730 Overo platforms (works fine on 3430/n900 and 3630/xM.)

I'm not sure what is happening yet, but there seems to be a race between
the IO and wkup handlers...

[...]

> +/**
> + * omap3xxx_prm_clear_wakeups - clears wakeup event sources
> + * @events: active PRCM interrupt event mask
> + *
> + * This function will first check if PRCM chain handler detected
> + * a wakeup event or not. If yes, it will continue to clear any
> + * pending wakeup events from PRCM module. Typically the module
> + * will generate an actual interrupt together with the wakeup event,
> + * which will then be handled separately by the driver code.
> + */
> +void omap3xxx_prm_clear_wakeups(unsigned long *events)
> +{
> +	int c;
> +
> +	/*
> +	 * If we didn't come here because of a wakeup event, do nothing
> +	 */
> +	if (!(events[0] & OMAP3430_WKUP_ST_MASK))
> +		return;

... because if I comment out the above two lines, it goes back to
working again.

> +	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);
> +	if (omap_rev() > OMAP3430_REV_ES1_0) {
> +		c += _prcm_clear_mod_irqs(CORE_MOD, 3);
> +		c += _prcm_clear_mod_irqs(OMAP3430ES2_USBHOST_MOD, 1);
> +	}
> +}

At first, I wasn't sure why this was happening on Overo boards and not
on the other boards, but then I notcied there was a *lot* more pm_wkup
interrupts during boot on Overo compared to the other boards.  This is
because of the GPIO IRQ for the network interface as well as the network
stack itself setting timers, resulting in a lot more pm_wkup events
during boot and making the race more likely.

Kevin


WARNING: multiple messages have this Message-ID (diff)
From: khilman@ti.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 1/6] ARM: OMAP3: PRM: move prcm interrupt handlers to PRM driver code
Date: Mon, 30 Jul 2012 17:31:14 -0700	[thread overview]
Message-ID: <87ipd4g4a5.fsf@ti.com> (raw)
In-Reply-To: <1342197459-7920-2-git-send-email-t-kristo@ti.com> (Tero Kristo's message of "Fri, 13 Jul 2012 19:37:34 +0300")

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

> PM code doesn't really care about the PRCM wakeup + io interrupts on
> OMAP3, as these are used only for acking PRCM internal events, and the
> IO chain handler is taken care of by hwmod code. Thus move the interrupt
> handling logic from pm34xx.c to prm2xxx_3xxx.c file. This patch also
> includes a minor cleanup for removing the priority handling and replacing
> it with a mechanism for acking pending events. This gets rid of the need
> for registering the shared interrupt handlers in specific order.
>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>

Like Rajendra, I found this combination a bit difficult to review, so I
decided to apply it and test it first.

Testing with just this patch (on top of Paul's omap4_warnings_fix_3.6
branch, which has the setup_preprogram hooks), and I get a hang on
3530 and 3730 Overo platforms (works fine on 3430/n900 and 3630/xM.)

I'm not sure what is happening yet, but there seems to be a race between
the IO and wkup handlers...

[...]

> +/**
> + * omap3xxx_prm_clear_wakeups - clears wakeup event sources
> + * @events: active PRCM interrupt event mask
> + *
> + * This function will first check if PRCM chain handler detected
> + * a wakeup event or not. If yes, it will continue to clear any
> + * pending wakeup events from PRCM module. Typically the module
> + * will generate an actual interrupt together with the wakeup event,
> + * which will then be handled separately by the driver code.
> + */
> +void omap3xxx_prm_clear_wakeups(unsigned long *events)
> +{
> +	int c;
> +
> +	/*
> +	 * If we didn't come here because of a wakeup event, do nothing
> +	 */
> +	if (!(events[0] & OMAP3430_WKUP_ST_MASK))
> +		return;

... because if I comment out the above two lines, it goes back to
working again.

> +	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);
> +	if (omap_rev() > OMAP3430_REV_ES1_0) {
> +		c += _prcm_clear_mod_irqs(CORE_MOD, 3);
> +		c += _prcm_clear_mod_irqs(OMAP3430ES2_USBHOST_MOD, 1);
> +	}
> +}

At first, I wasn't sure why this was happening on Overo boards and not
on the other boards, but then I notcied there was a *lot* more pm_wkup
interrupts during boot on Overo compared to the other boards.  This is
because of the GPIO IRQ for the network interface as well as the network
stack itself setting timers, resulting in a lot more pm_wkup events
during boot and making the race more likely.

Kevin

  parent reply	other threads:[~2012-07-31  0:31 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-13 16:37 [RFC 0/6] ARM: OMAP3+: minor PM core code cleanup Tero Kristo
2012-07-13 16:37 ` Tero Kristo
2012-07-13 16:37 ` [RFC 1/6] ARM: OMAP3: PRM: move prcm interrupt handlers to PRM driver code Tero Kristo
2012-07-13 16:37   ` Tero Kristo
2012-07-16 11:26   ` Rajendra Nayak
2012-07-16 11:26     ` Rajendra Nayak
2012-07-16 11:41     ` Tero Kristo
2012-07-16 11:41       ` Tero Kristo
2012-07-31  0:31   ` Kevin Hilman [this message]
2012-07-31  0:31     ` Kevin Hilman
2012-08-07  7:28     ` Tony Lindgren
2012-08-07  7:28       ` Tony Lindgren
2012-07-13 16:37 ` [RFC 2/6] ARM: OMAP3: clock data: prevent IVA2 DPLL low power stop mode Tero Kristo
2012-07-13 16:37   ` Tero Kristo
2012-07-13 16:37 ` [RFC 3/6] ARM: OMAP3: hwmod data: fix iva2 reset info Tero Kristo
2012-07-13 16:37   ` Tero Kristo
2012-07-16  0:12   ` Paul Walmsley
2012-07-16  0:12     ` Paul Walmsley
2012-07-13 16:37 ` [RFC 4/6] ARM: OMAP3: hwmod data: add custom setup_preprogram for iva hwmod Tero Kristo
2012-07-13 16:37   ` Tero Kristo
2012-07-13 16:37 ` [RFC 5/6] ARM: OMAP3: hwmod data: add sad2d hwmod Tero Kristo
2012-07-13 16:37   ` Tero Kristo
2012-07-16  1:14   ` Paul Walmsley
2012-07-16  1:14     ` Paul Walmsley
2012-07-16  1:28   ` Paul Walmsley
2012-07-16  1:28     ` Paul Walmsley
2012-07-13 16:37 ` [RFC 6/6] ARM: OMAP3: hwmod data: add custom setup_preprogram for " Tero Kristo
2012-07-13 16:37   ` Tero Kristo
2012-07-30 20:53 ` [RFC 0/6] ARM: OMAP3+: minor PM core code cleanup Kevin Hilman
2012-07-30 20:53   ` Kevin Hilman

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=87ipd4g4a5.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --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.