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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b16e1ea-b8bb-b3fd-29ce-a997579f92eb@gmail.com>
Date:   Thu, 15 Apr 2021 12:12:13 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...il.com>
To:     Artur Petrosyan <Arthur.Petrosyan@...opsys.com>,
        Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     John Youn <John.Youn@...opsys.com>
Subject: Re: [PATCH 10/15] usb: dwc2: Allow exit hibernation in urb enqueue

On 15.04.2021 8:40, Artur Petrosyan wrote:

> When core is in hibernation state and an external
> hub is connected, upper layer sends URB enqueue request,
> which results in port reset issue.
> 
> - Added exit from hibernation state to avoid port
> reset issue and process upper layer request properly.
> 
> Signed-off-by: Artur Petrosyan <Arthur.Petrosyan@...opsys.com>
> ---
>   drivers/usb/dwc2/hcd.c | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
> index cc9ad6cf02d9..3b03b2d73aaa 100644
> --- a/drivers/usb/dwc2/hcd.c
> +++ b/drivers/usb/dwc2/hcd.c
> @@ -4631,12 +4631,29 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
>   	struct dwc2_qh *qh;
>   	bool qh_allocated = false;
>   	struct dwc2_qtd *qtd;
> +	struct dwc2_gregs_backup *gr;
> +
> +	gr = &hsotg->gr_backup;
>   
>   	if (dbg_urb(urb)) {
>   		dev_vdbg(hsotg->dev, "DWC OTG HCD URB Enqueue\n");
>   		dwc2_dump_urb_info(hcd, urb, "urb_enqueue");
>   	}
>   
> +	if (hsotg->hibernated) {
> +		if (gr->gotgctl & GOTGCTL_CURMODE_HOST) {
> +			retval = dwc2_exit_hibernation(hsotg, 0, 0, 1);
> +			if (retval)
> +				dev_err(hsotg->dev,
> +					"exit hibernation failed.\n");
> +		} else {
> +			retval = dwc2_exit_hibernation(hsotg, 0, 0, 0);
> +			if (retval)
> +				dev_err(hsotg->dev,
> +					"exit hibernation failed.\n");

    Why not put these identical *if*s outside the the outer *if*?


> +		}
> +	}
> +
>   	if (hsotg->in_ppd) {
>   		retval = dwc2_exit_partial_power_down(hsotg, 0, true);
>   		if (retval)

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ