Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6837221rwp; Tue, 18 Jul 2023 06:37:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlF6s33z+ycZ8RMOD57KQl2A7Yt94Pt+MmrqRLzWbiFsDcXWY8MmtWp7SebTW/trhKlEvboa X-Received: by 2002:aa7:d842:0:b0:51d:a6e3:81f4 with SMTP id f2-20020aa7d842000000b0051da6e381f4mr12354314eds.10.1689687470218; Tue, 18 Jul 2023 06:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689687470; cv=none; d=google.com; s=arc-20160816; b=pdcy64X41/3zMxH9jb3BdmgYPM1+Cn5wKx+CLPloYBBfKkkcxXcrIKa10edR/zcn2u vaefnSKGL7qx71v/T0CoEJ0/YOE5bbG2LMcEPGIav78zlZiAuOIzphoDC4gtuJbk0r78 Ddc5QsDlSwqUGhZRAzKSvNTUyjznyUdmM2gftoezCIae8WYT+4CrxJ+JQkzwuk8Db0yF Bt8X6qTwkx5yegsdbVizj8kNs9fQW6KTqQQ9dYYx6THAKywnawtwXvAPVUPrWuetCEoj xhvcJUU2n58pbvE/E8E9NbgtfuZQP9Pzj/Ff6aUlZoa0kaDY5eZGmM1Cbzo8fYrYX5CR /7Aw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z17-20020aa7c651000000b0052177d89138si1247479edr.614.2023.07.18.06.37.26; Tue, 18 Jul 2023 06:37:50 -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 S232814AbjGRNaM (ORCPT + 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 ); 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 ) id 1qLkm2-0005c5-06; Tue, 18 Jul 2023 15:29:54 +0200 From: Johan Hovold To: Bjorn Andersson Cc: Andy Gross , Konrad Dybcio , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Johan Hovold --- drivers/clk/qcom/gcc-sc8280xp.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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; } -- 2.41.0