DriverDev-Devel Archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Cc: devel@driverdev.osuosl.org,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linuxarm@huawei.com, linux-kernel@vger.kernel.org,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	mauro.chehab@huawei.com, Bingbu Cao <bingbu.cao@intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Tianshu Qiu <tian.shu.qiu@intel.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH v4 23/79] staging: media: ipu3: use pm_runtime_resume_and_get()
Date: Mon, 3 May 2021 11:57:15 +0200	[thread overview]
Message-ID: <YI/I+ztnoNUr+u1T@hovoldconsulting.com> (raw)
In-Reply-To: <20210430180338.00006e62@Huawei.com>

On Fri, Apr 30, 2021 at 06:03:38PM +0100, Jonathan Cameron wrote:
> On Wed, 28 Apr 2021 16:51:44 +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>
> Could add that pm_runtime_put() should have been pm_runtime_put_noidle()
> inorder to not potentially result in a call to runtime suspend when
> we never resumed in the first place.

No, that would never happen anyway and any pm_runtime_put() will do
even if pm_runtime_put_noidle() is the natural choice in this case to
balance the counter.

> Otherwise reasonable cleanup.
> 
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> > ---
> >  drivers/staging/media/ipu3/ipu3.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/media/ipu3/ipu3.c b/drivers/staging/media/ipu3/ipu3.c
> > index ee1bba6bdcac..8e1e9e46e604 100644
> > --- a/drivers/staging/media/ipu3/ipu3.c
> > +++ b/drivers/staging/media/ipu3/ipu3.c
> > @@ -392,10 +392,9 @@ int imgu_s_stream(struct imgu_device *imgu, int enable)
> >  	}
> >  
> >  	/* Set Power */
> > -	r = pm_runtime_get_sync(dev);
> > +	r = pm_runtime_resume_and_get(dev);
> >  	if (r < 0) {
> >  		dev_err(dev, "failed to set imgu power\n");
> > -		pm_runtime_put(dev);
> >  		return r;
> >  	}

Johan
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2021-05-03  9:57 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 14:51 [PATCH v4 00/79] Address some issues with PM runtime at media subsystem Mauro Carvalho Chehab
2021-04-28 14:51 ` [PATCH v4 20/79] staging: media: rkvdec: fix pm_runtime_get_sync() usage count Mauro Carvalho Chehab
2021-04-28 15:09   ` Johan Hovold
2021-04-29  7:38     ` Mauro Carvalho Chehab
2021-04-28 14:51 ` [PATCH v4 21/79] staging: media: atomisp: use pm_runtime_resume_and_get() Mauro Carvalho Chehab
2021-04-30 16:59   ` Jonathan Cameron
2021-04-28 14:51 ` [PATCH v4 22/79] staging: media: imx7-mipi-csis: " Mauro Carvalho Chehab
2021-04-28 14:51 ` [PATCH v4 23/79] staging: media: ipu3: " Mauro Carvalho Chehab
2021-04-30 17:03   ` Jonathan Cameron
2021-05-03  9:57     ` Johan Hovold [this message]
2021-04-28 14:51 ` [PATCH v4 24/79] staging: media: cedrus_video: " Mauro Carvalho Chehab
2021-04-30 17:05   ` Jonathan Cameron
2021-04-28 14:51 ` [PATCH v4 25/79] staging: media: tegra-vde: " Mauro Carvalho Chehab
2021-04-29 12:38   ` Dmitry Osipenko
2021-04-30 17:08   ` Jonathan Cameron
2021-04-30 17:11     ` Jonathan Cameron
2021-04-28 14:51 ` [PATCH v4 26/79] staging: media: tegra-video: " Mauro Carvalho Chehab
2021-04-30 17:13   ` Jonathan Cameron
2021-04-28 14:52 ` [PATCH v4 78/79] media: hantro: " Mauro Carvalho Chehab
2021-04-28 17:14   ` Ezequiel Garcia
2021-04-30 18:09   ` Jonathan Cameron
2021-04-28 14:52 ` [PATCH v4 79/79] media: hantro: do a PM resume earlier Mauro Carvalho Chehab
2021-04-28 17:17   ` Ezequiel Garcia
2021-04-29  7:13     ` Mauro Carvalho Chehab
2021-04-28 15:50 ` [PATCH v4 00/79] Address some issues with PM runtime at media subsystem Johan Hovold
2021-04-29 10:18   ` Mauro Carvalho Chehab
2021-04-29 12:33     ` Dmitry Osipenko
2021-04-29 15:17     ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YI/I+ztnoNUr+u1T@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=bingbu.cao@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mauro.chehab@huawei.com \
    --cc=mchehab+huawei@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tian.shu.qiu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).