From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 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 258DBC43461 for ; Fri, 30 Apr 2021 17:51:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E525461186 for ; Fri, 30 Apr 2021 17:51:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231630AbhD3Rw2 (ORCPT ); Fri, 30 Apr 2021 13:52:28 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:2976 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbhD3Rw0 (ORCPT ); Fri, 30 Apr 2021 13:52:26 -0400 Received: from fraeml715-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4FX05f3ND9z6896y; Sat, 1 May 2021 01:40:54 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml715-chm.china.huawei.com (10.206.15.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 30 Apr 2021 19:51:36 +0200 Received: from localhost (10.52.125.96) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 30 Apr 2021 18:51:35 +0100 Date: Fri, 30 Apr 2021 18:50:01 +0100 From: Jonathan Cameron To: Mauro Carvalho Chehab CC: , , Ezequiel Garcia , Hans Verkuil , "Krzysztof Kozlowski" , Mauro Carvalho Chehab , Sylwester Nawrocki , , , , Subject: Re: [PATCH v4 63/79] media: exynos-gsc: use pm_runtime_resume_and_get() Message-ID: <20210430185001.00005e76@Huawei.com> In-Reply-To: <31bdadf2f59e86c6a315ec390b44c6c681af6647.1619621413.git.mchehab+huawei@kernel.org> References: <31bdadf2f59e86c6a315ec390b44c6c681af6647.1619621413.git.mchehab+huawei@kernel.org> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.52.125.96] X-ClientProxiedBy: lhreml721-chm.china.huawei.com (10.201.108.72) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Apr 2021 16:52:24 +0200 Mauro Carvalho Chehab wrote: > 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. > > Reviewed-by: Sylwester Nawrocki > Signed-off-by: Mauro Carvalho Chehab > --- > drivers/media/platform/exynos-gsc/gsc-m2m.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c > index 27a3c92c73bc..09551e96ac15 100644 > --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c > +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c > @@ -58,7 +58,7 @@ static int gsc_m2m_start_streaming(struct vb2_queue *q, unsigned int count) > struct gsc_ctx *ctx = q->drv_priv; > int ret; > > - ret = pm_runtime_get_sync(&ctx->gsc_dev->pdev->dev); > + ret = pm_runtime_resume_and_get(&ctx->gsc_dev->pdev->dev); > return ret > 0 ? 0 : ret; return pm_runtime_resume_and_get() as static inline int pm_runtime_resume_and_get(struct device *dev) { int ret; ret = __pm_runtime_resume(dev, RPM_GET_PUT); if (ret < 0) { pm_runtime_put_noidle(dev); return ret; } return 0; } Can't return >= 0 > } > From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_2 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 A41BAC433B4 for ; Fri, 30 Apr 2021 17:53:17 +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 6033261456 for ; Fri, 30 Apr 2021 17:53:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6033261456 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=Huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=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:References:In-Reply-To:Message-ID: Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MSxDdAgCuT1W2uk0k47+KWX1kok1f49/LiS4qDivbIo=; b=hMSPY9HwpIS+quUB1EQns6NL/ 5Enj77R21YJ7D9W8zDnebUkDp0feu74o2pckfnAdBPVe7Gbu8X6EmTYlezHnwiAp+SYtVSYuJj7T8 L14ARh7uEPtxdeOnTV5dcYx9bqob5q0B+dDV4Tj6Tz9/9KafoFbFWEluf0UU91fYN86nIN87Nxvai Tz7paCn/LBHLkHBnhAXNjyD/o8vFvsetYAoiYI6dWeLmHCxdSERMZQbliXBHkJ86Li4UzpjhF7eDY vpufbel4ML81LIaByVAOz81aiqLlJbqUXqPoz/qncQSGtBUOul285CD8NjcVaw/OVX++74o61gBbA amEcN6N0g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lcXIm-008JkI-AL; Fri, 30 Apr 2021 17:51:44 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lcXIi-008Jju-Tp for linux-arm-kernel@desiato.infradead.org; Fri, 30 Apr 2021 17:51:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:CC:To: From:Date:Sender:Reply-To:Content-ID:Content-Description; bh=miE6pFJxG/ySIYlt3Tvyk0CH2vIS0kcG4eeQ3QCmraQ=; b=SeJC1sbHNCZxm/dpgEl5GcBXLs 4roiZq/t1ZzLODH5UuWfURA0OK3Bf3MQDtAXDkpdXurIjYheE4GCxzC+JjDN8yOHz6GWxzip/2d3W Ii4g0DLpg75X5Zkln0iF5HOBPRn/w28rAD/ySGEgyTZWZA2D6E3trwMrJOaWbVTMb+4n0RbsZI97M 2c0DlG0x9GDPWA87V1sMtbO05U95p8q47wv9z15mVnX0GUFBn8hPKxTcUvoHDbEs+ocXYyBdkmr1r ZLccL6HprvPmMgW2pVAARpfXN2z1zR3IcfZc9915XsjO9gls6dIC2yjS9Mm3Kq3cTHfWn/8M5i44+ nTNA/j/A==; Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lcXIg-001ZJU-Cr for linux-arm-kernel@lists.infradead.org; Fri, 30 Apr 2021 17:51:39 +0000 Received: from fraeml715-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4FX05f3ND9z6896y; Sat, 1 May 2021 01:40:54 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml715-chm.china.huawei.com (10.206.15.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 30 Apr 2021 19:51:36 +0200 Received: from localhost (10.52.125.96) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 30 Apr 2021 18:51:35 +0100 Date: Fri, 30 Apr 2021 18:50:01 +0100 From: Jonathan Cameron To: Mauro Carvalho Chehab CC: , , Ezequiel Garcia , Hans Verkuil , "Krzysztof Kozlowski" , Mauro Carvalho Chehab , Sylwester Nawrocki , , , , Subject: Re: [PATCH v4 63/79] media: exynos-gsc: use pm_runtime_resume_and_get() Message-ID: <20210430185001.00005e76@Huawei.com> In-Reply-To: <31bdadf2f59e86c6a315ec390b44c6c681af6647.1619621413.git.mchehab+huawei@kernel.org> References: <31bdadf2f59e86c6a315ec390b44c6c681af6647.1619621413.git.mchehab+huawei@kernel.org> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; i686-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.52.125.96] X-ClientProxiedBy: lhreml721-chm.china.huawei.com (10.201.108.72) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210430_105138_612590_306214E9 X-CRM114-Status: GOOD ( 15.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 28 Apr 2021 16:52:24 +0200 Mauro Carvalho Chehab wrote: > 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. > > Reviewed-by: Sylwester Nawrocki > Signed-off-by: Mauro Carvalho Chehab > --- > drivers/media/platform/exynos-gsc/gsc-m2m.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c > index 27a3c92c73bc..09551e96ac15 100644 > --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c > +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c > @@ -58,7 +58,7 @@ static int gsc_m2m_start_streaming(struct vb2_queue *q, unsigned int count) > struct gsc_ctx *ctx = q->drv_priv; > int ret; > > - ret = pm_runtime_get_sync(&ctx->gsc_dev->pdev->dev); > + ret = pm_runtime_resume_and_get(&ctx->gsc_dev->pdev->dev); > return ret > 0 ? 0 : ret; return pm_runtime_resume_and_get() as static inline int pm_runtime_resume_and_get(struct device *dev) { int ret; ret = __pm_runtime_resume(dev, RPM_GET_PUT); if (ret < 0) { pm_runtime_put_noidle(dev); return ret; } return 0; } Can't return >= 0 > } > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel