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]
Date:   Wed, 26 Apr 2023 20:01:40 +0000
From:   Thinh Nguyen <Thinh.Nguyen@...opsys.com>
To:     Roger Quadros <rogerq@...nel.org>
CC:     Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: dwc3 gadget: controller stop times out on system sleep

Hi,

On Wed, Apr 26, 2023, Roger Quadros wrote:
> Hi Thinh,
> 
> On Linux kernel v6.3
> Test procedure: 
> 
> - modprobe g_zero
> - Connect to PC host
> - systemctl suspend
> 
> A large delay of 3 seconds is observed. The delay comes from dwc3_gadget_suspend()->dwc3_gadget_run_stop() waiting for DWC3_DSTS_DEVCTRLHLT to be set.
> It returns -ETIMEDOUT.
> 
> Are we missing something to do a clean stop during suspend?
> 
> FYI. Unloading g_zero does not show this delay on stop.
> 
> cheers,
> -roger

When clearing run_stop bit and the controller doesn't halt, that usually
means there are active transfers/endpoints that aren't ended yet.

The dwc3_gadget_suspend() doesn't properly do all the cleanup before
clearing the run_stop bit. I think you just need to call
dwc3_gadget_soft_disconnect() in dwc3_gadget_suspend() to fix this.

Thanks,
Thinh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ