From patchwork Sat Apr 24 06:45:10 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: 12222391 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_NONE,USER_AGENT_GIT autolearn=ham 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 B4630C43600 for ; Sat, 24 Apr 2021 06:45:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93D156141C for ; Sat, 24 Apr 2021 06:45:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234710AbhDXGq1 (ORCPT ); Sat, 24 Apr 2021 02:46:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:36128 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233206AbhDXGqP (ORCPT ); Sat, 24 Apr 2021 02:46:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 736B2616EB; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246733; bh=zSIZIJdKOUAGnyfSOuoxDI+Bj1QIKcCsJeDd9evgSr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B62keZdvIxZEHCpDtpikVj6zVPW6jo6BxVQp9FjXZD7T6E/ex7SmLEELIGv/dq3cl 2OWKfTLZZPA56M6K5E91XC3sdEtWxfo1FxGkCZKMlh+hgVP3vUuEH3VgCO7i2R1kJX KRTzOLvAj7Vl7Dat7wNwntP3zE6O1mXhZbWtBfFw5jR5d73ivRALa0Dte8tDso+C1L 7RJD+5aopP9t6aOjqIogpempFpiebJwjYsCEtlGw9YpoN4NH0chrtch3EmXCEwHziv 2KrtFLlj3SjWxuaCI8n49vhfbIHkvsy56LKRXKiLZ5RcGPEsE+D0Z9R6gwmINXlb7g PsNyJoJbKsOKQ== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jgc-Ke; Sat, 24 Apr 2021 08:45:32 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Robert Foss , Todor Tomov , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 60/78] media: camss-csid: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:45:10 +0200 Message-Id: <080d8d9e0ff6c82cacf3bf728c7bc0f658b43ce6.1619191723.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- drivers/media/platform/qcom/camss/camss-csid.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c index cc11fbfdae13..d2a7f2a64f26 100644 --- a/drivers/media/platform/qcom/camss/camss-csid.c +++ b/drivers/media/platform/qcom/camss/camss-csid.c @@ -156,11 +156,9 @@ static int csid_set_power(struct v4l2_subdev *sd, int on) int ret; if (on) { - ret = pm_runtime_get_sync(dev); - if (ret < 0) { - pm_runtime_put_sync(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) return ret; - } ret = regulator_enable(csid->vdda); if (ret < 0) { From patchwork Sat Apr 24 06:45:11 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: 12222399 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_NONE,USER_AGENT_GIT autolearn=ham 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 9CEA9C43460 for ; Sat, 24 Apr 2021 06:46:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C0F46141C for ; Sat, 24 Apr 2021 06:46:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237179AbhDXGqk (ORCPT ); Sat, 24 Apr 2021 02:46:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:36096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233677AbhDXGqU (ORCPT ); Sat, 24 Apr 2021 02:46:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 710AC6162F; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246733; bh=caAPk+MCL8dn2GoVy6dPupvi3+StYvHdRWjGpSc7psI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O5lG2fTrSUv+Klvp/Y/ju1Ap7wYlUlfzX426Y10b3zlY+91Yl/C/1Gh4RpdvJDHxp gOscYp9c5RCFxGJdYI+Bg25WLO+s7QT+V/ncbyGqzCPoep2Dy7vpG7I4veqsrBW/y9 058m/SwQt+gcuQyossGkAWLZCH1Exi9JGMlI0ScjPdqK66C8xJfqgZ/unqjbTq/7A3 g+B/q8c9RLGWMXpQ5F4mHt2+fKYWhVFfwWEj1xE3H3waPI9TO9HetyAKClMkJH4Ft8 giroIscp+nBeEUHWDaJ7uyAkvrhivWr62h0na6wY/HPgRGiL1wVKWf2fjko4l74uT5 Zo23ozxOFtgig== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jgf-LY; Sat, 24 Apr 2021 08:45:32 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Robert Foss , Todor Tomov , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 61/78] media: camss-csiphy: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:45:11 +0200 Message-Id: <134315407c8289ee207f2ffd554d0bd4ee70793d.1619191723.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- drivers/media/platform/qcom/camss/camss-csiphy.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c index b3c3bf19e522..8e18b8e668cf 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c @@ -197,11 +197,9 @@ static int csiphy_set_power(struct v4l2_subdev *sd, int on) if (on) { int ret; - ret = pm_runtime_get_sync(dev); - if (ret < 0) { - pm_runtime_put_sync(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) return ret; - } ret = csiphy_set_clock_rates(csiphy); if (ret < 0) { From patchwork Sat Apr 24 06:45:12 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: 12222395 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_NONE,USER_AGENT_GIT autolearn=ham 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 569F7C43462 for ; Sat, 24 Apr 2021 06:46:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DA2461481 for ; Sat, 24 Apr 2021 06:46:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230174AbhDXGqg (ORCPT ); Sat, 24 Apr 2021 02:46:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:36058 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233500AbhDXGqS (ORCPT ); Sat, 24 Apr 2021 02:46:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9833861920; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246733; bh=bKZpHKXOW0JplSe4YO0635c1m0eb/ZNQKqV2/c8cMew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JkTGK0UM6RlohQhe2LKKy9NJtQF9jF6a36t6ELWtLCTkfUTellTHJZIwG8p3K2RrQ 4tuDI3qppincy14JuZZm+LweVSEvBu8YcQ4y9okUhOv5tEPOr/FeKr5PXW/5CkvRsJ WE/QKygDoy1jcGW87HKbo25xkvGgxiZXe8h+gYPpAMyocuVPfK4NHdyL8RgF1Bxjoa NHXj7+SpPHTUQ4h7uTmNz11yDJUzW6N9QrpXHJicOY9cE1HoaWikQkFrooeHeicHM5 RqJfyBW+ViB5dcvKE09PkHgs3qXAsUyF31txWEUGdBmr5sGZEVgFWecJpBO6Bd5sXY gcDO/dcSy9O6A== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jgi-MW; Sat, 24 Apr 2021 08:45:32 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Robert Foss , Todor Tomov , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 62/78] media: camss-ispif: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:45:12 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- drivers/media/platform/qcom/camss/camss-ispif.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/media/platform/qcom/camss/camss-ispif.c index 37611c8861da..d9907742ba79 100644 --- a/drivers/media/platform/qcom/camss/camss-ispif.c +++ b/drivers/media/platform/qcom/camss/camss-ispif.c @@ -372,11 +372,9 @@ static int ispif_set_power(struct v4l2_subdev *sd, int on) goto exit; } - ret = pm_runtime_get_sync(dev); - if (ret < 0) { - pm_runtime_put_sync(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) goto exit; - } ret = camss_enable_clocks(ispif->nclocks, ispif->clock, dev); if (ret < 0) { From patchwork Sat Apr 24 06:45:13 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: 12222403 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_NONE,USER_AGENT_GIT autolearn=ham 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 CB69BC4361A for ; Sat, 24 Apr 2021 06:46:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B457261483 for ; Sat, 24 Apr 2021 06:46:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237243AbhDXGqn (ORCPT ); Sat, 24 Apr 2021 02:46:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:35724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231836AbhDXGqY (ORCPT ); Sat, 24 Apr 2021 02:46:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C4B0061938; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246734; bh=SctF1EnznGEIIpIjxgpYNPSyfgvGAqEmSYB5mfWpmqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=arwgI/cDLDju5CZsvLz/7iYTgKUDGxX9A+Kk8KAMtCPdRBDsaDwpqF+i50mMhZD5i QIyFlokd9FKVUQd2NoUp2O7O1HysEp4aHcLWnJ/yzKRRf1jywxKFfcBXiQE/1tlTgE rSqdu6+3CcLe3SNqlVyKKmKFMdvf9LCYlNQ+l9Vxs3gYFSPBinX/Dc2JLgT8fq70hm WioKYLsPMR4AA+9xb63r6TMIe7Epexj3Lu9aZcxKxLsR3gcLsNVZWUFfntipsTVZ/e KmDWrxUpldB372ZDyOmb45LEnlfX82lRSY1MSQqMR9tyqO35zucG5jLZohKuS5fQmS uIXfBg+LKtWWA== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jgl-NU; Sat, 24 Apr 2021 08:45:32 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Robert Foss , Todor Tomov , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 63/78] media: camss-vfe: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:45:13 +0200 Message-Id: <925188c1bbe50a14b21bfcc8886e9419a55f9b62.1619191723.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- drivers/media/platform/qcom/camss/camss-vfe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c index 15695fd466c4..cf743e61f798 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -584,9 +584,9 @@ static int vfe_get(struct vfe_device *vfe) if (ret < 0) goto error_pm_domain; - ret = pm_runtime_get_sync(vfe->camss->dev); + ret = pm_runtime_resume_and_get(vfe->camss->dev); if (ret < 0) - goto error_pm_runtime_get; + goto error_domain_off; ret = vfe_set_clock_rates(vfe); if (ret < 0) @@ -620,6 +620,7 @@ static int vfe_get(struct vfe_device *vfe) error_pm_runtime_get: pm_runtime_put_sync(vfe->camss->dev); +error_domain_off: vfe->ops->pm_domain_off(vfe); error_pm_domain: From patchwork Sat Apr 24 06:45:14 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: 12222393 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_NONE,USER_AGENT_GIT autolearn=ham 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 E30B1C43461 for ; Sat, 24 Apr 2021 06:46:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C769261482 for ; Sat, 24 Apr 2021 06:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236987AbhDXGqf (ORCPT ); Sat, 24 Apr 2021 02:46:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:35790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233451AbhDXGqS (ORCPT ); Sat, 24 Apr 2021 02:46:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A1B69616EC; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246733; bh=jhFOuNkS8GXbkVzxvUoQK+5PtoGb2Bw8SlIbqUkTFTg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f0e1rGgjIIBj1g4o3qoPMHGh38ogpUaaRRj7LnyzkinsjZXhfgcyiyxpv3kt76jx8 c1D3lIFzvZ+KmClGOg+gG/lhoHi3TZoaSs8rPoY5aGXMEpXnktqKIPs1SdKkzsV79J LyPl8TLyMAEkfHMLJm58Zagyr/NT0o8aZtLrNURNa6mC7UQEt+a6GQABrUJaBMKg3y +/alcuHQ+0bf8Pv2F5WI+bncbc+hL2uxfadRkEDDett0iXhnGBoNVa7SP5+jayKVdC Hn1Plrz7oFSUdaa1y10nGv+x02uzPDI4udauwEgVjlGjW4KATJjhBwuG3qtY0U3L2Y yXHJpTOdX2/Aw== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jgo-OS; Sat, 24 Apr 2021 08:45:32 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Stanimir Varbanov , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 64/78] media: core: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:45:14 +0200 Message-Id: <1fb9919b1cb83dd6db934dab74442c981eeda7f0.1619191723.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- drivers/media/platform/qcom/venus/core.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 54bac7ec14c5..c156320fa256 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -84,7 +84,7 @@ static void venus_sys_error_handler(struct work_struct *work) container_of(work, struct venus_core, work.work); int ret = 0; - pm_runtime_get_sync(core->dev); + pm_runtime_resume_and_get(core->dev); hfi_core_deinit(core, true); @@ -106,7 +106,7 @@ static void venus_sys_error_handler(struct work_struct *work) hfi_reinit(core); - pm_runtime_get_sync(core->dev); + pm_runtime_resume_and_get(core->dev); ret |= venus_boot(core); ret |= hfi_core_resume(core, true); @@ -305,21 +305,21 @@ static int venus_probe(struct platform_device *pdev) pm_runtime_enable(dev); - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) goto err_runtime_disable; ret = of_platform_populate(dev->of_node, NULL, NULL, dev); if (ret) - goto err_runtime_disable; + goto err_pm; ret = venus_firmware_init(core); if (ret) - goto err_runtime_disable; + goto err_pm; ret = venus_boot(core); if (ret) - goto err_runtime_disable; + goto err_pm; ret = hfi_core_resume(core, true); if (ret) @@ -351,8 +351,9 @@ static int venus_probe(struct platform_device *pdev) v4l2_device_unregister(&core->v4l2_dev); err_venus_shutdown: venus_shutdown(core); -err_runtime_disable: +err_pm: pm_runtime_put_noidle(dev); +err_runtime_disable: pm_runtime_set_suspended(dev); pm_runtime_disable(dev); hfi_destroy(core); @@ -371,7 +372,7 @@ static int venus_remove(struct platform_device *pdev) struct device *dev = core->dev; int ret; - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); WARN_ON(ret < 0); ret = hfi_core_deinit(core, true); @@ -403,7 +404,7 @@ static void venus_core_shutdown(struct platform_device *pdev) { struct venus_core *core = platform_get_drvdata(pdev); - pm_runtime_get_sync(core->dev); + pm_runtime_resume_and_get(core->dev); venus_shutdown(core); venus_firmware_deinit(core); pm_runtime_put_sync(core->dev); From patchwork Sat Apr 24 06:45:15 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: 12222407 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 0BA29C433B4 for ; Sat, 24 Apr 2021 06:46:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E573C61462 for ; Sat, 24 Apr 2021 06:46:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237406AbhDXGrA (ORCPT ); Sat, 24 Apr 2021 02:47:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:35848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237056AbhDXGqg (ORCPT ); Sat, 24 Apr 2021 02:46:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C60556193B; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246734; bh=2uz7aSLoagaiwsviWYHDbC8DuUarXl/FOpoWTSwsrxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sfBrwrmBfYoeC9NADSynMCkyG98jkY98bdc7U4ZsBiJMBL/l3I7AXj05SG+lFaNeb N3HHg0UA3MzNjy9NihDfITuIcllJEQSuexWw4M/GzulVt9kDVxgfg+2IBOKoA9MZeZ 0WSFQ6zYWjracMUCPYZi3RyH5VCmOnIW7vVMouweoXMITHFt/F/PHN4gvkgshbn4NO Pdmcdzyzy3rtCajmb6GxA+v2QdqHudW2YjLbNtJfLiAZsOwhTHomK2MulB9fX2GV1P SHVp5OB6/ZIHXs5xi1tEOLduoMl1u8Un5b+D8AZwvQ9CEbjaOYhk/wqMxUdufAevKz 8XSCGkTXL5Hdg== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jgr-PS; Sat, 24 Apr 2021 08:45:32 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Stanimir Varbanov , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 65/78] media: pm_helpers: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:45:15 +0200 Message-Id: <32f56f8ad0a25a075be28e129eac02bd2424b5ec.1619191723.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- drivers/media/platform/qcom/venus/pm_helpers.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index c7e1ebec47ee..9e32ec866af7 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -486,7 +486,7 @@ static int poweron_coreid(struct venus_core *core, unsigned int coreid_mask) int ret; if (coreid_mask & VIDC_CORE_ID_1) { - ret = pm_runtime_get_sync(core->pmdomains[1]); + ret = pm_runtime_resume_and_get(core->pmdomains[1]); if (ret < 0) return ret; @@ -504,7 +504,7 @@ static int poweron_coreid(struct venus_core *core, unsigned int coreid_mask) } if (coreid_mask & VIDC_CORE_ID_2) { - ret = pm_runtime_get_sync(core->pmdomains[2]); + ret = pm_runtime_resume_and_get(core->pmdomains[2]); if (ret < 0) return ret; @@ -990,11 +990,9 @@ static int core_power_v4(struct venus_core *core, int on) if (on == POWER_ON) { if (pmctrl) { - ret = pm_runtime_get_sync(pmctrl); - if (ret < 0) { - pm_runtime_put_noidle(pmctrl); + ret = pm_runtime_resume_and_get(pmctrl); + if (ret < 0) return ret; - } } ret = core_resets_reset(core); From patchwork Sat Apr 24 06:45:16 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: 12222397 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_NONE,USER_AGENT_GIT autolearn=ham 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 376E0C43600 for ; Sat, 24 Apr 2021 06:46:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A95161483 for ; Sat, 24 Apr 2021 06:46:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237089AbhDXGqi (ORCPT ); Sat, 24 Apr 2021 02:46:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:35772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233614AbhDXGqT (ORCPT ); Sat, 24 Apr 2021 02:46:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A8C7F61929; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246733; bh=73B6Lks3AupUDrJCPSyBZhCBhq2sPf760XjzihM5LGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TGz2XCF1NBN5v9sRqR1k/Cdld7bRC9Vf+FjW+LutJNOgASes5u5gXs8T9cDHMos6S E3S1wOKCu4N0yFoky6K/LoXIQzj4qV3TiqbxX0+YJsTRdaZZLuZk9WYxMSelsH0Heb n5H7KrmjeD+wBRj9DrdKQu/VlROMxUnhNEDbzAmXdTUz02eucF3KaktGGts3z6n9ac s6l7dacgoXBPyx5EgOR0gfyWvD3cTXDUoLx2sp7AGE7UbraRWRhYMUm7uWOIk+Ryke 1aaDMBwB4rzZ85FdeeY80pNRHKvqJdUhcSlIjI3FE1AOruUpl1U7pddB4RsiVMjFTu DCcSs/MAsQagg== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jgu-QO; Sat, 24 Apr 2021 08:45:32 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Stanimir Varbanov , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 66/78] media: vdec: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:45:16 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- 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; @@ -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; From patchwork Sat Apr 24 06:45:17 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: 12222401 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_NONE,USER_AGENT_GIT autolearn=ham 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 969EBC433ED for ; Sat, 24 Apr 2021 06:46:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A11461483 for ; Sat, 24 Apr 2021 06:46:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237217AbhDXGql (ORCPT ); Sat, 24 Apr 2021 02:46:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:36098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233881AbhDXGqV (ORCPT ); Sat, 24 Apr 2021 02:46:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AE9596192C; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246733; bh=phIvrsjCST0hqKSIzsjBL4/Aigr4NLUZL7GWQhPHYlY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cxSFgyYt65X6dvnIBfiw6H7qS2vlKGvcmw4KHyHoUyxWnqX8L9c+gfIXD3Y3m8dbS dq3aHWIJJKPyjS/0EPKp/khRcxjQeUxk/p8zK+oVFhiyovvh2SWpWxjkX2nR5CpDwu T/0XhtG5aKGyjgo5GsfFENKinn+482sPhk4zhUL91BWV1GmT04j4Ny59LMAEhqy6+V CRDBiXpbTc8TPJa9Tq/P+pPrbi/dd4GCBVQg4kPFvY0oE0U2I/3hs2GRn0QkE6HAbW Vy55DDXf/pc8LP9gyW7iOVYetsYndvPgXRBxeU5CJdb/k56ofmI75MWWoSSyLrcSvf T/hHbv1tgWt3A== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jgx-RJ; Sat, 24 Apr 2021 08:45:32 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Stanimir Varbanov , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 67/78] media: venc: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:45:17 +0200 Message-Id: <382afe29b3e860182d9c09579d11b8884a07414b.1619191723.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- drivers/media/platform/qcom/venus/venc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 4a7291f934b6..8dd49d4f124c 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1205,9 +1205,9 @@ static int venc_open(struct file *file) venus_helper_init_instance(inst); - ret = pm_runtime_get_sync(core->dev_enc); + ret = pm_runtime_resume_and_get(core->dev_enc); if (ret < 0) - goto err_put_sync; + goto err_free; ret = venc_ctrl_init(inst); if (ret) @@ -1252,6 +1252,7 @@ static int venc_open(struct file *file) venc_ctrl_deinit(inst); err_put_sync: pm_runtime_put_sync(core->dev_enc); +err_free: kfree(inst); return ret; }