Re: [PATCH] [v2] PCI: tegra194: Fix runtime PM imbalance on error

2020-05-29 Thread Lorenzo Pieralisi
On Thu, May 21, 2020 at 11:13:49AM +0800, Dinghao Liu wrote: > pm_runtime_get_sync() increments the runtime PM usage counter even > when it returns an error code. Thus a pairing decrement is needed on > the error handling path to keep the counter balanced. > > Signed-off-by: Dinghao Liu > --- >

Re: Re: [PATCH] [v2] PCI: tegra194: Fix runtime PM imbalance on error

2020-05-22 Thread dinghao . liu
> On Thu, May 21, 2020 at 5:16 PM Bjorn Helgaas wrote: > > > > [+cc Rafael, linux-pm] > > > > On Thu, May 21, 2020 at 11:13:49AM +0800, Dinghao Liu wrote: > > > pm_runtime_get_sync() increments the runtime PM usage counter even > > > when it returns an error code. Thus a pairing decrement is

Re: Re: [PATCH] [v2] PCI: tegra194: Fix runtime PM imbalance on error

2020-05-21 Thread dinghao . liu
Hi Bjorn, In fact, most usage of pm_runtime_get_sync() is correct. I made a static analysis tool to check this imbalance in kernel and found about 80 bugs in dirvers. Some of my patches have been accepted and I'm trying to patch the rest as soon as possible. Regards, Dinghao > [+cc Rafael,

Re: [PATCH] [v2] PCI: tegra194: Fix runtime PM imbalance on error

2020-05-21 Thread Rafael J. Wysocki
On Thu, May 21, 2020 at 5:16 PM Bjorn Helgaas wrote: > > [+cc Rafael, linux-pm] > > On Thu, May 21, 2020 at 11:13:49AM +0800, Dinghao Liu wrote: > > pm_runtime_get_sync() increments the runtime PM usage counter even > > when it returns an error code. Thus a pairing decrement is needed on > > the

Re: [PATCH] [v2] PCI: tegra194: Fix runtime PM imbalance on error

2020-05-21 Thread Bjorn Helgaas
[+cc Rafael, linux-pm] On Thu, May 21, 2020 at 11:13:49AM +0800, Dinghao Liu wrote: > pm_runtime_get_sync() increments the runtime PM usage counter even > when it returns an error code. Thus a pairing decrement is needed on > the error handling path to keep the counter balanced. I didn't realize