Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp270076pxb; Sat, 10 Apr 2021 02:14:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYDduQ0hK2jzx+/VQTTx+aOAKZz5IbgQKsZ6jR/75hmcneiDesTeOiEWRYqtOLGvbg9MJR X-Received: by 2002:a17:90a:6282:: with SMTP id d2mr17089847pjj.168.1618046061183; Sat, 10 Apr 2021 02:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618046061; cv=none; d=google.com; s=arc-20160816; b=dW0p1vumclHckpsYQjV/oVbkVGyghmnAzaWAtXt9Kdf8UgYZQMTi/R9jjm/CGIV5x1 WU1IXCTybz3McXYa8V5MiCAWkgdYhliyclzXqHOFkmydbL28a1I9qIi4HdJC4M6Glpxs dsPtKcCaD1MV89xrHYGM5dqfnWjC2bRy5LFFvyQ8369L4agctdh5XXLXBZi56kKfm4Dx tdR2C1lvMRO5C6yFf7hHkRfbPhhCnq0Fmii1wYM5WShUsIKXU2HwSC7RhT2MeZp78j1z fDkDjW6YRtoM2IBAC2QAU0setAXSb+gx2JtkLenna2SZz78hIaYfkFUwB6bjH7S776BG sdKQ== 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=Ew6/5GR/tZHasGP7ANOftctYKH3BPsuqXsQnPtXzsUc=; b=SppBWn6cZToAkxy9JQYH6E2OtZLaG1AqVVvTF8CJLNxtT5xTENhYI3flYU03Q4y+XI NJKB/AOq9LeKM51esOERillsJHfZaRNpnRx+d4ge89oTiLweOYveaV6biaHwZt3KrGuY CJ9CM3cC2D6RC+aZNLbHKZ4LJcvmdynu94LEmEGkMAL2sIjtEvVI/lqUVdLMgFXubyin AXYv2GNaBnytHguqAXJGP31MdOo5Rpz1arhguANQtI1cY3Bl7KLC+H/8dth+lcJvorOm tIOPT1ZnA7bRy3YMXL+/KgToqB8YJxznMpXGiDctXNLqxWCqk/T5KN2vkl0e38g8yJ4G lLQA== 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 z4si6120071pgu.473.2021.04.10.02.14.08; Sat, 10 Apr 2021 02:14:21 -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 S234569AbhDJJNm (ORCPT + 99 others); Sat, 10 Apr 2021 05:13:42 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:34302 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S234180AbhDJJNl (ORCPT ); Sat, 10 Apr 2021 05:13:41 -0400 X-UUID: 4c2078a3667c4e9eb62e9498c17e483f-20210410 X-UUID: 4c2078a3667c4e9eb62e9498c17e483f-20210410 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] 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 1153496210; Sat, 10 Apr 2021 17:13:23 +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:21 +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:20 +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 09/16] drm/mediatek: Use pm_runtime_resume_and_get for PM get_sync Date: Sat, 10 Apr 2021 17:11:21 +0800 Message-ID: <20210410091128.31823-10-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/gpu/drm/mediatek/mtk_drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index 8b0de90156c6..69d23ce56d2c 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -259,7 +259,7 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc) drm_connector_list_iter_end(&conn_iter); } - ret = pm_runtime_get_sync(crtc->dev->dev); + ret = pm_runtime_resume_and_get(crtc->dev->dev); if (ret < 0) { DRM_ERROR("Failed to enable power domain: %d\n", ret); return ret; -- 2.18.0