Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp269813pxb; Sat, 10 Apr 2021 02:13:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwK87XsTFznU8W2AhO35XaPzrHF3DdRtnqBxOsFMfXSeZLlk6yXHbbsmmDsDXZlxsoERiGX X-Received: by 2002:a17:90b:1b4e:: with SMTP id nv14mr14904753pjb.228.1618046025472; Sat, 10 Apr 2021 02:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618046025; cv=none; d=google.com; s=arc-20160816; b=wX/1qVW/1itP3RREkeq8lnMrMITmVokJ0vFFAkdurNhx23LXpP236tfE5Q7njlZoHW 3O5kmmujGWT5Xx75+8BWVpapT4u6r3XEGfjbIDybdRjMBnl316u8CUF16y7MNos73r7u IeQWkQiBbt9gl6VExoW+meYwA/M2lZubm2n1IxFSARNTyag5F+g60wKRx2V1lQF0CvT/ 1hqei24o1Dpr9TuyamFkT3KGQxKgOSrOxSR5d/9nwmG6Ttpv4O1ACOcfJT76Qav+oWJG wxM0UUnZFbOtCbhqfOpJ96kGFWXmjTsYLwQR6vzQ3QRkByBogS1k7oOdEAgLKzsJ7iAx tR/A== 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=e0rc8wt0xtBZDoEW5RN/xgjAL0g6cluhuZTqFafJsiI=; b=VgRAM6nQn5Q9TfA+2C/1Sw6uUMpiqe0CYgkMzA8dQzNNXdFr+tD9gTF4jzAm7quBTt y8xOvFQrDF4r8tE/8xqdf7Cf3Nc8zp6l0ZRIFEGc8VVJoNDADF6rKoN+p+PKMqV48tYk cB638/7sT3NygrOADrD3oxsd2cx7IY/D/vRIVsMMNZVUICal/3QAkZjUABnnrTc2ie8J F2P3sWOEHd405BL8cO2KHyBxPkaYjjAv3NqmG70dkUerSiBpS2PTTR1OdVpB+PcOzMVX ArkHnEQvbaLOPCzF2GOdVl39vCy0EpgrslSAIMAiASaPbFNXzJq97JVzZyG0vNzOFa5z ijQA== 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.13.31; Sat, 10 Apr 2021 02:13:45 -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 S234479AbhDJJNB (ORCPT + 99 others); Sat, 10 Apr 2021 05:13:01 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:38067 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229591AbhDJJNA (ORCPT ); Sat, 10 Apr 2021 05:13:00 -0400 X-UUID: 890f131c9c0a48b0bcf62488e3357ed4-20210410 X-UUID: 890f131c9c0a48b0bcf62488e3357ed4-20210410 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.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 495704945; Sat, 10 Apr 2021 17:12:44 +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:12:42 +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:41 +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 , , , , , , , Xia Jiang Subject: [PATCH v5 05/16] media: mtk-jpeg: Use pm_runtime_resume_and_get for PM get_sync Date: Sat, 10 Apr 2021 17:11:17 +0800 Message-ID: <20210410091128.31823-6-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. CC: Xia Jiang Signed-off-by: Yong Wu --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c index 88a23bce569d..a89c7b206eef 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c @@ -920,7 +920,7 @@ static void mtk_jpeg_enc_device_run(void *priv) src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx); - ret = pm_runtime_get_sync(jpeg->dev); + ret = pm_runtime_resume_and_get(jpeg->dev); if (ret < 0) goto enc_end; @@ -973,7 +973,7 @@ static void mtk_jpeg_dec_device_run(void *priv) return; } - ret = pm_runtime_get_sync(jpeg->dev); + ret = pm_runtime_resume_and_get(jpeg->dev); if (ret < 0) goto dec_end; -- 2.18.0