[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <58e92f05.49985.178c4939c14.Coremail.dinghao.liu@zju.edu.cn>
Date: Mon, 12 Apr 2021 13:35:11 +0800 (GMT+08:00)
From: dinghao.liu@....edu.cn
To: "Peter Chen" <peter.chen@...nel.org>
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: 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.
>
Sounds reasonable, thanks! I will send a new patch soon.
Regards,
Dinghao
Powered by blists - more mailing lists