lkml.org 
[lkml]   [2021]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 25/25] media: i2c: ccs-core: fix pm_runtime_get_sync() usage count
On Wed, 5 May 2021 16:06:45 +0200
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote:

> Hi Jonathan,
>
> Em Wed, 5 May 2021 13:35:48 +0100
> Jonathan Cameron <Jonathan.Cameron@Huawei.com> escreveu:
>
> > > > [PATCH] media: i2c: ccs-core: fix pm_runtime_get_sync() usage count
> > > >
> > > > The pm_runtime_get_sync() internally increments the
> > > > dev->power.usage_count without decrementing it, even on errors.
> > > >
> > > > There is a bug at ccs_pm_get_init(): when this function returns
> > > > an error, the stream is not started, and RPM usage_count
> > > > should not be incremented. However, if the calls to
> > > > v4l2_ctrl_handler_setup() return errors, it will be kept
> > > > incremented.
> > > >
> > > > At ccs_suspend() the best is to replace it by the new
> > > > pm_runtime_resume_and_get(), introduced by:
> > > > commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
> > > > in order to properly decrement the usage counter automatically,
> > > > in the case of errors.
> > > >
> > > > Fixes: 96e3a6b92f23 ("media: smiapp: Avoid maintaining power state information")
> > > > Cc: stable@vger.kernel.org
> > > > Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Per Sakari's request (for practical reasons on backporting and
> c/c stable), this was split into two separate patches, one
> fixing the issues, and a separate trivial one with just the
> pm_runtime_resume_and_get(). I'm adding your RB on both.
Makes sense.

Jonathan

>
> Thanks,
> Mauro

\
 
 \ /
  Last update: 2021-05-05 18:41    [W:0.085 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site