[PATCH 03/11] USB: dwc3: disable autosuspend on unbind

Johan Hovold posted 11 patches 2 years, 10 months ago
[PATCH 03/11] USB: dwc3: disable autosuspend on unbind
Posted by Johan Hovold 2 years, 10 months ago
Add the missing calls to disable autosuspend on probe errors and on
driver unbind.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 drivers/usb/dwc3/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 9f8c988c25cb..5b362ed43e7e 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1954,6 +1954,7 @@ static int dwc3_probe(struct platform_device *pdev)
 err2:
 	pm_runtime_allow(dev);
 	pm_runtime_disable(dev);
+	pm_runtime_dont_use_autosuspend(dev);
 	pm_runtime_set_suspended(dev);
 	pm_runtime_put_noidle(dev);
 disable_clks:
@@ -1981,6 +1982,7 @@ static int dwc3_remove(struct platform_device *pdev)
 
 	pm_runtime_allow(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
+	pm_runtime_dont_use_autosuspend(&pdev->dev);
 	pm_runtime_put_noidle(&pdev->dev);
 	pm_runtime_set_suspended(&pdev->dev);
 
-- 
2.39.2
Re: [PATCH 03/11] USB: dwc3: disable autosuspend on unbind
Posted by Thinh Nguyen 2 years, 10 months ago
On Tue, Apr 04, 2023, Johan Hovold wrote:
> Add the missing calls to disable autosuspend on probe errors and on
> driver unbind.
> 
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> ---
>  drivers/usb/dwc3/core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 9f8c988c25cb..5b362ed43e7e 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1954,6 +1954,7 @@ static int dwc3_probe(struct platform_device *pdev)
>  err2:
>  	pm_runtime_allow(dev);
>  	pm_runtime_disable(dev);
> +	pm_runtime_dont_use_autosuspend(dev);
>  	pm_runtime_set_suspended(dev);
>  	pm_runtime_put_noidle(dev);
>  disable_clks:
> @@ -1981,6 +1982,7 @@ static int dwc3_remove(struct platform_device *pdev)
>  
>  	pm_runtime_allow(&pdev->dev);
>  	pm_runtime_disable(&pdev->dev);
> +	pm_runtime_dont_use_autosuspend(&pdev->dev);
>  	pm_runtime_put_noidle(&pdev->dev);
>  	pm_runtime_set_suspended(&pdev->dev);
>  
> -- 
> 2.39.2
> 

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

Thanks,
Thinh