From patchwork Thu May 6 15:25:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A21DDC43460 for ; Thu, 6 May 2021 15:28:44 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B98161990 for ; Thu, 6 May 2021 15:28:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B98161990 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=9iN2CZpcfMdPpmiEyxVZQWWiKHY/yeFhMw4W5IMm0LY=; b=InC9jYpTheDZq9qk0nqfeolQyj lBiyHXoDnUQDqhX8n1iWCdB0ZKNePzmXTfOSWM5YubOIt26K8NEB9rZtFVY3JMvTgGT5uOVsSkgQq GU9TJ2Kt9+icdqo9P1dBRgwJd5a3QZV10pUSieDw9wiPcZbEL/YO9YHKY1WjE4EudIMMftS9JO2rV v93EcV5kGyaJ+xM/ACrNr+vGZG3RkibDoi3cymrpQTLyW6F4v+hjw0XS1pWMlm10HqZ7jbzSIQ7++ TKPEH4bbqv6wh+9/+PlVPWd9zNNzw05kqgsFERcG6hhPGVM5RSn0ZI5xuXks3zfHQlzHTUkuikri6 xG9V/k7A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lefva-004YZI-T2; Thu, 06 May 2021 15:28:39 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lefth-004Xrj-MR; Thu, 06 May 2021 15:26:44 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2403A61584; Thu, 6 May 2021 15:26:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620314800; bh=PvMAY6Y2fz/EvEn1dyCRJ72V76RqJb8t+KOlunBx8UY=; h=From:To:Cc:Subject:Date:From; b=WnFjjXi6QufHdKAf0NrxvIr88fq46S7vbtcI30ddxj18mrch8A+v1YNh2H9MQqftF xbggOG7JOxwSWbQTzeyT2oG4vE9DQQlDsqvm2Shs6WHwvcQtkEff1vL1xmCenTDUxz DDU2AwYzImtlNSUjehesEzHx7hlo+/ZKRBsRPbb9i9aumHNHqJTJUYvJFv8/Qa6aLG H5cs5YZDguj3bStGcWFq7Fsc7w2JID15ILH4nlzjsa4uOXBi6Sc5apsyWSH8ooG3GB bkXTuVqCSd6zl0UkdjlpxZOrap35ifdCt681cypv2r3raeYR+W9YzcVfw734dX4O9c P34nCnsFHocGA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1left7-000SB2-KN; Thu, 06 May 2021 17:26:05 +0200 From: Mauro Carvalho Chehab To: Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Alexandre Torgue , Andrzej Hajda , Andy Gross , Benoit Parrot , Bingbu Cao , Bjorn Andersson , Chen-Yu Tsai , Dafna Hirschfeld , Dan Scally , Dmitry Osipenko , Ezequiel Garcia , Fabio Estevam , Heiko Stuebner , Helen Koike , Jacob Chen , Jernej Skrabec , Jonathan Hunter , Matthias Brugger , Mauro Carvalho Chehab , Maxime Coquelin , Maxime Ripard , NXP Linux Team , Paul Kocialkowski , Pengutronix Kernel Team , Philipp Zabel , Robert Foss , Rui Miguel Silva , Sakari Ailus , Sascha Hauer , Shawn Guo , Sowjanya Komatineni , Stanimir Varbanov , Steve Longerbeam , Sylwester Nawrocki , Thierry Reding , Tianshu Qiu , Todor Tomov , Yong Zhi , 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 Message-Id: X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_162642_245352_CC7E737F X-CRM114-Status: GOOD ( 13.66 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org 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(-)