Message ID | a2056fdad3cd3d87b5e9653dc18deca83bb554c2.1620207353.git.mchehab+huawei@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Fix some PM runtime issues at the media subsystem | expand |
On Wed, 5 May 2021 11:42:10 +0200 Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote: > Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") > added pm_runtime_resume_and_get() in order to automatically handle > dev->power.usage_count decrement on errors. > > Use the new API, in order to cleanup the error check logic. > > Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Trivial thing inline otherwise fine. > --- > drivers/media/platform/sti/delta/delta-v4l2.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/media/platform/sti/delta/delta-v4l2.c b/drivers/media/platform/sti/delta/delta-v4l2.c > index c691b3d81549..064a00a3084a 100644 > --- a/drivers/media/platform/sti/delta/delta-v4l2.c > +++ b/drivers/media/platform/sti/delta/delta-v4l2.c > @@ -954,10 +954,8 @@ static void delta_run_work(struct work_struct *work) > /* enable the hardware */ > if (!dec->pm) { > ret = delta_get_sync(ctx); > - if (ret) { > - delta_put_autosuspend(ctx); > + if (ret) > goto err; > - } > } > > /* decode this access unit */ > @@ -1277,9 +1275,9 @@ int delta_get_sync(struct delta_ctx *ctx) > int ret = 0; Loose the init > > /* enable the hardware */ > - ret = pm_runtime_get_sync(delta->dev); > + ret = pm_runtime_resume_and_get(delta->dev); > if (ret < 0) { > - dev_err(delta->dev, "%s pm_runtime_get_sync failed (%d)\n", > + dev_err(delta->dev, "%s pm_runtime_resume_and_get failed (%d)\n", > __func__, ret); > return ret; > }
On Wed, 5 May 2021 13:01:58 +0100 Jonathan Cameron <Jonathan.Cameron@Huawei.com> wrote: > On Wed, 5 May 2021 11:42:10 +0200 > Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote: > > > Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") > > added pm_runtime_resume_and_get() in order to automatically handle > > dev->power.usage_count decrement on errors. > > > > Use the new API, in order to cleanup the error check logic. > > > > Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> > Trivial thing inline otherwise fine. > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > > --- > > drivers/media/platform/sti/delta/delta-v4l2.c | 8 +++----- > > 1 file changed, 3 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/media/platform/sti/delta/delta-v4l2.c b/drivers/media/platform/sti/delta/delta-v4l2.c > > index c691b3d81549..064a00a3084a 100644 > > --- a/drivers/media/platform/sti/delta/delta-v4l2.c > > +++ b/drivers/media/platform/sti/delta/delta-v4l2.c > > @@ -954,10 +954,8 @@ static void delta_run_work(struct work_struct *work) > > /* enable the hardware */ > > if (!dec->pm) { > > ret = delta_get_sync(ctx); > > - if (ret) { > > - delta_put_autosuspend(ctx); > > + if (ret) > > goto err; > > - } > > } > > > > /* decode this access unit */ > > @@ -1277,9 +1275,9 @@ int delta_get_sync(struct delta_ctx *ctx) > > int ret = 0; > > Loose the init > > > > > /* enable the hardware */ > > - ret = pm_runtime_get_sync(delta->dev); > > + ret = pm_runtime_resume_and_get(delta->dev); > > if (ret < 0) { > > - dev_err(delta->dev, "%s pm_runtime_get_sync failed (%d)\n", > > + dev_err(delta->dev, "%s pm_runtime_resume_and_get failed (%d)\n", > > __func__, ret); > > return ret; > > } >
diff --git a/drivers/media/platform/sti/delta/delta-v4l2.c b/drivers/media/platform/sti/delta/delta-v4l2.c index c691b3d81549..064a00a3084a 100644 --- a/drivers/media/platform/sti/delta/delta-v4l2.c +++ b/drivers/media/platform/sti/delta/delta-v4l2.c @@ -954,10 +954,8 @@ static void delta_run_work(struct work_struct *work) /* enable the hardware */ if (!dec->pm) { ret = delta_get_sync(ctx); - if (ret) { - delta_put_autosuspend(ctx); + if (ret) goto err; - } } /* decode this access unit */ @@ -1277,9 +1275,9 @@ int delta_get_sync(struct delta_ctx *ctx) int ret = 0; /* enable the hardware */ - ret = pm_runtime_get_sync(delta->dev); + ret = pm_runtime_resume_and_get(delta->dev); if (ret < 0) { - dev_err(delta->dev, "%s pm_runtime_get_sync failed (%d)\n", + dev_err(delta->dev, "%s pm_runtime_resume_and_get failed (%d)\n", __func__, ret); return ret; }
Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") added pm_runtime_resume_and_get() in order to automatically handle dev->power.usage_count decrement on errors. Use the new API, in order to cleanup the error check logic. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> --- drivers/media/platform/sti/delta/delta-v4l2.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)