From: Dmitry Osipenko <digetx@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, linux-tegra@vger.kernel.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/4] media: staging: tegra-vde: Balance runtime PM use-count on resume failure
Date: Wed, 24 Jun 2020 18:08:44 +0300 [thread overview]
Message-ID: <20200624150847.22672-2-digetx@gmail.com> (raw)
In-Reply-To: <20200624150847.22672-1-digetx@gmail.com>
The RPM's use-count is getting incremented regardless of the
pm_runtime_get_sync() success or fail. It's up to a driver how to
handle the failed RPM. In the case of VDE driver, the RPM's use-count
should be restored if runtime-resume fails. Use pm_runtime_put_noidle(),
which is the most straight-forward variant to balance the RPM, confirmed
by Rafael J. Wysocki.
Link: https://lore.kernel.org/linux-i2c/CAJZ5v0i87NGcy9+kxubScdPDyByr8ypQWcGgBFn+V-wDd69BHQ@mail.gmail.com/
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
drivers/staging/media/tegra-vde/vde.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
index d3e63512a765..803e5dda4bb5 100644
--- a/drivers/staging/media/tegra-vde/vde.c
+++ b/drivers/staging/media/tegra-vde/vde.c
@@ -776,8 +776,10 @@ static int tegra_vde_ioctl_decode_h264(struct tegra_vde *vde,
goto release_dpb_frames;
ret = pm_runtime_get_sync(dev);
- if (ret < 0)
+ if (ret < 0) {
+ pm_runtime_put_noidle(dev);
goto unlock;
+ }
/*
* We rely on the VDE registers reset value, otherwise VDE
--
2.26.0
next prev parent reply other threads:[~2020-06-24 15:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 15:08 [PATCH v2 0/4] Tegra Video Decoder driver power management corrections Dmitry Osipenko
2020-06-24 15:08 ` Dmitry Osipenko
2020-06-24 15:08 ` Dmitry Osipenko [this message]
2020-06-24 15:08 ` [PATCH v2 3/4] media: staging: tegra-vde: Turn ON power domain on shutdown Dmitry Osipenko
2020-06-26 7:43 ` Thierry Reding
2020-06-24 15:08 ` [PATCH v2 4/4] media: staging: tegra-vde: Power-cycle hardware on probe Dmitry Osipenko
2020-06-26 7:48 ` Thierry Reding
2020-06-26 13:42 ` Dmitry Osipenko
[not found] ` <20200624150847.22672-1-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-24 15:08 ` [PATCH v2 2/4] media: staging: tegra-vde: Runtime PM is always available on Tegra Dmitry Osipenko
2020-06-24 15:08 ` Dmitry Osipenko
[not found] ` <20200624150847.22672-3-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-26 7:44 ` Thierry Reding
2020-06-26 7:44 ` Thierry Reding
2020-06-24 15:16 ` [PATCH v2 0/4] Tegra Video Decoder driver power management corrections Hans Verkuil
2020-06-24 15:16 ` Hans Verkuil
[not found] ` <90323aa6-38b5-0a45-69a7-ccf380690a78-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
2020-06-24 15:23 ` Dmitry Osipenko
2020-06-24 15:23 ` Dmitry Osipenko
[not found] ` <23cbaa18-9461-8f72-3d43-aa14cd0c1095-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-26 0:17 ` Dmitry Osipenko
2020-06-26 0:17 ` Dmitry Osipenko
2020-06-26 6:58 ` Hans Verkuil
[not found] ` <e41ff660-6c6c-d603-c767-34e7f4b4a23d-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
2020-06-26 13:23 ` Dmitry Osipenko
2020-06-26 13:23 ` Dmitry Osipenko
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=20200624150847.22672-2-digetx@gmail.com \
--to=digetx@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=hverkuil@xs4all.nl \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=thierry.reding@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.