[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210410010631.GA3862@b29397-desktop>
Date: Sat, 10 Apr 2021 09:06:31 +0800
From: Peter Chen <peter.chen@...nel.org>
To: Dinghao Liu <dinghao.liu@....edu.cn>
Cc: kjlu@....edu, Pawel Laszczak <pawell@...ence.com>,
Roger Quadros <rogerq@...nel.org>,
Aswath Govindraju <a-govindraju@...com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: cdns3: Fix rumtime PM imbalance on error
On 21-04-07 13:22:26, Dinghao Liu wrote:
> When cdns3_gadget_start() fails, a pairing PM usage counter
> decrement is needed to keep the counter balanced.
>
> Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
> ---
> drivers/usb/cdns3/cdns3-gadget.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
> index 582bfeceedb4..ad891a108aed 100644
> --- a/drivers/usb/cdns3/cdns3-gadget.c
> +++ b/drivers/usb/cdns3/cdns3-gadget.c
> @@ -3255,8 +3255,11 @@ static int __cdns3_gadget_init(struct cdns *cdns)
> pm_runtime_get_sync(cdns->dev);
>
> ret = cdns3_gadget_start(cdns);
> - if (ret)
> + if (ret) {
> + pm_runtime_mark_last_busy(cdns->dev);
> + pm_runtime_put_autosuspend(cdns->dev);
> return ret;
It doesn't need to delay entering runtime suspend, I prefer using pm_runtime_put_sync directly.
--
Thanks,
Peter Chen
Powered by blists - more mailing lists