From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FCE38481 for ; Fri, 10 Mar 2023 14:04:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0690AC433EF; Fri, 10 Mar 2023 14:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678457095; bh=+0x302HVA94pD7u0OKvIqfzTRP+nx4DiV6FamS1tsgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rQ8FomFhLHh89JSbnbtKY/5ednsMiZcQFbtH9LwK6p8Bv8ng4TJm2jBIbEaPwkv1F iQ+/lctuRhlzsxUPemNI8+EasWd+euSEMawGPFOR1BsenUyoZauWpzBhx+zL/ibFnm 3hiHBo+drn3aOVNA3MQjujVkmrTVdlTilX/LZ6zo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shang XiaoJing , Roger Lu , AngeloGioacchino Del Regno , Matthias Brugger , Sasha Levin Subject: [PATCH 6.1 019/200] soc: mediatek: mtk-svs: Use pm_runtime_resume_and_get() in svs_init01() Date: Fri, 10 Mar 2023 14:37:06 +0100 Message-Id: <20230310133717.629894530@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133717.050159289@linuxfoundation.org> References: <20230310133717.050159289@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Shang XiaoJing [ Upstream commit 37fa2aff8fe490771f2229b0f2fcd15796b1bfca ] 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 Link: https://lore.kernel.org/r/20230111074528.29354-5-roger.lu@mediatek.com Signed-off-by: Matthias Brugger Signed-off-by: Sasha Levin --- 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 e0b8aa75c84b6..00526fd37d7b8 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.39.2