Re: Re: [PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe

2020-06-08 Thread Laurent Pinchart
Hi Geert, On Mon, Jun 08, 2020 at 09:39:51AM +0200, Geert Uytterhoeven wrote: > Hi Dinghao, > > On Mon, Jun 8, 2020 at 5:03 AM wrote: > > > > I wonder how many bugs we have today, and how many bugs will keep > > > > appearing in the future, due to this historical design mistake :-( > > > > Good

Re: Re: [PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe

2020-06-08 Thread Geert Uytterhoeven
Hi Dinghao, On Mon, Jun 8, 2020 at 5:03 AM wrote: > > > I wonder how many bugs we have today, and how many bugs will keep > > > appearing in the future, due to this historical design mistake :-( > > Good question. It's hard to say if this is a design mistake (some use > of this API does not check

Re: Re: Re: [PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe

2020-06-07 Thread dinghao . liu
> > The vsp1_probe() function has a struct vsp1_device whose dev field is > populated by the time it needs to call pm_runtime_get_sync() and > pm_runtime_get_put(), so I think you can use vsp1_device_get() and > vsp1_device_put() as drop-in replacements without changing the > parameters to these

Re: Re: [PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe

2020-06-07 Thread Laurent Pinchart
Hi Dianghao, On Mon, Jun 08, 2020 at 11:03:26AM +0800, dinghao@zju.edu.cn wrote: > Hi Laurent, > > > > I wonder how many bugs we have today, and how many bugs will keep > > > appearing in the future, due to this historical design mistake :-( > > Good question. It's hard to say if this is a

Re: Re: [PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe

2020-06-07 Thread dinghao . liu
Hi Laurent, > > > > I wonder how many bugs we have today, and how many bugs will keep > > appearing in the future, due to this historical design mistake :-( > > Good question. It's hard to say if this is a design mistake (some use of this API does not check its return value and expects it alwa

Re: [PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe

2020-06-07 Thread Laurent Pinchart
On Mon, Jun 08, 2020 at 04:54:57AM +0300, Laurent Pinchart wrote: > Hi Dinghao, > > Thank you for the patch. > > On Sat, May 23, 2020 at 07:54:26PM +0800, Dinghao Liu wrote: > > pm_runtime_get_sync() increments the runtime PM usage counter even > > when it returns an error code. Thus a pairing de

Re: [PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe

2020-06-07 Thread Laurent Pinchart
Hi Dinghao, Thank you for the patch. On Sat, May 23, 2020 at 07:54:26PM +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

[PATCH] media: vsp1: Fix runtime PM imbalance in vsp1_probe

2020-05-23 Thread Dinghao Liu
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 --- drivers/media/platform/vsp1/vsp1_drv.c | 4 +++- 1 file changed, 3 insertio