From patchwork Tue Jan 3 11:29:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Lu X-Patchwork-Id: 13087625 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CDC65C53210 for ; Tue, 3 Jan 2023 15:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1aP7UfvDy2JKQ/qNkAVphfhskgfz/N5Epn2B+o4rqGg=; b=sGfZMctuK3bYPr cUsOEgelLjRdDlskWDK1jtvxvbgZ2rha9fLGm4efNQtlmWGqcHX/D2n2sXb9EhgdTZPDBg4gEUdrE YrzuxgtkoPa6xtWEfhrA5Qa+KhNzjIzYZeDKb+a7k5Jvvn79sRjNcRMzrco1rcj1pnGnuiIQgghqN Jx0KzAgu763NBKXQaLxVV2cU6RUOEI6AdI35ycf3e6pjVmyC+0M3II2htB9fYUy4faNLOdLYgs33b KKgZrDAnNLcN14cP4GbdfgnCxqS1Ij8h7Eey3tgZFzRnZ5zzQcj72M+EHIPhXotD1EkaOEwafRmT0 KS9eaY/U2mrFt8KE8RcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCjTe-002Zrp-GG; Tue, 03 Jan 2023 15:45:23 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCfVt-000yLk-Nv; Tue, 03 Jan 2023 11:31:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=khWND1a5Rv67qi9vjLgUZ2TaIXGaU8aXZECDx6Aj8Jo=; b=MVtkY3s+ILwJ5UGPfxyVd9viv+ nKP5HoW+6STZxrP+pW/GLxpakxTWQax3JMRXh/JMRsR92fOcU5DIrJoPNiDftm3TsrgGQHeuCYjeB 1tEs/QWbooZXDAhxf1k28ZRuQq2+ljKw7VNza7ByZTloYaiAtuJSdFsvhaZ/MD8QYTQ7+BkXgZWJB fd30bmoTv+BXWgNuLXEpv/mH/TV14EM2YQGkHaCX6z6frIVmaB8YC9ZbMABtuixiFWUrDSz4dEdvT /PvwHqm838/rucdEM+LFPvTKfRwUNjCIvHPYM0ssofPMzwKFetc+s51OjS/EL269aPybQo2P1FfIb o94NyMYg==; Received: from mailgw01.mediatek.com ([216.200.240.184]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pCfUp-000aBv-1V; Tue, 03 Jan 2023 11:31:18 +0000 X-UUID: 0829a150015f4a9dad47bb7f48b7a871-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:6f0de149-d051-4048-b88b-cb11e9e4a8c3,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:09771b1,CLOUDID:dd66aaf4-ff42-4fb0-b929-626456a83c14,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0 X-CID-BVR: 0,NGT X-UUID: 0829a150015f4a9dad47bb7f48b7a871-20230103 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1176268553; Tue, 03 Jan 2023 04:30:03 -0700 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 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230103_113024_319402_5393E1DA X-CRM114-Status: GOOD ( 12.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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;