>-----Original Message----- >From: ext Gupta, Ajay Kumar [mailto:ajay.gupta@xxxxxx] >Sent: 21 January, 2010 12:31 >To: Kristo Tero (Nokia-D/Tampere); linux-omap@xxxxxxxxxxxxxxx >Cc: Kevin Hilman >Subject: RE: OMAP3: PM: Disable OTG autoidle when waking up >from off-mode > >Hi Kristo, > >There are some issues with this patch in PM branch. > >Please find my comments inline. > >Regards, >Ajay > >> OMAP3: PM: Disable OTG autoidle when waking up from off-mode >> >> 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. >> >> Tero Kristo <tero.kristo nokia.com> >> Kevin Hilman <khilman deeprootsystems.com> >> >> diff --git a/arch/arm/mach-omap2/pm34xx.c >b/arch/arm/mach-omap2/pm34xx.c >> index 81ed252..ddd19cd 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 <asm/tlbflush.h> >> >> @@ -430,6 +431,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(); > >Do we really need it? We are anyway disabling autoidle in >Drivers/usb/musb/omap2430.c file. This is not enough, as off-mode entry will reset this register. And, we are not calling MUSB resume functions after every wakeup from off. > > >> clk_disable(otg_clk); >> - clk_put(otg_clk); >> - } >> +} > ><snip..> > >> >> - iounmap(otg_base); >> +void usb_musb_disable_autoidle(void) >> +{ >> + __raw_writel(0, otg_base + OTG_SYSCONFIG); > > >We should first read the register and the reset the first bit D0 >for disabling autoidle. We know that always when we are calling this function, we are waking up from off-mode and MUSB module has been reset also. Thus, no need to read it, as we know what the reset value is. > >Also, musb clock needs to be enabled during this function call. >When I tool musb save/restore patch (accepted and in queue), >I found a system hand during resume. It is possible that MUSB clock is disabled here if you are fiddling with the clocks on the MUSB module side. In that case this patch should probably be modified. -Tero-- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html