From patchwork Tue Jul 18 13:29:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 705440 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 6E689EB64DA for ; Tue, 18 Jul 2023 13:30:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232788AbjGRNaA (ORCPT ); Tue, 18 Jul 2023 09:30:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232738AbjGRN3z (ORCPT ); Tue, 18 Jul 2023 09:29:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D317126; 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 6CA156159B; Tue, 18 Jul 2023 13:29:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 973BBC611A4; 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=JucSCYtIeP5pXopgua1lk2Xc676zWfRI0jmWjsoIoAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IPt1QeLuHYln0zGpgeG6CKT9HWvuhbmHwGTpIXkbmij14VLQi1bThBx7Nxu9eUJ/m mpJINpbRgLUzsCnYs0bKDViLnSDhHGidlDtm0L0A6qaJ5j2eQIw9jy/i6wvUrCpoCE mfa59OWFZSxu2Rvv8urGx73xU+GNT1Y/O0LkIhRKbQrp5NfmmToXfRu4WWpiTEQJNr Cu/kQXq9n9lyf5eHWp+lTLigA4QfxD56UUeD2J26IFADSUZc+ON5uo0C4v6AzBVuqi 8L6AD2i3TY9oZWoECc2lyVLnQyQoMHdP+fvwaXFhv6eWcfT2I8Fd7kRmEhxopTz9jQ s171x5qIZUNyg== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1qLkm2-0005cH-1A; 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 8/8] clk: qcom: turingcc-qcs404: fix missing resume during probe Date: Tue, 18 Jul 2023 15:29:02 +0200 Message-ID: <20230718132902.21430-9-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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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: 892df0191b29 ("clk: qcom: Add QCS404 TuringCC") Cc: stable@vger.kernel.org # 5.2 Cc: Bjorn Andersson Signed-off-by: Johan Hovold --- drivers/clk/qcom/turingcc-qcs404.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/turingcc-qcs404.c b/drivers/clk/qcom/turingcc-qcs404.c index 43184459228f..2cd288d6c3e4 100644 --- a/drivers/clk/qcom/turingcc-qcs404.c +++ b/drivers/clk/qcom/turingcc-qcs404.c @@ -125,11 +125,22 @@ static int turingcc_probe(struct platform_device *pdev) return ret; } + ret = pm_runtime_resume_and_get(&pdev->dev); + if (ret) + return ret; + ret = qcom_cc_probe(pdev, &turingcc_desc); if (ret < 0) - 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 turingcc_pm_ops = {