Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9016309rwl; Tue, 10 Jan 2023 23:47:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXtnWRgDzdnPcRcb2CDUWhMG++3VLnMl9f+PptisymteBrYs7Q/DN1PMl5nczpew/UD7KDNe X-Received: by 2002:a05:6a20:65a7:b0:a5:df86:f0e1 with SMTP id p39-20020a056a2065a700b000a5df86f0e1mr1640544pzh.16.1673423249557; Tue, 10 Jan 2023 23:47:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673423249; cv=none; d=google.com; s=arc-20160816; b=qiEPR6pRb0kO26+P7k61X8PFiDMc3UapJJHViEVuyMI3Q4focWKIk8ZQ+QtNsGSYt/ E7XBeH8j1F/jA8n5KBCRPX5llc7pkVGoiXMawM5chuXr0lr2P2iAsnS5tAKUhfTHlCrO AB4y+85Sluk3o7083pnQXqU+iACbLJfTUu2whSAQ4jgpcMEYk6fWpyKsj/76M+sPpGZk 1EGnjYpWPTxaIQfxJqp7g34hhqBjVdPoXrmYLAt2PoBjwC2xPAj+TUO2N+VoFJSJKnln HIvNHeD/Hd0ObRjXbzDo6O8o9LZFKQqYukuuo4t1LajfEVUjlrwQmOfkwbYSZ2IKzAet IzKg== 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:dkim-signature; bh=GpAVRdKmPCJB+eqPlLvOn5dYDHQByQrs9wR5uRU5q9Q=; b=E2AiuCt16AkudoTSaZ2JkRLEQCbzLF1iSVL257hBelvrxd1j/kNKWuQzayOxQxtqde Sa0MdQ3LmZAKoXFi4PkOjZS1X5kDR+9Pl7/tOUHK9EcSZJByXnV5dbGdvGLHjV6SEeWB n2oum/6bVJHyGW7X/4+bdYeUrpT0P99p1XktkhSOWFwLML2wMiGmRRwF+ZM6ZQB1PCt8 QrCcA0IqWhIjQRUYE6S64qGPNeh8G3hayQbvDNYSpmVvHr1478FdWEth4KTq3zgRrRRt vUHTXY9sWy61LAct+2mV8N8Bt+Z9ZEfPgTsNGuSwM39P26ckUvXSKyqMRc8bEQpzECPF WXHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=gTI6nlO8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n64-20020a632743000000b00477f864cf87si14318937pgn.24.2023.01.10.23.47.22; Tue, 10 Jan 2023 23:47:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=gTI6nlO8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235933AbjAKHpv (ORCPT + 53 others); Wed, 11 Jan 2023 02:45:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230124AbjAKHpn (ORCPT ); Wed, 11 Jan 2023 02:45:43 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66575B1F3; Tue, 10 Jan 2023 23:45:37 -0800 (PST) X-UUID: ecc1b434918311eda06fc9ecc4dadd91-20230111 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=GpAVRdKmPCJB+eqPlLvOn5dYDHQByQrs9wR5uRU5q9Q=; b=gTI6nlO8UraYC5ZKxNx5qcpcm4dkodeEkBu2BLwCqNHealy7Nu+Y3UD/ATsMPEHeHREUVChLOy+z3MXgIWOfxAM475LX6D7ljVNbNRsX5enfAzxaCaUvEzzb7I4RY00AyPKpHnz59FwOIx2w1bTRRoqrfdrLo+IqTLhvOYK8r3w=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.17,REQID:76e3ebe8-ebe1-4f37-99c4-d21f21a84690,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.17,REQID:76e3ebe8-ebe1-4f37-99c4-d21f21a84690,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:543e81c,CLOUDID:72ac5354-dd49-462e-a4be-2143a3ddc739,B ulkID:230111154534DUGPMU7I,BulkQuantity:0,Recheck:0,SF:38|28|17|19|48,TC:n il,Content:0,EDM:-3,IP:nil,URL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0 X-CID-APTURL: Status:success,Category:nil,Trust:0,Unknown:0,Malicious:0 X-CID-BVR: 0 X-UUID: ecc1b434918311eda06fc9ecc4dadd91-20230111 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 84763474; Wed, 11 Jan 2023 15:45:31 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 11 Jan 2023 15:45:30 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 11 Jan 2023 15:45:30 +0800 From: Roger Lu To: Matthias Brugger , Enric Balletbo Serra , Kevin Hilman , Nicolas Boichat CC: Fan Chen , Roger Lu , Jia-wei Chang , , , , , , , Shang XiaoJing Subject: [PATCH v4 04/14] soc: mediatek: mtk-svs: Use pm_runtime_resume_and_get() in svs_init01() Date: Wed, 11 Jan 2023 15:45:18 +0800 Message-ID: <20230111074528.29354-5-roger.lu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230111074528.29354-1-roger.lu@mediatek.com> References: <20230111074528.29354-1-roger.lu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shang XiaoJing svs_init01() calls pm_runtime_get_sync() and added fail path as svs_init01_finish to put usage_counter. However, pm_runtime_get_sync() will increment usage_counter even it failed. Fix it by replacing it with pm_runtime_resume_and_get() to keep usage counter balanced. Fixes: 681a02e95000 ("soc: mediatek: SVS: introduce MTK SVS engine") Signed-off-by: Shang XiaoJing Signed-off-by: Roger Lu Reviewed-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mtk-svs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c index 64d4d03ab71c..9575aa645643 100644 --- a/drivers/soc/mediatek/mtk-svs.c +++ b/drivers/soc/mediatek/mtk-svs.c @@ -1324,7 +1324,7 @@ static int svs_init01(struct svs_platform *svsp) svsb->pm_runtime_enabled_count++; } - ret = pm_runtime_get_sync(svsb->opp_dev); + ret = pm_runtime_resume_and_get(svsb->opp_dev); if (ret < 0) { dev_err(svsb->dev, "mtcmos on fail: %d\n", ret); goto svs_init01_resume_cpuidle; -- 2.18.0