lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <cover.1620314616.git.mchehab+huawei@kernel.org>
Date:   Thu,  6 May 2021 17:25:38 +0200
From:   Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To:     unlisted-recipients:; (no To-header on input)
Cc:     linuxarm@...wei.com, mauro.chehab@...wei.com,
        Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        Andrzej Hajda <a.hajda@...sung.com>,
        Andy Gross <agross@...nel.org>, Benoit Parrot <bparrot@...com>,
        Bingbu Cao <bingbu.cao@...el.com>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Chen-Yu Tsai <wens@...e.org>,
        Dafna Hirschfeld <dafna.hirschfeld@...labora.com>,
        Dan Scally <djrscally@...il.com>,
        Dmitry Osipenko <digetx@...il.com>,
        Ezequiel Garcia <ezequiel@...labora.com>,
        Fabio Estevam <festevam@...il.com>,
        Heiko Stuebner <heiko@...ech.de>,
        Helen Koike <helen.koike@...labora.com>,
        Jacob Chen <jacob-chen@...wrt.com>,
        Jernej Skrabec <jernej.skrabec@...l.net>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Maxime Ripard <mripard@...nel.org>,
        NXP Linux Team <linux-imx@....com>,
        Paul Kocialkowski <paul.kocialkowski@...tlin.com>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Robert Foss <robert.foss@...aro.org>,
        Rui Miguel Silva <rmfrfs@...il.com>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Shawn Guo <shawnguo@...nel.org>,
        Sowjanya Komatineni <skomatineni@...dia.com>,
        Stanimir Varbanov <stanimir.varbanov@...aro.org>,
        Steve Longerbeam <slongerbeam@...il.com>,
        Sylwester Nawrocki <sylvester.nawrocki@...il.com>,
        Thierry Reding <thierry.reding@...il.com>,
        Tianshu Qiu <tian.shu.qiu@...el.com>,
        Todor Tomov <todor.too@...il.com>,
        Yong Zhi <yong.zhi@...el.com>,
        linux-arm-kernel@...ts.infradead.org,
        linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-media@...r.kernel.org, linux-mediatek@...ts.infradead.org,
        linux-renesas-soc@...r.kernel.org,
        linux-rockchip@...ts.infradead.org,
        linux-samsung-soc@...r.kernel.org, linux-staging@...ts.linux.dev,
        linux-stm32@...md-mailman.stormreply.com,
        linux-sunxi@...ts.linux.dev, linux-tegra@...r.kernel.org
Subject: [PATCH v5 00/25] media: use pm_runtime_resume_and_get() on non-i2c drivers

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ