Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp270508pxb; Sat, 10 Apr 2021 02:15:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVNb7Dq+r7g+iBL9OzQEipqtiv0gxYX6NdZQgb2I742tT3aN5l/0vLnuQLKeYwoXwWZ985 X-Received: by 2002:a65:62d7:: with SMTP id m23mr17381669pgv.244.1618046116575; Sat, 10 Apr 2021 02:15:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618046116; cv=none; d=google.com; s=arc-20160816; b=SkZV0NftAeCu2NfXFXEberb1mJo2iZsN6gMiKsARjArO7QDZw/v4HnTlRTveeJ0BHb mS03CkN/CTJAO7AHAz45lESwzJYk1g63LOvBYM99Kq09tsqg8WZTFa9Rn3I2reu4q4fG N4OJsaBpqY+CARtmKCVis2rBM+Nu6IsJpBWkT5Ks/1DkZ0B5yUgeVRWIRBec58aoJO1Y jgachftsPVZaBN9Qe0lJtOCfpUAcZ8UolgJKwuwa9f7NrMLWd2mjWmmTFr0qFB3LSEa3 MBiJJZArSNTqAqqeHgdf9+0WljQ5cN0EZxqzq4SUvRiu8zjpd1zxZBwOlvv9LvO9kxWH PFjw== 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=tA1BBcYX4Y1N3MwIztdxFZ4m1NqbuWNvADZqqf+MBbA=; b=Nkql3UzkBjzy+VZQK79jODUJyaS9XfwZK6lqv1UyLKfjM0Rf5wGHb7lg/UyRzDApTE Hxl/ujhiU+Juw494jjUmTjNbhZpEJgmSSFRVdFj7IHnf6OVX4Hhi+QXSnDba8hqMTYBW qRwlUXatcETY3Tccf/K0dNSUCxV8Zr78CebfSEKSoiwCTGqsZz7Q42DFgZecrQuR0v4X RK4gtRLsDAPJ+V43zgiYuGIqA437jNkxwvCjfdVHeCwe1AAjAL0UNkrji0VlnoMhfAGn xxDuL1E022GHDikTxkj+TSvCZBrs6ZyTntNKq3rFxNwedoNXsYZXH4kZOL+14L1oN3C4 qxrQ== 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 y13si5449349pgo.327.2021.04.10.02.15.02; Sat, 10 Apr 2021 02:15:16 -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 S234528AbhDJJNR (ORCPT + 99 others); Sat, 10 Apr 2021 05:13:17 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:34074 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S234505AbhDJJNQ (ORCPT ); Sat, 10 Apr 2021 05:13:16 -0400 X-UUID: e9a457a8a2c541c7ade7cfe982a38b2d-20210410 X-UUID: e9a457a8a2c541c7ade7cfe982a38b2d-20210410 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 547846456; Sat, 10 Apr 2021 17:13:00 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 10 Apr 2021 17:12:59 +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:12:58 +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 07/16] media: mtk-mdp: Use pm_runtime_resume_and_get for PM get_sync Date: Sat, 10 Apr 2021 17:11:19 +0800 Message-ID: <20210410091128.31823-8-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 to keep usage counter balanced. Signed-off-by: Yong Wu --- drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c index ace4528cdc5e..93c9df15084a 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c @@ -391,9 +391,9 @@ static int mtk_mdp_m2m_start_streaming(struct vb2_queue *q, unsigned int count) struct mtk_mdp_ctx *ctx = q->drv_priv; int ret; - ret = pm_runtime_get_sync(&ctx->mdp_dev->pdev->dev); + ret = pm_runtime_resume_and_get(&ctx->mdp_dev->pdev->dev); if (ret < 0) - mtk_mdp_dbg(1, "[%d] pm_runtime_get_sync failed:%d", + mtk_mdp_dbg(1, "[%d] pm_runtime_resume_and_get failed:%d", ctx->id, ret); return 0; -- 2.18.0