Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp270305pxb; Sat, 10 Apr 2021 02:14:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfd7j8XGPZksYBXCdS4pgcZ4EtLHAou0TNhCi8Io/4kFGQpOuhS7AqhAH3STSKUpymyCJA X-Received: by 2002:a63:f104:: with SMTP id f4mr16730907pgi.241.1618046087752; Sat, 10 Apr 2021 02:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618046087; cv=none; d=google.com; s=arc-20160816; b=rd2ZMXUo8kKiqEXgqQJY1XnCG9hKmRa1JtXSb3kae/Ft5EESTC/PN1WII78wUQYH/t GXNS1iEgqW9jFfwyP2QsmaOVV+zMIFrigd2nBWCoGNF25RzoL45T369xsE5ChrkLEVvw /rICFmDCKWhq8SbxRF/OFu0wZW+KXOBpaDOyT2eyYR+x+MZhjoqVFezJPnegFvPFkXrI JvSpO4N32vFKf0kX9RtemtwE6qFw5Ia8VXqOxqMqw2RI4smM7L/CoNpjeRm6qS8ix/lU tykXN+O52NDiVhBJS85zbMkotVxwl60ydZd+x1nu137lWOpF197OPSBJze3BcMvJoyA0 2aag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=dWLnw4e+eVErtzq01BXqd/4Oxayh+L3sktLPl/jnEmw=; b=gEFuFqaGtfat56T/nabvCRYgos1DcbWpsbAdXFT6P0r60/Lx7KJCPkRg23v6/4NcI8 q7c8ITQ8NnC0vNmuu8q8nO3cEKWuaoKKO9BZwSsdcVMSTPvG8Ple3D2SkQ3aSCstxZIQ e0NbSCpfvuqxdnYCHtZLq9DlqIJnmExj/5k3p30QXezdswU5rKAgc3Yqyco5juejM3t0 QsXkHy0C7cmuda5Bvg9xcmRrUlHnakjB1pH4RFR6GKWakVomgaDlqiXjLHwep114S55v Q9FApkj3r06PSbHsqAkDMpMjpGu8D+rQFjOuwquqOMzJWmQXBrf8nrE9j6I5sDxBDV/E J1ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s7si5031921pfu.336.2021.04.10.02.14.35; Sat, 10 Apr 2021 02:14:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234637AbhDJJOJ (ORCPT + 99 others); Sat, 10 Apr 2021 05:14:09 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:38746 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S234627AbhDJJOH (ORCPT ); Sat, 10 Apr 2021 05:14:07 -0400 X-UUID: 68abb4a745da44c7825d28f3c4282dfc-20210410 X-UUID: 68abb4a745da44c7825d28f3c4282dfc-20210410 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 95457198; Sat, 10 Apr 2021 17:13:52 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 10 Apr 2021 17:13:50 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 10 Apr 2021 17:13:49 +0800 From: Yong Wu To: Matthias Brugger , Joerg Roedel , Rob Herring , Krzysztof Kozlowski CC: Evan Green , Robin Murphy , Tomasz Figa , Will Deacon , , , , , , , , , Nicolas Boichat , Matthias Kaehlcke , , , , , , Subject: [PATCH v5 12/16] media: mtk-vcodec: Use pm_runtime_resume_and_get for PM get_sync Date: Sat, 10 Apr 2021 17:11:24 +0800 Message-ID: <20210410091128.31823-13-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210410091128.31823-1-yong.wu@mediatek.com> References: <20210410091128.31823-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pm_runtime_get_sync will increment pm usage counter even it failed. This patch use pm_runtime_resume_and_get instead of pm_runtime_get_sync to keep usage counter balanced. Signed-off-by: Yong Wu --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c index ddee7046ce42..32e1858e9f1d 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c @@ -92,9 +92,10 @@ void mtk_vcodec_dec_pw_on(struct mtk_vcodec_pm *pm) { int ret; - ret = pm_runtime_get_sync(pm->dev); + ret = pm_runtime_resume_and_get(pm->dev); if (ret) - mtk_v4l2_err("pm_runtime_get_sync fail %d", ret); + mtk_v4l2_err("pm_runtime_resume_and_get fail %d", ret); + } void mtk_vcodec_dec_pw_off(struct mtk_vcodec_pm *pm) -- 2.18.0