Message ID | 20230718132902.21430-5-johan+linaro@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1764356vqt; Tue, 18 Jul 2023 06:58:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlHHuEJqZ8B55Q8zDn2ZGwTcqIDIbVTBCHjRsolMNmsEdKlhu2WwJ8+xBFbJJFumibVhLzAV X-Received: by 2002:a17:90b:1001:b0:25c:1138:d97c with SMTP id gm1-20020a17090b100100b0025c1138d97cmr13211802pjb.24.1689688709264; Tue, 18 Jul 2023 06:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689688709; cv=none; d=google.com; s=arc-20160816; b=H9oyMZ9dEfDTbfduBK9rdOFnss5mxZ8tkOluOvrpXPyr1ovpjdUprmIpiFhAkb5Mbq K+NdUl+av2+E7bFlWw97VOuBXdcO4GSYuY61twBYeOX4rwvOzJndoYW1Ylsh1ujqCxd2 mc4oqjG7arpmJB3hFvyZkinN2J4GLMJTYfsTToiQr+znlnK2Okv9+YuYXmuWIIOSBV1N /pY90j1xXU3R3l+ueukCmD4qJhCeiYcDCXiT9qTVChoJsCqbLvCqZtTPdYmt52zb8cvk Vd0YeJIpyw6cyTQq+qVIG3Bpmc7alb+ohtaqKS7eCVwwnQBIMLfL8nzUcinu1tuleobq e3bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BFtli9b62dQ+beegifci4xFvJojSnWf+rMlBOTc0dBk=; fh=7kBJBtNcZFXuonY74qoiyYLygacMPxugZs/wayStSm0=; b=YfE7WqX08OE+kt0vMElRLAc88t5SeTSS9wFLoyXhd6TBOH/jXvjZ/Owz/uO3uxnIUV 2jPTHys8jDjbP+MqlQ5dEdxqRgW2sC6K10owN+9bsEuTHiynWw9dP+XXdmJ+wj53aSug 2kN+kc4kGSmGfdLDTM5gbEvo6MtA4h9u4Kq1tVMWg+XjSD3hcGNpCOqlYASHBUsT5ylj 8hjEb2RmbdoMzpmkY1agUvBVM2AuRbrEZmL9wWeTKEKiSnjcnH22rFenqcXVlOJ5mBti 09zHGLAWUutT2evNNqnoU2lRwDGODHr5KqFGAXxkuvoHHj3ZaHJ8ZM4tIuAtvwxzD+vd RQUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YmIIeasD; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mh15-20020a17090b4acf00b00260f28b14e4si7894389pjb.4.2023.07.18.06.58.15; Tue, 18 Jul 2023 06:58:29 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=YmIIeasD; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232819AbjGRNaM (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Tue, 18 Jul 2023 09:30:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232753AbjGRN3z (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Jul 2023 09:29:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C227124; Tue, 18 Jul 2023 06:29:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5BDAC6158D; Tue, 18 Jul 2023 13:29:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5ACDCC433BA; Tue, 18 Jul 2023 13:29:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689686984; bh=YujBf+tSBimSZNEfZhDQx4wRVWWIF1I4fAuUh7MYhGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YmIIeasD+VaC2Xfn+NQv1hEgjLN+EocrpSUkbost1LU6y29N7ZAZig7/5AukCFMkA RXcIis9R8tIbzePesSTgpwH039Mk7WAoW7hL7ZWg/N26/tDkP/oIQMHHQ4I88Zje21 NrkuxsG8wplGmK06mjd1s0+C3WyrkEiQOVE9iFWcGABjL8Kao/mxfczHs562zcPc0v WH8kXwXFEBisOl//Rch6Ht83H9lIRJdmd8c3soTyHRJPOzheqPtIRl0+9EAqXnAxui kH1qbwb5SeWqxGTG+MJCzUQQYfjFDHowtyPaOJ5f7621J23QjI9GuWsKlRy3Vb2uMg 1DcMSarGXWHgw== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from <johan+linaro@kernel.org>) id 1qLkm2-0005c5-06; Tue, 18 Jul 2023 15:29:54 +0200 From: Johan Hovold <johan+linaro@kernel.org> To: Bjorn Andersson <andersson@kernel.org> Cc: Andy Gross <agross@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org>, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold <johan+linaro@kernel.org> Subject: [PATCH 4/8] clk: qcom: gcc-sc8280xp: fix runtime PM imbalance on probe errors Date: Tue, 18 Jul 2023 15:28:58 +0200 Message-ID: <20230718132902.21430-5-johan+linaro@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230718132902.21430-1-johan+linaro@kernel.org> References: <20230718132902.21430-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771767028230536122 X-GMAIL-MSGID: 1771767028230536122 |
Series |
clk: qcom: fix runtime PM bugs
|
|
Commit Message
Johan Hovold
July 18, 2023, 1:28 p.m. UTC
Make sure to decrement the runtime PM usage count before returning in
case RCG dynamic frequency switch initialisation fails.
Fixes: 2a541abd9837 ("clk: qcom: gcc-sc8280xp: Add runtime PM")
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
drivers/clk/qcom/gcc-sc8280xp.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
Comments
On Tue, Jul 18, 2023 at 03:28:58PM +0200, Johan Hovold wrote: > Make sure to decrement the runtime PM usage count before returning in > case RCG dynamic frequency switch initialisation fails. > > Fixes: 2a541abd9837 ("clk: qcom: gcc-sc8280xp: Add runtime PM") I noticed you merged these for 6.6 instead of 6.5 as I had expected. Note that I left out the stable tag here as the offending patch was merged as a fix for 6.5 and I specifically assumed this fixup would go in as a fix for 6.5 as well. > Cc: Konrad Dybcio <konrad.dybcio@linaro.org> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Johan
diff --git a/drivers/clk/qcom/gcc-sc8280xp.c b/drivers/clk/qcom/gcc-sc8280xp.c index 1fb6ffac730c..ac6f8c0c1ccb 100644 --- a/drivers/clk/qcom/gcc-sc8280xp.c +++ b/drivers/clk/qcom/gcc-sc8280xp.c @@ -7539,8 +7539,8 @@ static int gcc_sc8280xp_probe(struct platform_device *pdev) regmap = qcom_cc_map(pdev, &gcc_sc8280xp_desc); if (IS_ERR(regmap)) { - pm_runtime_put(&pdev->dev); - return PTR_ERR(regmap); + ret = PTR_ERR(regmap); + goto err_put_rpm; } /* @@ -7561,11 +7561,19 @@ static int gcc_sc8280xp_probe(struct platform_device *pdev) ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, ARRAY_SIZE(gcc_dfs_clocks)); if (ret) - return ret; + goto err_put_rpm; ret = qcom_cc_really_probe(pdev, &gcc_sc8280xp_desc, regmap); + if (ret) + goto err_put_rpm; + pm_runtime_put(&pdev->dev); + return 0; + +err_put_rpm: + pm_runtime_put_sync(&pdev->dev); + return ret; }