All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe
@ 2020-11-23 14:57 Zhang Qilong
  2020-11-23 15:15 ` Alan Stern
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Qilong @ 2020-11-23 14:57 UTC (permalink / raw)
  To: stern, gregkh; +Cc: linux-usb

The pm_runtime_enable will increase power disable depth. Imbalance
depth will resulted in enabling runtime PM of device fails later.
Thus a pairing decrement must be needed on the error handling path
to keep it balanced.

Fixes: 6c984b066d84b ("ARM: OMAP: USBHOST: Replace usbhs core driver APIs by Runtime pm APIs")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/usb/host/ehci-omap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 8771a2ed6926..7f4a03e8647a 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -220,6 +220,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 
 err_pm_runtime:
 	pm_runtime_put_sync(dev);
+	pm_runtime_disable(dev);
 
 err_phy:
 	for (i = 0; i < omap->nports; i++) {
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe
  2020-11-23 14:57 [PATCH] usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe Zhang Qilong
@ 2020-11-23 15:15 ` Alan Stern
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2020-11-23 15:15 UTC (permalink / raw)
  To: Zhang Qilong; +Cc: gregkh, linux-usb

On Mon, Nov 23, 2020 at 10:57:19PM +0800, Zhang Qilong wrote:
> The pm_runtime_enable will increase power disable depth. Imbalance

That's backward.  pm_runtime_enable _decrements_ the power-disable 
depth.

> depth will resulted in enabling runtime PM of device fails later.
> Thus a pairing decrement must be needed on the error handling path
> to keep it balanced.
> 
> Fixes: 6c984b066d84b ("ARM: OMAP: USBHOST: Replace usbhs core driver APIs by Runtime pm APIs")
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> ---
>  drivers/usb/host/ehci-omap.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> index 8771a2ed6926..7f4a03e8647a 100644
> --- a/drivers/usb/host/ehci-omap.c
> +++ b/drivers/usb/host/ehci-omap.c
> @@ -220,6 +220,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
>  
>  err_pm_runtime:
>  	pm_runtime_put_sync(dev);
> +	pm_runtime_disable(dev);
>  
>  err_phy:
>  	for (i = 0; i < omap->nports; i++) {

Apart from that one typo,

Acked-by: Alan Stern <stern@rowland.harvard.edu>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-23 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 14:57 [PATCH] usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe Zhang Qilong
2020-11-23 15:15 ` Alan Stern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.