From: Kevin Hilman <khilman@deeprootsystems.com>
To: Tero Kristo <tero.kristo@nokia.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH 5/5] OMAP3: PM: Disable OTG autoidle when waking up from off-mode
Date: Thu, 12 Nov 2009 07:37:14 -0800 [thread overview]
Message-ID: <87zl6ru53p.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1258020444-3809-6-git-send-email-tero.kristo@nokia.com> (Tero Kristo's message of "Thu\, 12 Nov 2009 12\:07\:24 +0200")
Tero Kristo <tero.kristo@nokia.com> writes:
> From: Tero Kristo <tero.kristo@nokia.com>
>
> OMAP3 sleep can be prevented in some cases where OTG autoidle is enabled.
> This patch force disables autoidle during wakeup from off-mode. See omap
> errata 1.164.
>
> This fix can't be done in driver level, as off-mode entry resets and enables
> the autoidle bit, and driver does not access the register after each off-mode
> entry even if it is loaded.
>
> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Thanks Tero for the updated changelog.
Applying to PM branch reluctantly and with grumbles. I sure hope
someone in TI is reporting all these ROM code issues to the ROM code
team so they get appropriate fixes.
Kevin
> ---
> arch/arm/mach-omap2/pm34xx.c | 6 ++++++
> arch/arm/mach-omap2/usb-musb.c | 14 ++++++++------
> arch/arm/plat-omap/include/plat/usb.h | 3 +++
> 3 files changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 2f9f4a0..ab7b30f 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -37,6 +37,7 @@
> #include <plat/gpmc.h>
> #include <plat/dma.h>
> #include <plat/dmtimer.h>
> +#include <plat/usb.h>
>
> #include <plat/resource.h>
>
> @@ -496,6 +497,11 @@ void omap_sram_idle(void)
> omap3_prcm_restore_context();
> omap3_sram_restore_context();
> omap2_sms_restore_context();
> + /*
> + * Errata 1.164 fix : OTG autoidle can prevent
> + * sleep
> + */
> + usb_musb_disable_autoidle();
> }
> omap_uart_resume_idle(0);
> omap_uart_resume_idle(1);
> diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
> index f5364b8..bb3cee4 100644
> --- a/arch/arm/mach-omap2/usb-musb.c
> +++ b/arch/arm/mach-omap2/usb-musb.c
> @@ -44,10 +44,11 @@ static struct platform_device dummy_pdev = {
> },
> };
>
> +static void __iomem *otg_base;
> +static struct clk *otg_clk;
> +
> static void __init usb_musb_pm_init(void)
> {
> - void __iomem *otg_base;
> - struct clk *otg_clk;
> struct device *dev = &dummy_pdev.dev;
>
> if (!cpu_is_omap34xx())
> @@ -74,12 +75,13 @@ static void __init usb_musb_pm_init(void)
> cpu_relax();
> }
>
> - if (otg_clk) {
> + if (otg_clk)
> clk_disable(otg_clk);
> - clk_put(otg_clk);
> - }
> +}
>
> - iounmap(otg_base);
> +void usb_musb_disable_autoidle(void)
> +{
> + __raw_writel(0, otg_base + OTG_SYSCONFIG);
> }
>
> #ifdef CONFIG_USB_MUSB_SOC
> diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
> index 33a500e..31b13bc 100644
> --- a/arch/arm/plat-omap/include/plat/usb.h
> +++ b/arch/arm/plat-omap/include/plat/usb.h
> @@ -46,6 +46,9 @@ extern void usb_musb_init(void);
>
> extern void usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata);
>
> +/* This is needed for OMAP3 errata 1.164: enabled autoidle can prevent sleep */
> +extern void usb_musb_disable_autoidle(void);
> +
> #endif
>
> void omap_usb_init(struct omap_usb_config *pdata);
> --
> 1.5.4.3
>
> --
> 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
next prev parent reply other threads:[~2009-11-12 15:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-12 10:07 [PATCHv3 0/5] Misc fixes [for PM branch] Tero Kristo
2009-11-12 10:07 ` [PATCH 1/5] OMAP3: Fixed ARM aux ctrl register save/restore Tero Kristo
2009-11-12 10:07 ` [PATCH 2/5] OMAP3: PM: Disabled I2C4 repeated start operation mode Tero Kristo
2009-11-12 10:07 ` [PATCH 3/5] OMAP3: PM: Added support for L2 aux ctrl register save and restore Tero Kristo
2009-11-12 10:07 ` [PATCH 4/5] OMAP3: PM: Write voltage and clock setup times dynamically in idle loop Tero Kristo
2009-11-12 10:07 ` [PATCH 5/5] OMAP3: PM: Disable OTG autoidle when waking up from off-mode Tero Kristo
2009-11-12 15:37 ` Kevin Hilman [this message]
2009-11-12 15:40 ` Gadiyar, Anand
2009-12-18 8:08 ` Eduardo Valentin
2009-12-18 8:58 ` [PATCH 1/1] OMAP3: PM: Fix OTG autoidle workaround Eduardo Valentin
2009-12-18 9:40 ` Gadiyar, Anand
2009-12-18 10:39 ` [PATCHv2 " Eduardo Valentin
2009-12-18 11:12 ` Felipe Balbi
2010-01-05 23:47 ` Tony Lindgren
2010-01-12 19:49 ` Kevin Hilman
2009-11-12 15:31 ` [PATCH 4/5] OMAP3: PM: Write voltage and clock setup times dynamically in idle loop Kevin Hilman
2009-11-12 15:32 ` [PATCH 2/5] OMAP3: PM: Disabled I2C4 repeated start operation mode Kevin Hilman
2009-11-26 11:18 ` [PATCH 1/5] OMAP3: Fixed ARM aux ctrl register save/restore Gopinath, Thara
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=87zl6ru53p.fsf@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.org \
--cc=tero.kristo@nokia.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