From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75740C64EC4 for ; Fri, 10 Mar 2023 14:05:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231544AbjCJOFV (ORCPT ); Fri, 10 Mar 2023 09:05:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231610AbjCJOE7 (ORCPT ); Fri, 10 Mar 2023 09:04:59 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DDE910CE97 for ; Fri, 10 Mar 2023 06:04:58 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BBFB0B822B4 for ; Fri, 10 Mar 2023 14:04:56 +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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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