Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5065793pxj; Wed, 9 Jun 2021 08:23:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpy7a/ynsUxYfP8kMYRu+5lWEuRjDrwVprrVzEQVnYV8+LnWKbOSbRb8WJMz8nvEO/XL7K X-Received: by 2002:a17:906:2988:: with SMTP id x8mr451250eje.122.1623252225179; Wed, 09 Jun 2021 08:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623252225; cv=none; d=google.com; s=arc-20160816; b=sE6zvZqrSme9a6h4GHo7pENPZBIBLVyO2caUJJoIfptknmV4N3LWlx9go8fSZ2nSJ1 WawjP8hBwFJbJh1mlpG7TJVBsWHq/HSuUFPxR5EwUyLy3VVv9JfqTr+kwaYB8+CQAMnB gNu9nlmY/xA6sgI3Tt9nZ+6cjuA3wMz60qAt/0CtSxf9ztvO2gGP8sv+8rUEXjhq/gSv Lwf5Ot0JZqMhFV4euxthVa7hWwL/loO2J18SEdmGcrf070d8fOi3Axa7JZUfqta5rjtB KxifSbYuUTLq/rtMvlRsUFUZxVacI1emW6P55pFWXpsKtTpZgQyTnuCbT+0XHi/93T8S +MvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=2XtC26dDQI+8z2NBND3LcVHi35tPI4TG6eO9es29Zac=; b=fNLPOV95h7cqt4C9k0ZWAIRMEY/pUCjQ0VfPhWMaK/F5Scw78/+50mQZ8jGLrQnxbh Mzy1s4jOr7TKyTf4+ahVFwmxeXJPQJYkpF33397klR6g8yg1Ordc4h/x0br7DwIIepcz Vee5hC0KDVhxeho/yf56CNEXH+zuUa0DfAaPTtSYjkPSMR01STldVDJhYQZcqy6m4w/r eAXPHL3PdXBHYcYdG+ed0zu3luxbIxkSQeyUF5Za3RjV2tM6Q86mwTFmULcfYv7n+guu PFkhITlj1qz5CYE4qW+CZ0X+R2mPydOKkDzeHpLsT/87OXtna/dU8I96hIinxfJcwJ6l d1vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DzJMNm+3; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g21si20284edw.335.2021.06.09.08.23.21; Wed, 09 Jun 2021 08:23: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DzJMNm+3; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234237AbhFINk1 (ORCPT + 99 others); Wed, 9 Jun 2021 09:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230297AbhFINk0 (ORCPT ); Wed, 9 Jun 2021 09:40:26 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BF63C061574; Wed, 9 Jun 2021 06:38:17 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id h3so4033882wmq.3; Wed, 09 Jun 2021 06:38:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2XtC26dDQI+8z2NBND3LcVHi35tPI4TG6eO9es29Zac=; b=DzJMNm+3h04RwqPbHWExMNYCF+kaN1b1pLrOfQW7uU+gGHoukXnx3AUoHcpShlEZO0 G71QT3Yq2vT78oEWlHeQbmVZbe6WM94LtTSdjT/VxIglyPKyK3Q2T/JDNndT0yPXJsLv dzSJJGkGwPqQfbRaTULkHwERsRxu0yYuZnTzhu1Xntt4qzZgrVQnNR77xZGHBK9l9stF BXbE4iv+o0YLeRS2xXM1E2//e2UMHJyrgFdOtBoiyUlO/bQ62I9kCR/NdZq1THpFdIzK 9DCO2qzA06o/FOLDmZ7BKKEoefE45EM+fOjGHTirVfQMUhogaiE+NoMOAtVlA0BO8b+B FG7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2XtC26dDQI+8z2NBND3LcVHi35tPI4TG6eO9es29Zac=; b=JqlWxbF557ux6akCF4b6rFlbiCJ2yvCQOGTSDYJo1yF2kB4rli+OZwk68WaJCfGNLG 3RMbQE5i8QqNDXs830vcqHY2cZMNzHWyNFd5syfhdyWSHo7I95d0jJ6KRMEGcKPueyzB Q42EFtEEbH+7xZE7GbbjWjFRWUGauKxwgpbmRxISjtkawNF3ymVXVNtgyjCv2lazwIVB FNvnnlL+MruSbAZJKAwAhNVnDaxopxS3eFIW4dyKh2UBb58Ic1Eq9ZI0k+lLlyKNpc0U FG3MRBrnQSHkbOEBENJZfPyVKlfkmICXrm1td0J0761h+cTLNkdjjkPeJsSCJIv5VydD q0ig== X-Gm-Message-State: AOAM533aUxhUdz8ZHRKKH3xFXKSiWBoj66cvU5SXt9z9jENwBikkiYuW JUNOvXZozF4B5yiTnYSFx+I= X-Received: by 2002:a05:600c:190f:: with SMTP id j15mr10147185wmq.4.1623245895818; Wed, 09 Jun 2021 06:38:15 -0700 (PDT) Received: from ziggy.stardust (81.172.61.185.dyn.user.ono.com. [81.172.61.185]) by smtp.gmail.com with ESMTPSA id u12sm2793979wrr.40.2021.06.09.06.38.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 06:38:15 -0700 (PDT) Subject: Re: [PATCH v5 05/16] media: mtk-jpeg: Use pm_runtime_resume_and_get for PM get_sync To: Yong Wu , Joerg Roedel , Rob Herring , Krzysztof Kozlowski Cc: Evan Green , Robin Murphy , Tomasz Figa , Will Deacon , linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, youlin.pei@mediatek.com, Nicolas Boichat , Matthias Kaehlcke , anan.sun@mediatek.com, chao.hao@mediatek.com, ming-fan.chen@mediatek.com, yi.kuo@mediatek.com, eizan@chromium.org, acourbot@chromium.org, Xia Jiang References: <20210410091128.31823-1-yong.wu@mediatek.com> <20210410091128.31823-6-yong.wu@mediatek.com> From: Matthias Brugger Message-ID: <82aea4aa-0007-369d-9c0d-db0077471b80@gmail.com> Date: Wed, 9 Jun 2021 15:38:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210410091128.31823-6-yong.wu@mediatek.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/04/2021 11:11, Yong Wu wrote: > 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 Reviewed-by: Matthias Brugger > --- > 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; > >