Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6836798rwp; Tue, 18 Jul 2023 06:37:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlGenQ2sIMSvreEavTpxXLDz2Erl+NZTMvDhr6Rhh/x/WyRoo7Xq45wJHPgiGWm5iKDAmn/K X-Received: by 2002:a17:906:1ce:b0:994:5317:a961 with SMTP id 14-20020a17090601ce00b009945317a961mr9557881ejj.46.1689687450757; Tue, 18 Jul 2023 06:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689687450; cv=none; d=google.com; s=arc-20160816; b=qEG9a+/kRb5UNqUbVaR9xYcFw5CN+Db2wMFtQ9rbGbiyZUSQaittHQ9R2Ltkw54Gq+ d5HVjmJ4MMI8cYUd/jp70UeUVZuJWA+pGjqLY3KCD3FeZwSDcc2AhtxOTQqJbZrBqxKH I2dIgASrauQcPO2jlamKmctx57LLkpDUO/Eurnf53A2ooFU4mQyfWe/62O1wV8le7w/M g+RSmGVZUW7cEaF2VNv6WJ7p8H9S1w2ADABCO7ciQmTHs4hh5FQxYh6aHT7l7X9C8GOx CDQee4FoUDdAI0MGtfG5cJ+R7RxnhLvOLJroW6djytbaN+L8nlaMFV0u/E03rWSSmZAx 2UuQ== 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=4Qe/jGOGJfPAfppzBk43tZHzVy6EV05uzv9g1QV0y2I=; fh=qB+dzD9KmYgF55NvCYrUoipMcIF+GsnCIsP0yhtxx60=; b=SCXXfv0DEgIN1PtilxKR08PcDZcr5Mb7X19zpl6pqGRY9ivCrvi2jrGPae/B8/Oeic oHh6d1SwjdzpLwUo6c92hZa2uzDL3g8fctug+9srxk9jXVxAag8UWW/upuA/yg/ZtBHu FxDx8VJyuX135KwVaJmRqc72Oc2Ac8xmi3Cj9VW+BIz8kxwZ+bKNetXKdXo3mN5y+G0a hBSi75ZXGuXsBgExSATJ431sNevhkGEbHxzzXUc+SH/KloNCB4YuUQbDsaSGZy8yyL5v HFVARQqQ3FgMwDuAzQp/bRZuZ7WOUfNDPzIJyWscOX9UVWzplQGHg8eP78seJELkVSRD VwYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ex9idKA8; 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 ha14-20020a170906a88e00b009938899a39bsi1108952ejb.861.2023.07.18.06.37.06; Tue, 18 Jul 2023 06:37:30 -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=Ex9idKA8; 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 S232676AbjGRNaC (ORCPT + 99 others); Tue, 18 Jul 2023 09:30:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232743AbjGRN3y (ORCPT ); Tue, 18 Jul 2023 09:29:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61B6211B; 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 5B71761587; Tue, 18 Jul 2023 13:29:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6512BC433BF; 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=AMYMGf2yRrBIwpwEoaP+5FFAHqopIdp6a4vZOTfLp5I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ex9idKA8p5sN2VEyTfwNb61UYDj5uVpAcQdb5smc0jpORoL4EMU14KRkF5SAkOcpX G6C10iuoIbnQ4FECss5qDWmdsPQ7qXWEmoR03qF6q/GqGuVy7RBujAyd2FhX7+VFlj /U/miA14VIfLyY/jsMwzdVVmNcYSHCUOByy7EqKDG9Fz4N2D82Lajxbqsj1dyYU+9i ElMcUbcJ6BzpBINyqGXHWb7/RbUTu/fLHJ/c8u/qd5Z6sG6kQGy00mzdNJkDYS7hPv 7GSpqNt+4KsQ3PKNbaQ4gZqzx79l96f+D3i4bQ1Kf6JYBC16a5VAttZbPN6NTupcr+ vwja/NYeC0HfQ== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1qLkm2-0005cB-0a; 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 Subject: [PATCH 6/8] clk: qcom: q6sstop-qcs404: fix missing resume during probe Date: Tue, 18 Jul 2023 15:29:00 +0200 Message-ID: <20230718132902.21430-7-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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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: 6cdef2738db0 ("clk: qcom: Add Q6SSTOP clock controller for QCS404") Cc: stable@vger.kernel.org # 5.5 Signed-off-by: Johan Hovold --- drivers/clk/qcom/q6sstop-qcs404.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/q6sstop-qcs404.c b/drivers/clk/qcom/q6sstop-qcs404.c index 780074e05841..26e2d63614ac 100644 --- a/drivers/clk/qcom/q6sstop-qcs404.c +++ b/drivers/clk/qcom/q6sstop-qcs404.c @@ -174,21 +174,32 @@ static int q6sstopcc_qcs404_probe(struct platform_device *pdev) return ret; } + ret = pm_runtime_resume_and_get(&pdev->dev); + if (ret) + return ret; + q6sstop_regmap_config.name = "q6sstop_tcsr"; desc = &tcsr_qcs404_desc; ret = qcom_cc_probe_by_index(pdev, 1, desc); if (ret) - return ret; + goto err_put_rpm; q6sstop_regmap_config.name = "q6sstop_cc"; desc = &q6sstop_qcs404_desc; ret = qcom_cc_probe_by_index(pdev, 0, desc); if (ret) - return ret; + goto err_put_rpm; + + pm_runtime_put(&pdev->dev); return 0; + +err_put_rpm: + pm_runtime_put_sync(&pdev->dev); + + return ret; } static const struct dev_pm_ops q6sstopcc_pm_ops = { -- 2.41.0