Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6840864rwp; Tue, 18 Jul 2023 06:40:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlFaX0mrcSZeqWTzZfoaB2r6214V7kkCA39CzoYcVxEx4PeZ7L1aFjVi6Wrt4nC/lanwbFPd X-Received: by 2002:a17:903:32c4:b0:1b8:95fc:d11 with SMTP id i4-20020a17090332c400b001b895fc0d11mr14732776plr.40.1689687638113; Tue, 18 Jul 2023 06:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689687638; cv=none; d=google.com; s=arc-20160816; b=Sq4bFfU3VcQOa2BJfUOOhm7JBdERdwAXC7vEwYnHjA36PV4PLhqWmyF/YGXtvgIJ4V P2qcEOpaqsXW/uZ/B3C03YlrV6morzuZPUvTSZqbkQNlSF4TVXA05IGMSDz2RTgZJDAp wDhZ7r7kVbNOQcm5CW1G+zfcRw2u15KIfTdDK9fEe5NGYvDxiEgqzW6a4v0us03q9r/N PooU+E6fv1Nk136X558kqizcQcGxdPYpmcL986odlDaqWs5b4mH0tNCQ1bekGB64Mw2a honI8OvwVeeWQtpSjRUuf8VCHjWNVTd73l4SPd6FQNYSd3XIcwm+XBcusQdWflsFxw93 Fu7Q== 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=ZlCJviNLYG6hlWtZAzbNv2qr8SWyzmlQgBF7S4TsFQk=; fh=i8hZpya5OQPc1IlyEhTYLOfdvrvG1EVovjAmi07tuaY=; b=aEYfQAoxv9BuTHpFGSftpwaaTcD0KVW/HoUo3E32KAfLE2LXgaKrlItRxRbUENGjkv wb9cbY9uRHjJQSCmLosudzXhFwB8ECIHaANlX0v9e7PE37GvTGr/wHF5uDRb1MUs8KkK h+EcgE4qMdBAjYKdDFUsBqcmvaLnLIJngkBt+Ht4nitq3qCTc1XMH773sp9xLvrLL5BJ +G/LjBFPqK7pzJdujn1lb1UIHYrfwYb/uMk6ApjutUCUe0SzSQxWT+bFb/X0LiBqYBSE wB9yODBWN8i366LbmOpXiGDJYS7MhjcUCc/JNPDaNs9Rl96vdD+Pg9EkYrwruYEzwWra a6IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QST1OR2s; 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 z13-20020a170903018d00b001b88f151c9esi1693102plg.123.2023.07.18.06.40.25; Tue, 18 Jul 2023 06:40:38 -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=QST1OR2s; 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 S232572AbjGRN35 (ORCPT + 99 others); Tue, 18 Jul 2023 09:29:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231962AbjGRN3s (ORCPT ); Tue, 18 Jul 2023 09:29:48 -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 B8D0D19F; Tue, 18 Jul 2023 06:29:45 -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 03BC361591; Tue, 18 Jul 2023 13:29:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59EBEC433B9; 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=ecVYnAz0cWZ3OaKV2gjx4miXZSzU9O9arS/8lcFdJBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QST1OR2s6blNS/2Z6esD3ottRlgKKnvm6dcfBikoR9Vjx+4tINQvUT60oAcSE/YmJ R3c3XF6/Ie0aFXBIk9b2mGFsYdGWWzQEdrU343AGJPRxW0NdqxI9Eyxv+u8TtETtCb GKNvs2S3o0nRl9b6oOqaBso9mwIHsOvPtnCBl5JStVbo4BmY0yQtM1LSbSjdz/kpDE mTvavJIpgzpRo1RBqHPqVaj5UIXsXqa4RF64c/xwOhdEeLqUOvA2WpGolCywQ3Jad/ QfpY9lS5LhFq0WNFpQGPAuXbf3iqB3lkKEVjxvRFlWJw8KA17p5fjT+z/x9/mUFzGP NSxTPRuuBE9pQ== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1qLkm2-0005c8-0K; 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 , stable@vger.kernel.org, Taniya Das Subject: [PATCH 5/8] clk: qcom: lpasscc-sc7280: fix missing resume during probe Date: Tue, 18 Jul 2023 15:28:59 +0200 Message-ID: <20230718132902.21430-6-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 Drivers that enable runtime PM must make sure that the controller is runtime resumed before accessing its registers to prevent the power domain from being disabled. Fixes: 4ab43d171181 ("clk: qcom: Add lpass clock controller driver for SC7280") Cc: stable@vger.kernel.org # 5.16 Cc: Taniya Das Signed-off-by: Johan Hovold --- drivers/clk/qcom/lpasscc-sc7280.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/clk/qcom/lpasscc-sc7280.c b/drivers/clk/qcom/lpasscc-sc7280.c index 0df2b29e95e3..e6b815aec46a 100644 --- a/drivers/clk/qcom/lpasscc-sc7280.c +++ b/drivers/clk/qcom/lpasscc-sc7280.c @@ -118,9 +118,13 @@ static int lpass_cc_sc7280_probe(struct platform_device *pdev) ret = pm_clk_add(&pdev->dev, "iface"); if (ret < 0) { dev_err(&pdev->dev, "failed to acquire iface clock\n"); - goto destroy_pm_clk; + goto err_destroy_pm_clk; } + ret = pm_runtime_resume_and_get(&pdev->dev); + if (ret) + goto err_destroy_pm_clk; + if (!of_property_read_bool(pdev->dev.of_node, "qcom,adsp-pil-mode")) { lpass_regmap_config.name = "qdsp6ss"; lpass_regmap_config.max_register = 0x3f; @@ -128,7 +132,7 @@ static int lpass_cc_sc7280_probe(struct platform_device *pdev) ret = qcom_cc_probe_by_index(pdev, 0, desc); if (ret) - goto destroy_pm_clk; + goto err_put_rpm; } lpass_regmap_config.name = "top_cc"; @@ -137,11 +141,15 @@ static int lpass_cc_sc7280_probe(struct platform_device *pdev) ret = qcom_cc_probe_by_index(pdev, 1, desc); if (ret) - goto destroy_pm_clk; + goto err_put_rpm; + + pm_runtime_put(&pdev->dev); return 0; -destroy_pm_clk: +err_put_rpm: + pm_runtime_put_sync(&pdev->dev); +err_destroy_pm_clk: pm_clk_destroy(&pdev->dev); return ret; -- 2.41.0