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

Message ID 20230404072524.19014-4-johan+linaro@kernel.org
State New
Headers
Series USB: dwc3: error handling fixes and cleanups |

Commit Message

Johan Hovold April 4, 2023, 7:25 a.m. UTC
  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(+)
  

Comments

Thinh Nguyen April 11, 2023, 1:17 a.m. UTC | #1
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
  

Patch

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);