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] [day] [month] [year] [list]
Message-ID: <f96eae5d-3210-f071-50cc-2f38104e5ab5@synopsys.com>
Date:   Thu, 8 Apr 2021 13:41:05 +0000
From:   Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>
To:     Artur Petrosyan <Arthur.Petrosyan@...opsys.com>,
        Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:     John Youn <John.Youn@...opsys.com>
Subject: Re: [PATCH v3 14/14] usb: dwc2: Add exit partial power down before
 removing driver

On 4/8/2021 1:46 PM, Artur Petrosyan wrote:
> When dwc2 core is in partial power down mode
> loading driver again causes driver fail. Because in
> that mode registers are not accessible.
> 
> Added a flow of exiting the partial power down mode
> to avoid the driver reload failure.
> 
> Signed-off-by: Artur Petrosyan <Arthur.Petrosyan@...opsys.com>

Acked-by: Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>

> ---
>   Changes in v3:
>   - None
>   Changes in v2:
>   - None
> 
>   drivers/usb/dwc2/platform.c | 11 ++++++++++-
>   1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index 5f18acac7406..b28b8cd45799 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -316,6 +316,15 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
>   static int dwc2_driver_remove(struct platform_device *dev)
>   {
>   	struct dwc2_hsotg *hsotg = platform_get_drvdata(dev);
> +	int ret = 0;
> +
> +	/* Exit Partial Power Down when driver is removed. */
> +	if (hsotg->in_ppd) {
> +		ret = dwc2_exit_partial_power_down(hsotg, 0, true);
> +		if (ret)
> +			dev_err(hsotg->dev,
> +				"exit partial_power_down failed\n");
> +	}
>   
>   	dwc2_debugfs_exit(hsotg);
>   	if (hsotg->hcd_enabled)
> @@ -334,7 +343,7 @@ static int dwc2_driver_remove(struct platform_device *dev)
>   	reset_control_assert(hsotg->reset);
>   	reset_control_assert(hsotg->reset_ecc);
>   
> -	return 0;
> +	return ret;
>   }
>   
>   /**
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ