lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221007021122.nnwmqc6sq43e5xbn@synopsys.com>
Date:   Fri, 7 Oct 2022 02:11:37 +0000
From:   Thinh Nguyen <Thinh.Nguyen@...opsys.com>
To:     Ferry Toth <fntoth@...il.com>
CC:     Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Andrey Smirnov <andrew.smirnov@...il.com>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Felipe Balbi <balbi@...nel.org>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] Revert "usb: dwc3: Don't switch OTG -> peripheral
 if extcon is present"

On Thu, Oct 06, 2022, Ferry Toth wrote:
> Hi
> 
> On 06-10-2022 04:12, Thinh Nguyen wrote:
> > On Wed, Oct 05, 2022, Ferry Toth wrote:
> > > Hi,
> > > 
> > >      Thanks!
> > > 
> > >      Does the failure only happen the first time host is initialized? Or can
> > >      it recover after switching to device then back to host mode?
> > > 
> > > I can switch back and forth and device mode works each time, host mode remains
> > > dead.
> > Ok.
> > 
> > >      Probably the failure happens if some step(s) in dwc3_core_init() hasn't
> > >      completed.
> > > 
> > >      tusb1210 is a phy driver right? The issue is probably because we didn't
> > >      initialize the phy yet. So, I suspect placing dwc3_get_extcon() after
> > >      initializing the phy will probably solve the dependency problem.
> > > 
> > >      You can try something for yourself or I can provide something to test
> > >      later if you don't mind (maybe next week if it's ok).
> > > 
> > > Yes, the code move I mentioned above "moves dwc3_get_extcon() until after
> > > dwc3_core_init() but just before dwc3_core_init_mode(). AFAIU initially
> > > dwc3_get_extcon() was called from within dwc3_core_init_mode() but only for
> > > case USB_DR_MODE_OTG. So with this change order of events is more or less
> > > unchanged" solves the issue.
> > > 
> > I saw the experiment you did from the link you provided. We want to also
> > confirm exactly which step in dwc3_core_init() was needed.
> 
> Ok. I first tried the code move suggested by Andrey (didn't work). Then
> after reading the actual code I moved a bit further.
> 
> This move was on top of -rc6 without any reverts. I did not make additional
> changes to dwc3_core_init()
> 
> So current v6.0 has: dwc3_get_extcon - dwc3_get_dr_mode - ... -
> dwc3_core_init - .. - dwc3_core_init_mode (not working)
> 
> I changed to: dwc3_get_dr_mode - dwc3_get_extcon - .. - dwc3_core_init - ..
> - dwc3_core_init_mode (no change)
> 
> Then to: dwc3_get_dr_mode - .. - dwc3_core_init - .. - dwc3_get_extcon -
> dwc3_core_init_mode (works)
> 
> .. are what I believe for this issue irrelevant calls to
> dwc3_alloc_scratch_buffers, dwc3_check_params and dwc3_debugfs_init.
> 

Right. Thanks for narrowing it down. There are still many steps in
dwc3_core_init(). We have some suspicion, but we still haven't confirmed
the exact cause of the failure. We can write a proper patch once we know
the reason.

Thanks,
Thinh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ