From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: <linuxarm@huawei.com>, <mauro.chehab@huawei.com>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
Stanimir Varbanov <stanimir.varbanov@linaro.org>,
<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-media@vger.kernel.org>
Subject: Re: [PATCH v4 67/79] media: venus: vdec: use pm_runtime_resume_and_get()
Date: Fri, 30 Apr 2021 18:53:52 +0100 [thread overview]
Message-ID: <20210430185352.00003b27@Huawei.com> (raw)
In-Reply-To: <8541040c4b0830bb2c2f015b8c26c890baa5918a.1619621413.git.mchehab+huawei@kernel.org>
On Wed, 28 Apr 2021 16:52:28 +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>
> ---
> drivers/media/platform/qcom/venus/vdec.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index ddb7cd39424e..347e533ea673 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -568,7 +568,7 @@ static int vdec_pm_get(struct venus_inst *inst)
> int ret;
>
> mutex_lock(&core->pm_lock);
> - ret = pm_runtime_get_sync(dev);
> + ret = pm_runtime_resume_and_get(dev);
> mutex_unlock(&core->pm_lock);
>
> return ret < 0 ? ret : 0;
Don't need this dance any more due to " Return 0 if the runtime PM usage counter of @dev has been
* incremented or a negative error code otherwise."
return ret;
> @@ -601,7 +601,7 @@ static int vdec_pm_get_put(struct venus_inst *inst)
> mutex_lock(&core->pm_lock);
>
> if (pm_runtime_suspended(dev)) {
> - ret = pm_runtime_get_sync(dev);
> + ret = pm_runtime_resume_and_get(dev);
> if (ret < 0)
> goto error;
>
next prev parent reply other threads:[~2021-04-30 17:55 UTC|newest]
Thread overview: 13+ 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 01/79] media: venus: fix PM runtime logic at venus_sys_error_handler() Mauro Carvalho Chehab
2021-04-30 15:21 ` Jonathan Cameron
2021-05-03 9:00 ` Mauro Carvalho Chehab
2021-04-28 14:52 ` [PATCH v4 65/79] media: camss: use pm_runtime_resume_and_get() Mauro Carvalho Chehab
2021-04-28 14:52 ` [PATCH v4 66/79] media: venus: " Mauro Carvalho Chehab
2021-04-28 14:52 ` [PATCH v4 67/79] media: venus: vdec: " Mauro Carvalho Chehab
2021-04-30 17:53 ` Jonathan Cameron [this message]
2021-04-28 14:52 ` [PATCH v4 68/79] media: venus: venc: " 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=20210430185352.00003b27@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=linux-arm-msm@vger.kernel.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=stanimir.varbanov@linaro.org \
/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 NNTP newsgroup(s).