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:   Tue, 11 Apr 2023 01:14:03 +0000
From:   Thinh Nguyen <Thinh.Nguyen@...opsys.com>
To:     Wesley Cheng <quic_wcheng@...cinc.com>
CC:     "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "quic_jackp@...cinc.com" <quic_jackp@...cinc.com>,
        "quic_ugoswami@...cinc.com" <quic_ugoswami@...cinc.com>
Subject: Re: [PATCH v3 3/3] usb: dwc3: gadget: Execute gadget stop after
 halting the controller

On Mon, Apr 10, 2023, Wesley Cheng wrote:
> Do not call gadget stop until the poll for controller halt is
> completed.  DEVTEN is cleared as part of gadget stop, so the intention to
> allow ep0 events to continue while waiting for controller halt is not
> happening.
> 
> Fixes: c96683798e27 ("usb: dwc3: ep0: Don't prepare beyond Setup stage")
> Signed-off-by: Wesley Cheng <quic_wcheng@...cinc.com>
> ---
>  drivers/usb/dwc3/gadget.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 91768f1bdbaf..9715de8e99bc 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -2566,7 +2566,6 @@ static int dwc3_gadget_soft_disconnect(struct dwc3 *dwc)
>  	 * bit.
>  	 */
>  	dwc3_stop_active_transfers(dwc);
> -	__dwc3_gadget_stop(dwc);
>  	spin_unlock_irqrestore(&dwc->lock, flags);
>  
>  	/*
> @@ -2596,7 +2595,19 @@ static int dwc3_gadget_soft_disconnect(struct dwc3 *dwc)
>  	 * remaining event generated by the controller while polling for
>  	 * DSTS.DEVCTLHLT.
>  	 */
> -	return dwc3_gadget_run_stop(dwc, false, false);
> +	ret = dwc3_gadget_run_stop(dwc, false, false);
> +
> +	/*
> +	 * Stop the gadget after controller is halted, so that if needed, the
> +	 * events to update EP0 state can still occur while the run/stop
> +	 * routine polls for the halted state.  DEVTEN is cleared as part of
> +	 * gadget stop.
> +	 */
> +	spin_lock_irqsave(&dwc->lock, flags);
> +	__dwc3_gadget_stop(dwc);
> +	spin_unlock_irqrestore(&dwc->lock, flags);
> +
> +	return ret;
>  }
>  
>  static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)

Acked-by: Thinh Nguyen <Thinh.Nguyen@...opsys.com>

Thanks,
Thinh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ