Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11701634rwl; Tue, 3 Jan 2023 03:32:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXsNaQr6WfD6TkyIrov23/zbJzE+LOGf4ArVaIQNjF8036xZhuOXK1Gpxn7n+wuHgveG7i/Z X-Received: by 2002:a17:907:a50f:b0:7c0:d609:6f9b with SMTP id vr15-20020a170907a50f00b007c0d6096f9bmr40962341ejc.27.1672745554439; Tue, 03 Jan 2023 03:32:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672745554; cv=none; d=google.com; s=arc-20160816; b=EvxatQkBz7DgIDFXecJ54oTztPa8PUBqKQUB7FMNsq1A8EQQldssMHPTMLq5IUdrGy 7Y/7TA3WzC2B9nxQjjeDFZyzoFyzdctFwU0Ddwj92AfAdHkM4wub6pZ/GO8av49cDbLw gbYnHjkQ9afgNcpdPaD+I4urirwMPoSfTTv0igTWB/+9ly8cWcDlYtcLQj6K9o59TPVo UQuOt1Tkw75YrTwRtk4JmuFUqh67Va0v5MSkxULdBAWUxPoLvNyweBvvzHCkT2qY4TvV iX3hNPHv116vQ8WnA0kxYXhylQF7nLoV4cNOiXgi9ny5CHMAYyJcHD3W+8zLE7LsBJi1 LC0w== 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=khWND1a5Rv67qi9vjLgUZ2TaIXGaU8aXZECDx6Aj8Jo=; b=lHOMQ6oJeoSNDzlo6Mbahmv2XAXwmkl9PG5+Sl5A6p2OQSwtCxzHpPhGcbpJ2R7mkc hd1KA7lRW2LvIymUconVcR0QnR1P8hV880L9zf3QJTIyBnRJe2i+1QrVYRzfWTxG6b9e DaLha2WQrVHYfR4xyHy19dHryd1p+O03eHppr8CJ1MvACC4LZGTOhGR8AvRrrIvgvC8u BJI61ZQFUvJfgsIjkts6agkjL+itobh2LldaH9DbiDzRE2e3A5H/XWqlqnlOuvLkobw8 aqt56nwgVcoAWRSez6UWOH8HVfNmFaR7CmiO1rqMb/xRPOgb3wFK5d4WrfnI2BTTpOoV ifSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Z2SeTwxW; 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 ji5-20020a170907980500b007addbdb9fbbsi28934065ejc.558.2023.01.03.03.32.20; Tue, 03 Jan 2023 03:32:34 -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=Z2SeTwxW; 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 S237424AbjACL34 (ORCPT + 61 others); Tue, 3 Jan 2023 06:29:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237433AbjACL3n (ORCPT ); Tue, 3 Jan 2023 06:29:43 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E3F3FCF6; Tue, 3 Jan 2023 03:29:34 -0800 (PST) X-UUID: ab98134abf474af48af11d3afea3b3f1-20230103 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=khWND1a5Rv67qi9vjLgUZ2TaIXGaU8aXZECDx6Aj8Jo=; b=Z2SeTwxW8KAXGYEwx6MkuzmiEB6PyLsNWC75EKBtFoBhohzcvXAQSLfv6IHCwm6HBDTB+magGU0GHDmPiAjBwB4rj4r63ZvJKJZ3kF15oVJJzF1fPNpaHBudB3/N5KW5cRklETZvX7tQ16i7rwBkLPepdJtty33LtvNuOzy+b80=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.16,REQID:ef957f4d-cdda-4fc9-a75b-88c6536aab97,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.16,REQID:ef957f4d-cdda-4fc9-a75b-88c6536aab97,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:09771b1,CLOUDID:349e1b8b-8530-4eff-9f77-222cf6e2895b,B ulkID:230103192928HO05TDYF,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-BVR: 0,NGT X-UUID: ab98134abf474af48af11d3afea3b3f1-20230103 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1270680333; Tue, 03 Jan 2023 19:29:27 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.186) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Tue, 3 Jan 2023 19:29:26 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Tue, 3 Jan 2023 19:29:26 +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 v3 02/14] soc: mediatek: mtk-svs: Use pm_runtime_resume_and_get() in svs_init01() Date: Tue, 3 Jan 2023 19:29:13 +0800 Message-ID: <20230103112925.16554-3-roger.lu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230103112925.16554-1-roger.lu@mediatek.com> References: <20230103112925.16554-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, SPF_PASS,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 --- 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 91e06f43969d..465b60a5cedc 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