From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Liu Subject: Re: usb: musb: regression since 4.9 on omap4-panda-es (caused by d8e5f0eca1e8) Date: Thu, 6 Apr 2017 14:07:22 -0500 Message-ID: <20170406190722.GA12367@uda0271908> References: <2bf73b02-6e59-627a-c370-552ed94e7795@ti.com> <20170404122736.GA13673@uda0271908> <20170404140341.GO10760@atomide.com> <20170405003637.GB13234@atomide.com> <20170405134655.GD13234@atomide.com> <20170405152954.GF13234@atomide.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <20170405152954.GF13234-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Tony Lindgren Cc: Peter Ujfalusi , linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux OMAP List List-Id: linux-omap@vger.kernel.org On Wed, Apr 05, 2017 at 08:29:55AM -0700, Tony Lindgren wrote: > * Tony Lindgren [170405 06:53]: > > * Peter Ujfalusi [170405 00:15]: > > > To be precise this is what I have tried: > > > - boot w/o cable connected > > > - boot w/ board connected to PC (device mode) > > > - boot w/ OTG-A cable with USB keyboard > > > - boot w/ OTG-A cable connected to powered USB hub and the same keyboard > > > > > > w/ and w/o this patch I have the same flood of prints in all cases. > > > > OK interesting that it also happens with nothing connected. > > > > > Fwiw I have checked where the is_active is set - which causes the prints: > > > musb_core.c:musb_start() > > > > > > if (musb->port_mode != MUSB_PORT_MODE_HOST && > > > musb->xceiv->otg->state != OTG_STATE_A_WAIT_BCON && > > > (devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) { > > > musb->is_active = 1; > > > } else { > > > devctl |= MUSB_DEVCTL_SESSION; > > > } > > > > > > this was the only place where the is_active was set to 1. > > > > That seems normal in musb_start(). Will try with your .config > > here. > > If the the port is configured as OTG, we should not need to > try to force any states during init. The change below will stop True, but the code has been there for a very long time, any idea what causes the regression? Regards, -Bin. > the warnings with your .config, needs to be tested more though > to make sure things still work in all cases. > > Regards, > > Tony > > 8< -------------------------- > diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c > --- a/drivers/usb/musb/musb_host.c > +++ b/drivers/usb/musb/musb_host.c > @@ -2780,10 +2780,11 @@ int musb_host_setup(struct musb *musb, int power_budget) > int ret; > struct usb_hcd *hcd = musb->hcd; > > - MUSB_HST_MODE(musb); > - musb->xceiv->otg->default_a = 1; > - musb->xceiv->otg->state = OTG_STATE_A_IDLE; > - > + if (musb->port_mode == MUSB_PORT_MODE_HOST) { > + MUSB_HST_MODE(musb); > + musb->xceiv->otg->default_a = 1; > + musb->xceiv->otg->state = OTG_STATE_A_IDLE; > + } > otg_set_host(musb->xceiv->otg, &hcd->self); > hcd->self.otg_port = 1; > musb->xceiv->otg->host = &hcd->self; > -- > 2.12.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html