From patchwork Mon Jun 19 16:13:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 110098 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3115522vqr; Mon, 19 Jun 2023 09:23:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6jp2nWhBqEQZtsS7HIWZfdUavUFO48Mwm8L1ZQmMi6jstkXrDiorcKLqj2k/YQwgz3VNt8 X-Received: by 2002:a05:6a00:1804:b0:667:e17e:85bc with SMTP id y4-20020a056a00180400b00667e17e85bcmr10438010pfa.0.1687191804793; Mon, 19 Jun 2023 09:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687191804; cv=none; d=google.com; s=arc-20160816; b=q21u79A69RuFjeMlvUPj36jyZk8no06o/WsXzL/YHeKT1CBmttya0UVlPSmAt3xWFw KsBFSpa29r9mGj2EQhin20JXgDle09u8sV674qJtv99CWZHfgyNNl1HYz2Dmrb4z3HmO FNcGhzI5kawFbdRqxJK/RG0noAacgqgZQuR0W/zHouIJQk/hV6JWKpYMCvrbB15u+5wH P9vVrCpbV0DaGDPaOCE5zYwEUEUfiWknmiVyrMNsi7PLw2Vtj4UFS1S3RQlC7cIM0aQm w0fNmp78qpxcw3U6JIkHCN3NRjOV6u8Qb6OKzvV5GLwIvd59w6bxfdMDhxTeioymIMoh Avww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=hmgYvNinjU/fT+erZeLft1aKLnZsg+oPmLA3CULSbeM=; b=eec+bT4cMk3fiBgyNwz6brHKue1IMUJYHlrKZ/JOWEhTkjXGX+32FeEgsSdpgazYJu SGHl3OMPMCwQKMg3OWjCdMneMnIYlqSMJjkKu7AOAhbjIaeSsK5jEotHswPZbx7DOlZu PzgAGVvM3ZAb74h2axBFnz+cdIwmQbWfWum0mNywTQUWsy+wIY/fdrk+c8ojF8dhmgII Hoor4drN+NECyX6kK0X6bHZbPsRcN2ftX5RKC9y5AWTwc8INTaZAqTRpS9mn6CjIiyVH IJX9fwjH86iIxp0MgCFkXGEQT0sscqYc8Jo8S4li6+IBBCDW9fiq9DsItpS7YAbHBuUl tx9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PTEHzxVj; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p123-20020a625b81000000b006668f12b055si9553753pfb.74.2023.06.19.09.23.09; Mon, 19 Jun 2023 09:23:24 -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=@linaro.org header.s=google header.b=PTEHzxVj; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232204AbjFSQNc (ORCPT + 99 others); Mon, 19 Jun 2023 12:13:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232055AbjFSQN1 (ORCPT ); Mon, 19 Jun 2023 12:13:27 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED22B1B0 for ; Mon, 19 Jun 2023 09:13:25 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2b46bfa66d2so29012601fa.2 for ; Mon, 19 Jun 2023 09:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687191204; x=1689783204; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hmgYvNinjU/fT+erZeLft1aKLnZsg+oPmLA3CULSbeM=; b=PTEHzxVjoT1bF8b5NSp4p68xB+MVPrSsJJUY0khQid3MBOQ+0J/+/PjP5ztIJnoEte wnFd+gMhlzHN05KizStYKFgY0/J+neM+FabraUyIE4grK0b2Xy36NcJEcfAiw/eidaTL lBbCMzwMCHodFXALMzlUfFHUad8nkzCyoihpPCx6ZhelQM7cijXatQVr4/BNAib/4/zt EVBHsyAyofZh9OiQNOounIyW6aW5CrPCYY1bdmTzYy2IrpZSC51i0Todnq/bli6Xw9mS 6D3ZYv9axSfxuK0o7pZQ2IxZZBVV5cteCUXqmOSQPNYe7B847ZjptQGNcfhNtWYSarSo LpcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687191204; x=1689783204; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hmgYvNinjU/fT+erZeLft1aKLnZsg+oPmLA3CULSbeM=; b=SfJRERLihdq3awOF2bthYcu1bGVt3pThkPHQhcZ8BN1UCOJ3GqLpNpXWmUxkkAFGFa wqYQ4odankmkQglq7ZM6vzrXGC1n/RYDdETV2p0DLU3JjAset083+4cDKH2yCfNquO+b Ee/hwSM8wwFqlsv+TE7q7vFGkQqpty+ZcahwQeWvSo+6Nm38Lc5z6Ag+ee/Sy/eVUw0J k7y5l3OT6n5IJbkTEfF8O5XSBcREAGWuqe1iqyrqqK289YGQjtfLcmDbDQ8yhKqS7NA/ 00Tzd4tYkIHWPe13h6cvXeSOF6KdufqwCtIo/Au2MdRUB3SEy27i3ro3CcBXe2KDATaR sv9g== X-Gm-Message-State: AC+VfDxvgjHu10Ig12jT1+jTn0Rwi8qCwvX6GYmTm1AKGyUl2YcmhJpb jMIy0WtW3E4yYBfPKf6JrL7LOPcKAU1FeyyPKak= X-Received: by 2002:a2e:960d:0:b0:2ad:d291:72e1 with SMTP id v13-20020a2e960d000000b002add29172e1mr6611945ljh.18.1687191204336; Mon, 19 Jun 2023 09:13:24 -0700 (PDT) Received: from [192.168.1.101] (abyl242.neoplus.adsl.tpnet.pl. [83.9.31.242]) by smtp.gmail.com with ESMTPSA id x20-20020a2e7c14000000b002b471efb253sm1011714ljc.46.2023.06.19.09.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 09:13:24 -0700 (PDT) From: Konrad Dybcio Date: Mon, 19 Jun 2023 18:13:18 +0200 Subject: [PATCH 2/2] clk: qcom: gcc-sc8280xp: Add runtime PM MIME-Version: 1.0 Message-Id: <20230619-topic-sc8280xp-clk-rpm-v1-2-1e5e1064cdb2@linaro.org> References: <20230619-topic-sc8280xp-clk-rpm-v1-0-1e5e1064cdb2@linaro.org> In-Reply-To: <20230619-topic-sc8280xp-clk-rpm-v1-0-1e5e1064cdb2@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1687191201; l=1628; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=iLOsinGTJtv8sPDkEM7a2zWDxDnO0K1p+yOFG6UU878=; b=7gTXtpfYHcJ+0pwGRH82J2GexETpGG26Gyb/o04zQKY9qD5wnd1s78SdNgclCurw05CB4RlMi lEdx/i0XRbsDjfQmEAqtdOzVf3WwIQRHifziP649VUBKp7lkQLL5FK5 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769148833507682507?= X-GMAIL-MSGID: =?utf-8?q?1769148833507682507?= The GCC block on SC8280XP is powered by the CX rail. We need to ensure that it's enabled to prevent unwanted power collapse. Enable runtime PM to keep the power flowing only when necessary. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/gcc-sc8280xp.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/gcc-sc8280xp.c b/drivers/clk/qcom/gcc-sc8280xp.c index 04a99dbaa57e..b90c71637814 100644 --- a/drivers/clk/qcom/gcc-sc8280xp.c +++ b/drivers/clk/qcom/gcc-sc8280xp.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -7421,9 +7422,19 @@ static int gcc_sc8280xp_probe(struct platform_device *pdev) struct regmap *regmap; int ret; + ret = devm_pm_runtime_enable(&pdev->dev); + if (ret) + return ret; + + ret = pm_runtime_resume_and_get(&pdev->dev); + if (ret) + return ret; + regmap = qcom_cc_map(pdev, &gcc_sc8280xp_desc); - if (IS_ERR(regmap)) + if (IS_ERR(regmap)) { + pm_runtime_put(&pdev->dev); return PTR_ERR(regmap); + } /* * Keep the clocks always-ON @@ -7445,7 +7456,10 @@ static int gcc_sc8280xp_probe(struct platform_device *pdev) if (ret) return ret; - return qcom_cc_really_probe(pdev, &gcc_sc8280xp_desc, regmap); + ret = qcom_cc_really_probe(pdev, &gcc_sc8280xp_desc, regmap); + pm_runtime_put(&pdev->dev); + + return ret; } static const struct of_device_id gcc_sc8280xp_match_table[] = {