Re: [PATCH 2/2] usb: dwc3: core: allow device to runtime_suspend several times

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2 Aug 2016, Felipe Balbi wrote:

> After going through runtime_suspend/runtime_resume
> cycle once we would be left with an unbalanced
> pm_runtime_get() call. Fix that by making sure that
> we try to suspend right after resuming so things are
> balanced and device can runtime_suspend again.
> 
> Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>
> ---
>  drivers/usb/dwc3/core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 946643157b78..35d092456bec 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1192,6 +1192,7 @@ static int dwc3_runtime_resume(struct device *dev)
>  	}
>  
>  	pm_runtime_mark_last_busy(dev);
> +	pm_runtime_put(dev);
>  
>  	return 0;
>  }

This may be correct, but it certainly looks odd.  For example, it 
wouldn't work right if you ever called pm_runtime_resume() instead of 
pm_runtime_get().

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux