From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: unlisted-recipients:; (no To-header on input)
Cc: linuxarm@huawei.com, mauro.chehab@huawei.com,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Andrzej Hajda <a.hajda@samsung.com>,
Andy Gross <agross@kernel.org>, Benoit Parrot <bparrot@ti.com>,
Bingbu Cao <bingbu.cao@intel.com>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Chen-Yu Tsai <wens@csie.org>,
Dafna Hirschfeld <dafna.hirschfeld@collabora.com>,
Dan Scally <djrscally@gmail.com>,
Dmitry Osipenko <digetx@gmail.com>,
Ezequiel Garcia <ezequiel@collabora.com>,
Fabio Estevam <festevam@gmail.com>,
Heiko Stuebner <heiko@sntech.de>,
Helen Koike <helen.koike@collabora.com>,
Jacob Chen <jacob-chen@iotwrt.com>,
Jernej Skrabec <jernej.skrabec@siol.net>,
Jonathan Hunter <jonathanh@nvidia.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Maxime Ripard <mripard@kernel.org>,
NXP Linux Team <linux-imx@nxp.com>,
Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Philipp Zabel <p.zabel@pengutronix.de>,
Robert Foss <robert.foss@linaro.org>,
Rui Miguel Silva <rmfrfs@gmail.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Shawn Guo <shawnguo@kernel.org>,
Sowjanya Komatineni <skomatineni@nvidia.com>,
Stanimir Varbanov <stanimir.varbanov@linaro.org>,
Steve Longerbeam <slongerbeam@gmail.com>,
Sylwester Nawrocki <sylvester.nawrocki@gmail.com>,
Thierry Reding <thierry.reding@gmail.com>,
Tianshu Qiu <tian.shu.qiu@intel.com>,
Todor Tomov <todor.too@gmail.com>, Yong Zhi <yong.zhi@intel.com>,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-renesas-soc@vger.kernel.org,
linux-rockchip@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-staging@lists.linux.dev,
linux-stm32@st-md-mailman.stormreply.com,
linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org
Subject: [PATCH v5 00/25] media: use pm_runtime_resume_and_get() on non-i2c drivers
Date: Thu, 6 May 2021 17:25:38 +0200 [thread overview]
Message-ID: <cover.1620314616.git.mchehab+huawei@kernel.org> (raw)
Dealing with PM runtime (RPM) is different than dealing with other kAPIs used
on media, as most pm_runtime_get_*() functions won't return to the the state
before the call if an error rises. They, instead, increment an usage_count.
Due to that, there were several bugs on media. Just on this review, we found
24 such errors.
So, let's use pm_runtime_resume_and_get() whenever possible, as it
has two advantages over :
1. On errors, it decrements the usage count;
2. It always return zero on success or an error code. This prevents a
common error pattern of checking if ret is not zero to identify
for errors.
There are however a few places where calls to pm_runtime_get_sync()
are kept. On several of those, a comment was added, in order to
help preventing trivial patches that could try to change them.
PS.: This series was submitted already together with the fix patches
at:
https://lore.kernel.org/linux-media/cover.1619621413.git.mchehab+huawei@kernel.org/
I opted to break it on 3 parts, in order to make easier to review.
This is the third (and final) part.
Mauro Carvalho Chehab (25):
staging: media: imx7-mipi-csis: use pm_runtime_resume_and_get()
staging: media: atomisp: use pm_runtime_resume_and_get()
staging: media: ipu3: use pm_runtime_resume_and_get()
staging: media: cedrus_video: use pm_runtime_resume_and_get()
staging: media: tegra-vde: use pm_runtime_resume_and_get()
staging: media: tegra-video: use pm_runtime_resume_and_get()
media: rockchip/rga: use pm_runtime_resume_and_get()
media: sti/hva: use pm_runtime_resume_and_get()
media: ipu3: use pm_runtime_resume_and_get()
media: coda: use pm_runtime_resume_and_get()
media: mtk-jpeg: use pm_runtime_resume_and_get()
media: camss: use pm_runtime_resume_and_get()
media: venus: core: use pm_runtime_resume_and_get()
media: venus: vdec: use pm_runtime_resume_and_get()
media: venus: venc: use pm_runtime_resume_and_get()
media: rcar-fcp: use pm_runtime_resume_and_get()
media: rkisp1: use pm_runtime_resume_and_get()
media: s3c-camif: use pm_runtime_resume_and_get()
media: s5p-mfc: use pm_runtime_resume_and_get()
media: stm32: use pm_runtime_resume_and_get()
media: sunxi: use pm_runtime_resume_and_get()
media: ti-vpe: use pm_runtime_resume_and_get()
media: vsp1: use pm_runtime_resume_and_get()
media: rcar-vin: use pm_runtime_resume_and_get()
media: hantro: use pm_runtime_resume_and_get()
drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 3 +--
drivers/media/platform/coda/coda-common.c | 7 ++++---
.../media/platform/mtk-jpeg/mtk_jpeg_core.c | 4 ++--
.../media/platform/qcom/camss/camss-csid.c | 6 ++----
.../media/platform/qcom/camss/camss-csiphy.c | 6 ++----
.../media/platform/qcom/camss/camss-ispif.c | 6 ++----
drivers/media/platform/qcom/camss/camss-vfe.c | 5 +++--
.../media/platform/qcom/venus/pm_helpers.c | 3 +--
drivers/media/platform/qcom/venus/vdec.c | 6 +++---
drivers/media/platform/qcom/venus/venc.c | 5 +++--
drivers/media/platform/rcar-fcp.c | 8 +------
drivers/media/platform/rcar-vin/rcar-csi2.c | 15 ++++++++++---
drivers/media/platform/rcar-vin/rcar-dma.c | 6 ++----
drivers/media/platform/rcar-vin/rcar-v4l2.c | 6 ++----
drivers/media/platform/rockchip/rga/rga-buf.c | 3 +--
drivers/media/platform/rockchip/rga/rga.c | 4 +++-
.../platform/rockchip/rkisp1/rkisp1-capture.c | 3 +--
.../media/platform/s3c-camif/camif-capture.c | 2 +-
drivers/media/platform/s3c-camif/camif-core.c | 5 +++--
drivers/media/platform/s5p-mfc/s5p_mfc_pm.c | 6 ++----
drivers/media/platform/sti/hva/hva-hw.c | 17 ++++++++-------
drivers/media/platform/stm32/stm32-dcmi.c | 5 +++--
.../platform/sunxi/sun4i-csi/sun4i_v4l2.c | 6 ++++--
drivers/media/platform/ti-vpe/cal-video.c | 4 +++-
drivers/media/platform/ti-vpe/cal.c | 8 ++++---
drivers/media/platform/ti-vpe/vpe.c | 8 +++----
drivers/media/platform/vsp1/vsp1_drv.c | 10 +--------
.../staging/media/atomisp/pci/atomisp_fops.c | 6 +++---
drivers/staging/media/hantro/hantro_drv.c | 5 ++---
drivers/staging/media/imx/imx7-mipi-csis.c | 7 +++----
drivers/staging/media/ipu3/ipu3.c | 3 +--
.../staging/media/sunxi/cedrus/cedrus_video.c | 6 ++----
drivers/staging/media/tegra-vde/vde.c | 21 ++++++++++++++++---
drivers/staging/media/tegra-video/csi.c | 3 +--
drivers/staging/media/tegra-video/vi.c | 3 +--
35 files changed, 110 insertions(+), 111 deletions(-)
--
2.30.2
next reply other threads:[~2021-05-06 15:28 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-06 15:25 Mauro Carvalho Chehab [this message]
2021-05-06 15:25 ` [PATCH v5 01/25] staging: media: imx7-mipi-csis: use pm_runtime_resume_and_get() Mauro Carvalho Chehab
2021-05-06 15:25 ` [PATCH v5 02/25] staging: media: atomisp: " Mauro Carvalho Chehab
2021-05-06 15:25 ` [PATCH v5 03/25] staging: media: ipu3: " Mauro Carvalho Chehab
2021-05-06 15:25 ` [PATCH v5 04/25] staging: media: cedrus_video: " Mauro Carvalho Chehab
2021-05-06 15:25 ` [PATCH v5 05/25] staging: media: tegra-vde: " Mauro Carvalho Chehab
2021-05-07 5:13 ` Dan Carpenter
2021-05-10 12:26 ` Dmitry Osipenko
2021-05-06 15:25 ` [PATCH v5 06/25] staging: media: tegra-video: " Mauro Carvalho Chehab
2021-05-06 15:25 ` [PATCH v5 07/25] media: rockchip/rga: " Mauro Carvalho Chehab
2021-05-13 22:38 ` Heiko Stuebner
2021-05-06 15:25 ` [PATCH v5 08/25] media: sti/hva: " Mauro Carvalho Chehab
2021-05-06 15:25 ` [PATCH v5 09/25] media: ipu3: " Mauro Carvalho Chehab
2021-05-06 15:25 ` [PATCH v5 10/25] media: coda: " Mauro Carvalho Chehab
2021-05-06 15:25 ` [PATCH v5 11/25] media: mtk-jpeg: " Mauro Carvalho Chehab
2021-05-06 15:25 ` [PATCH v5 12/25] media: camss: " Mauro Carvalho Chehab
2021-05-06 15:25 ` [PATCH v5 13/25] media: venus: core: " Mauro Carvalho Chehab
2021-05-10 13:54 ` Stanimir Varbanov
2021-05-17 15:26 ` Stanimir Varbanov
2021-05-18 15:20 ` Mauro Carvalho Chehab
2021-05-18 15:49 ` Stanimir Varbanov
2021-05-06 15:25 ` [PATCH v5 14/25] media: venus: vdec: " Mauro Carvalho Chehab
2021-05-10 13:55 ` Stanimir Varbanov
2021-05-06 15:25 ` [PATCH v5 15/25] media: venus: venc: " Mauro Carvalho Chehab
2021-05-10 13:55 ` Stanimir Varbanov
2021-05-06 15:25 ` [PATCH v5 16/25] media: rcar-fcp: " Mauro Carvalho Chehab
2021-05-06 16:05 ` Laurent Pinchart
2021-05-06 15:25 ` [PATCH v5 17/25] media: rkisp1: " Mauro Carvalho Chehab
2021-05-13 22:27 ` Heiko Stuebner
2021-05-06 15:25 ` [PATCH v5 18/25] media: s3c-camif: " Mauro Carvalho Chehab
2021-05-06 15:25 ` [PATCH v5 19/25] media: s5p-mfc: " Mauro Carvalho Chehab
2021-05-06 15:25 ` [PATCH v5 20/25] media: stm32: " Mauro Carvalho Chehab
2021-05-06 15:25 ` [PATCH v5 21/25] media: sunxi: " Mauro Carvalho Chehab
2021-05-06 15:26 ` [PATCH v5 22/25] media: ti-vpe: " Mauro Carvalho Chehab
2021-05-06 15:26 ` [PATCH v5 23/25] media: vsp1: " Mauro Carvalho Chehab
2021-05-06 16:06 ` Laurent Pinchart
2021-05-06 15:26 ` [PATCH v5 24/25] media: rcar-vin: " Mauro Carvalho Chehab
2021-05-06 15:26 ` [PATCH v5 25/25] media: hantro: " Mauro Carvalho Chehab
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=cover.1620314616.git.mchehab+huawei@kernel.org \
--to=mchehab+huawei@kernel.org \
--cc=a.hajda@samsung.com \
--cc=agross@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=bingbu.cao@intel.com \
--cc=bjorn.andersson@linaro.org \
--cc=bparrot@ti.com \
--cc=dafna.hirschfeld@collabora.com \
--cc=digetx@gmail.com \
--cc=djrscally@gmail.com \
--cc=ezequiel@collabora.com \
--cc=festevam@gmail.com \
--cc=heiko@sntech.de \
--cc=helen.koike@collabora.com \
--cc=jacob-chen@iotwrt.com \
--cc=jernej.skrabec@siol.net \
--cc=jonathanh@nvidia.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=linux-tegra@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=matthias.bgg@gmail.com \
--cc=mauro.chehab@huawei.com \
--cc=mchehab@kernel.org \
--cc=mcoquelin.stm32@gmail.com \
--cc=mripard@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=paul.kocialkowski@bootlin.com \
--cc=rmfrfs@gmail.com \
--cc=robert.foss@linaro.org \
--cc=s.hauer@pengutronix.de \
--cc=sakari.ailus@linux.intel.com \
--cc=shawnguo@kernel.org \
--cc=skomatineni@nvidia.com \
--cc=slongerbeam@gmail.com \
--cc=stanimir.varbanov@linaro.org \
--cc=sylvester.nawrocki@gmail.com \
--cc=thierry.reding@gmail.com \
--cc=tian.shu.qiu@intel.com \
--cc=todor.too@gmail.com \
--cc=wens@csie.org \
--cc=yong.zhi@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 NNTP newsgroup(s).