Re: [PATCH v3 1/2] PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter

2020-11-30 Thread Rafael J. Wysocki
On Mon, Nov 30, 2020 at 7:50 PM Laurent Pinchart wrote: > > Hi Rafael, > > On Mon, Nov 30, 2020 at 06:55:57PM +0100, Rafael J. Wysocki wrote: > > On Mon, Nov 30, 2020 at 6:35 PM Laurent Pinchart wrote: > > > On Mon, Nov 30, 2020 at 05:37:52PM +0100, Rafael J. Wysocki wrote: > > > > On Fri, Nov 27,

Re: [PATCH v3 1/2] PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter

2020-11-30 Thread Laurent Pinchart
Hi Rafael, On Mon, Nov 30, 2020 at 06:55:57PM +0100, Rafael J. Wysocki wrote: > On Mon, Nov 30, 2020 at 6:35 PM Laurent Pinchart wrote: > > On Mon, Nov 30, 2020 at 05:37:52PM +0100, Rafael J. Wysocki wrote: > > > On Fri, Nov 27, 2020 at 11:16 AM Geert Uytterhoeven wrote: > > > > On Tue, Nov 10, 20

Re: [PATCH v3 1/2] PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter

2020-11-30 Thread Rafael J. Wysocki
On Mon, Nov 30, 2020 at 6:35 PM Laurent Pinchart wrote: > > On Mon, Nov 30, 2020 at 05:37:52PM +0100, Rafael J. Wysocki wrote: > > On Fri, Nov 27, 2020 at 11:16 AM Geert Uytterhoeven wrote: > > > On Tue, Nov 10, 2020 at 10:29 AM Zhang Qilong > > > wrote: > > > > In many case, we need to check re

Re: [PATCH v3 1/2] PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter

2020-11-30 Thread Laurent Pinchart
On Mon, Nov 30, 2020 at 05:37:52PM +0100, Rafael J. Wysocki wrote: > On Fri, Nov 27, 2020 at 11:16 AM Geert Uytterhoeven wrote: > > On Tue, Nov 10, 2020 at 10:29 AM Zhang Qilong > > wrote: > > > In many case, we need to check return value of pm_runtime_get_sync, but > > > it brings a trouble to t

Re: [PATCH v3 1/2] PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter

2020-11-30 Thread Rafael J. Wysocki
On Fri, Nov 27, 2020 at 11:16 AM Geert Uytterhoeven wrote: > > Hi Zhang, > > On Tue, Nov 10, 2020 at 10:29 AM Zhang Qilong wrote: > > In many case, we need to check return value of pm_runtime_get_sync, but > > it brings a trouble to the usage counter processing. Many callers forget > > to decreas

Re: [PATCH v3 1/2] PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter

2020-11-27 Thread Geert Uytterhoeven
Hi Zhang, On Tue, Nov 10, 2020 at 10:29 AM Zhang Qilong wrote: > In many case, we need to check return value of pm_runtime_get_sync, but > it brings a trouble to the usage counter processing. Many callers forget > to decrease the usage counter when it failed, which could resulted in > reference l

Re: [PATCH v3 1/2] PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter

2020-11-16 Thread Rafael J. Wysocki
On Tue, Nov 10, 2020 at 10:25 AM Zhang Qilong wrote: > > In many case, we need to check return value of pm_runtime_get_sync, but > it brings a trouble to the usage counter processing. Many callers forget > to decrease the usage counter when it failed, which could resulted in > reference leak. It h

Re: [PATCH v3 1/2] PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter

2020-11-13 Thread Jakub Kicinski
On Tue, 10 Nov 2020 17:29:32 +0800 Zhang Qilong wrote: > In many case, we need to check return value of pm_runtime_get_sync, but > it brings a trouble to the usage counter processing. Many callers forget > to decrease the usage counter when it failed, which could resulted in > reference leak. It ha

[PATCH v3 1/2] PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter

2020-11-10 Thread Zhang Qilong
In many case, we need to check return value of pm_runtime_get_sync, but it brings a trouble to the usage counter processing. Many callers forget to decrease the usage counter when it failed, which could resulted in reference leak. It has been discussed a lot[0][1]. So we add a function to deal with