Message ID | 20230717-topic-branch_aon_cleanup-v6-0-46d136a4e8d0@linaro.org |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-25298-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp794103dyc; Sat, 13 Jan 2024 06:51:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2u4XFQS18NjeZX42OZYYCyFMI4RU+1kR7duGu+ThhWQTLKuQdFCYTDtGHIzYQKnleJzz9 X-Received: by 2002:a05:620a:8501:b0:783:4cbb:dec3 with SMTP id pe1-20020a05620a850100b007834cbbdec3mr1505618qkn.157.1705157495512; Sat, 13 Jan 2024 06:51:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705157495; cv=none; d=google.com; s=arc-20160816; b=yLTvyo/S+VbaUAekq0X4wQ2j/kFoA5qecNI1MqU1peQ+XEasi674LeavkC0uPvzuPE 3QadCfqJJui7fIecES5OKz26OyIsQkrvmTOYvHFfqzAKB0uHp3P1T94pOyA0hIxkyUVY xXtKYqrI2/G+fywZ68JC8kUfZBtsYSAAsV3Eb6Gkw9Ce/J1KJH3QEQ21FoMOC9TsGCdj 97E4OPWNnXS7519I9O2DYXvfvMdUlLu0KWS83JEm0ygCWWYbOuvFph26CjGx7lIuhF9A DMVc30q6+RTvypmxMWc7FQYIjyCf9fFSUdzk+ewWZKdR1hI28Jp0zJ3IE+CWyexiJGar OS5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=V/I/XuCXTujbt8vVT93hkh8hG2X/qqDSbSC/vDBIwwM=; fh=MkFdVN+LDhRMwYZGMbT0hIwVISxx/ufGkS/k1knkCCE=; b=qs/VgoDWCxQSkQ/efCojnnnKX6tJIQ3U1y3UaNR5TngHZ/ITcsdFAI4PxLehORVkGP PsTq8hC+8i3GGjx+cPpCLWRnbObZYGAwG7Rc+TSqIsUyn9tm3UCoxIZSxHHXysMexaqx 43jz9EAsO8w8MorTAezx6Io0YtBsxRX6qSjcCpgTlEs9PMLLFaQ9FKfwEg8K+K83qMGr uII6OdW36X4N3Gt5wk1skjUkVHSuEuZ4VYC4SqBHiYp1Guj5DGU7WZ4uxgSqm5vI0xA5 ZVSifFdGzT3f50opzS4IHw3WQpJLkfOhkNH1T8/lWEQ0hYqJ3xDZKKLfrQ8VWl2h5MEo Iw7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="q5A2u/Zp"; spf=pass (google.com: domain of linux-kernel+bounces-25298-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25298-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c12-20020ae9e20c000000b0078322b61e8csi4819523qkc.465.2024.01.13.06.51.35 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 06:51:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25298-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="q5A2u/Zp"; spf=pass (google.com: domain of linux-kernel+bounces-25298-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25298-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 409CF1C21449 for <ouuuleilei@gmail.com>; Sat, 13 Jan 2024 14:51:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC9D84A24; Sat, 13 Jan 2024 14:51:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="q5A2u/Zp" Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABDDF15CB for <linux-kernel@vger.kernel.org>; Sat, 13 Jan 2024 14:50:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2ccec119587so89945421fa.0 for <linux-kernel@vger.kernel.org>; Sat, 13 Jan 2024 06:50:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705157457; x=1705762257; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=V/I/XuCXTujbt8vVT93hkh8hG2X/qqDSbSC/vDBIwwM=; b=q5A2u/ZpdPqOCzCY65fvqKkZagGFZsuAA1mk2ykZgKRm8CPdqkoo0OQBMgjES3HLRe yu8k0WcrGmdGcjwVTVDcgQCLAPSq0V4hjLGitsdpPRJexc5qaWb6GbvlHamIl3nf1wkj fRkrljMfOwE+H3uzWFjtTQuWlyCVnDK1ViLnUagPtVMOJcLdR3oPffDnfbaUoctk/zSb HDQrd7VpVOi4Nxjw+76c8AlHlLp9dmCEF5zMr2ZdURPKwxQlShiSB9KT3nHThHPaWdZ2 mqUNsIUlGyqOesgere3FigZs86/pAUMcXvTWtNKWIrw3E4ijFP9zmY7ULYAwYpD4KKsr VWSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705157457; x=1705762257; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=V/I/XuCXTujbt8vVT93hkh8hG2X/qqDSbSC/vDBIwwM=; b=hp1iBuy/LvOdtPZax0cMB0jvD6ZQg1j2auiymd6MYLPvIN9V/pgX6HTmsvQGbfdkqv tLcdYdC2ALOyqlnc0RBvt7gN+s6PRcMxVwHUwcKFr2YyC52dO+JrMTcexXtW2fMXsjSe K2O9SDa7P9iMxbtvzRYQgWhn4QudPZQz2JwXi6ChhsbVAwA2upfPdYZ8cnjHANJ1h/z2 b6vvpEh4/8qHP9Jt4F26R1/RoQ8guukSLlECfUvieg1tUfYOT7ujGq4NLHbofcAoPtIU apm2zm4VRKU714RejY9HW8FFCmTgBkflLHn/mBogubFx1EzK6hRuKKXExVBaI4QB/4Iz 8Ljg== X-Gm-Message-State: AOJu0Yyys4ukbEhv2bHnu+BCEa4pg3HpTXA8oe0fznS1MoELWDBhxMHG 2/FeEmrIfB2Hl0MR7NGaFV55s12ffzC41rv6nA37g8EaLUE= X-Received: by 2002:a2e:9094:0:b0:2cd:2334:ed0d with SMTP id l20-20020a2e9094000000b002cd2334ed0dmr1484478ljg.88.1705157457269; Sat, 13 Jan 2024 06:50:57 -0800 (PST) Received: from [10.167.154.1] (178235179017.dynamic-4-waw-k-1-3-0.vectranet.pl. [178.235.179.17]) by smtp.gmail.com with ESMTPSA id es18-20020a056402381200b00554b1d1a934sm3014593edb.27.2024.01.13.06.50.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 06:50:56 -0800 (PST) From: Konrad Dybcio <konrad.dybcio@linaro.org> Subject: [PATCH v6 00/12] Unregister critical branch clocks + some RPM Date: Sat, 13 Jan 2024 15:50:49 +0100 Message-Id: <20230717-topic-branch_aon_cleanup-v6-0-46d136a4e8d0@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAEmjomUC/43NwY7CIBQF0F8xrAdTHhTElf8xMQbow5I00IA2Y 0z/faiZjXEWLO/Ne+c+ScEcsJDj7kkyLqGEFGuQXzviRhOvSMNQM4EOeKeYorc0B0dtNtGNF5P ixU1o4n2mUivpGPeomCP13ZqCf3cViPdpquWc0Yef1973ueYxlFvKj9f8wra2YWlhtKOg1EEMo Izw4jSFaHLap3wlm7pAqwSbZPoDF7JDD/JD4q0SrxJHzqxD7eQ/kmiVxCaBA80HHDTrP6S+Veq rpLUWgNJ6Zs2btK7rL2ZRG3H+AQAA To: Bjorn Andersson <andersson@kernel.org>, Andy Gross <agross@kernel.org>, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> Cc: Marijn Suijten <marijn.suijten@somainline.org>, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio <konrad.dybcio@linaro.org>, Johan Hovold <johan+linaro@kernel.org>, Bryan O'Donoghue <bryan.odonoghue@linaro.org> X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705157455; l=5611; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=vkGbXU848WEspgSharGEk+6olgNHHL+yL2Y/bvSVj1Y=; b=B+x4cJRS0CIrn1Z9W2YFKQpp0A4nI77fQC9MYbBOHmqv1dBNWdU9qu9Lf7YuSAeHDNYnTJhEQ C2AaPzVQLX8CuPgjNFWbsaIK3c8GZlmfGTJ1myCgprrkpOhYypfjjdI X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787987226194030034 X-GMAIL-MSGID: 1787987226194030034 |
Series |
Unregister critical branch clocks + some RPM
|
|
Message
Konrad Dybcio
Jan. 13, 2024, 2:50 p.m. UTC
On Qualcomm SoCs, certain branch clocks either need to be always-on, or
should be if you're interested in touching some part of the hardware.
Using CLK_IS_CRITICAL for this purpose sounds like a genius idea,
however that messes with the runtime pm handling - if a clock is
marked as such, the clock controller device will never enter the
"suspended" state, leaving the associated resources online, which in
turn breaks SoC-wide suspend.
This series aims to solve that on a couple SoCs that I could test the
changes on and it sprinkles some runtime pm enablement atop these drivers.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Changes in v6:
- Rebase (next-20240112)
- Reorder qcom_branch_set_clk_en calls by register in "*: Unregister
critical clocks" (Johan)
- Pick up tags
- Link to v5: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v5-0-99942e6bf1ba@linaro.org
Changes in v5:
- Change the "Keep the critical clocks always-on" comment to "Keep
some clocks always-on"
- Add the same comment to commits unregistering clocks on 6115/6375/2290
- Link to v4: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v4-0-32c293ded915@linaro.org
Changes in v4:
- Add and unify the "/* Keep the critical clocks always-on */" comment
- Rebase (next-20231222), also include 8650, X1E and 8280camcc drivers
- Drop enabling runtime PM on GCC
- Improve the commit message of "clk: qcom: gpucc-sm6115: Add runtime PM"
- Link to v3: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v3-0-3e31bce9c626@linaro.org
Changes in v3:
- Rebase (next-20231219)
- Fix up a copypaste mistake in "gcc-sm6375: Unregister critical clocks" (bod)
- Pick up tags
- Link to v2: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v2-0-2a583460ef26@linaro.org
Changes in v2:
- Rebase
- Pick up tags
- Fix up missing pm_runtime_put in SM6375 GCC (Johan)
- Clarify the commit message of "Add runtime PM" commits (Johan)
- "GPU_CCC" -> "GPU_CC" (oops)
- Rebase atop next-20231129
- Also fix up camcc-sm8550 & gcc-sm4450
- Unify and clean up the comment style
- Fix missing comments in gcc-sc7180..
- Drop Johan's ack from "clk: qcom: Use qcom_branch_set_clk_en()"
- Improve 6115 dt patch commit message (Bjorn)
- Link to v1: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org
---
Konrad Dybcio (12):
clk: qcom: branch: Add a helper for setting the enable bit
clk: qcom: Use qcom_branch_set_clk_en()
clk: qcom: gcc-sm6375: Unregister critical clocks
clk: qcom: gpucc-sm6375: Unregister critical clocks
clk: qcom: gpucc-sm6115: Unregister critical clocks
clk: qcom: gpucc-sm6115: Add runtime PM
clk: qcom: gcc-sm6115: Unregister critical clocks
clk: qcom: gcc-qcm2290: Unregister critical clocks
arm64: dts: qcom: sm6375: Add VDD_CX to GCC
arm64: dts: qcom: qcm2290: Add VDD_CX to GCC
arm64: dts: qcom: sm6115: Add VDD_CX to GCC
arm64: dts: qcom: sm6115: Add VDD_CX to GPU_CC
arch/arm64/boot/dts/qcom/qcm2290.dtsi | 1 +
arch/arm64/boot/dts/qcom/sm6115.dtsi | 3 +
arch/arm64/boot/dts/qcom/sm6375.dtsi | 1 +
drivers/clk/qcom/camcc-sc8280xp.c | 6 +-
drivers/clk/qcom/camcc-sm8550.c | 10 +--
drivers/clk/qcom/clk-branch.h | 7 ++
drivers/clk/qcom/dispcc-qcm2290.c | 4 +-
drivers/clk/qcom/dispcc-sc7280.c | 7 +-
drivers/clk/qcom/dispcc-sc8280xp.c | 4 +-
drivers/clk/qcom/dispcc-sm6115.c | 4 +-
drivers/clk/qcom/dispcc-sm8250.c | 4 +-
drivers/clk/qcom/dispcc-sm8450.c | 7 +-
drivers/clk/qcom/dispcc-sm8550.c | 7 +-
drivers/clk/qcom/dispcc-sm8650.c | 4 +-
drivers/clk/qcom/gcc-qcm2290.c | 106 +++--------------------------
drivers/clk/qcom/gcc-sa8775p.c | 25 +++----
drivers/clk/qcom/gcc-sc7180.c | 22 +++---
drivers/clk/qcom/gcc-sc7280.c | 20 +++---
drivers/clk/qcom/gcc-sc8180x.c | 28 +++-----
drivers/clk/qcom/gcc-sc8280xp.c | 25 +++----
drivers/clk/qcom/gcc-sdx55.c | 12 ++--
drivers/clk/qcom/gcc-sdx65.c | 13 ++--
drivers/clk/qcom/gcc-sdx75.c | 10 +--
drivers/clk/qcom/gcc-sm4450.c | 28 +++-----
drivers/clk/qcom/gcc-sm6115.c | 124 +++-------------------------------
drivers/clk/qcom/gcc-sm6375.c | 105 +++-------------------------
drivers/clk/qcom/gcc-sm7150.c | 23 +++----
drivers/clk/qcom/gcc-sm8250.c | 19 ++----
drivers/clk/qcom/gcc-sm8350.c | 20 +++---
drivers/clk/qcom/gcc-sm8450.c | 21 +++---
drivers/clk/qcom/gcc-sm8550.c | 21 +++---
drivers/clk/qcom/gcc-sm8650.c | 16 ++---
drivers/clk/qcom/gcc-x1e80100.c | 16 ++---
drivers/clk/qcom/gpucc-sc7280.c | 9 +--
drivers/clk/qcom/gpucc-sc8280xp.c | 9 +--
drivers/clk/qcom/gpucc-sm6115.c | 53 ++++++---------
drivers/clk/qcom/gpucc-sm6375.c | 34 ++--------
drivers/clk/qcom/gpucc-sm8550.c | 10 +--
drivers/clk/qcom/lpasscorecc-sc7180.c | 7 +-
drivers/clk/qcom/videocc-sm8250.c | 6 +-
drivers/clk/qcom/videocc-sm8350.c | 10 +--
drivers/clk/qcom/videocc-sm8450.c | 13 ++--
drivers/clk/qcom/videocc-sm8550.c | 13 ++--
43 files changed, 234 insertions(+), 653 deletions(-)
---
base-commit: 8d04a7e2ee3fd6aabb8096b00c64db0d735bc874
change-id: 20230717-topic-branch_aon_cleanup-6976c13fe71c
Best regards,
Comments
On Sat, 13 Jan 2024 at 16:51, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: > > On Qualcomm SoCs, certain branch clocks either need to be always-on, or > should be if you're interested in touching some part of the hardware. > > Using CLK_IS_CRITICAL for this purpose sounds like a genius idea, > however that messes with the runtime pm handling - if a clock is > marked as such, the clock controller device will never enter the > "suspended" state, leaving the associated resources online, which in > turn breaks SoC-wide suspend. > > This series aims to solve that on a couple SoCs that I could test the > changes on and it sprinkles some runtime pm enablement atop these drivers. Probably it is out of scope for this I wonder if it makes sense to route (some) of the clocks properly. Should we use GCC_foo_SLEEEP_CLK as a sleep clock for the corresponding device? I'm not sure about the AHB and XO clocks. Another question is regarding the suspended state. Wouldn't leaving GCC_foo_XO clocks enabled keep the XO enabled as well? > > Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> > --- > Changes in v6: > - Rebase (next-20240112) > - Reorder qcom_branch_set_clk_en calls by register in "*: Unregister > critical clocks" (Johan) > - Pick up tags > - Link to v5: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v5-0-99942e6bf1ba@linaro.org > > Changes in v5: > - Change the "Keep the critical clocks always-on" comment to "Keep > some clocks always-on" > - Add the same comment to commits unregistering clocks on 6115/6375/2290 > - Link to v4: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v4-0-32c293ded915@linaro.org > > Changes in v4: > - Add and unify the "/* Keep the critical clocks always-on */" comment > - Rebase (next-20231222), also include 8650, X1E and 8280camcc drivers > - Drop enabling runtime PM on GCC > - Improve the commit message of "clk: qcom: gpucc-sm6115: Add runtime PM" > - Link to v3: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v3-0-3e31bce9c626@linaro.org > > Changes in v3: > - Rebase (next-20231219) > - Fix up a copypaste mistake in "gcc-sm6375: Unregister critical clocks" (bod) > - Pick up tags > - Link to v2: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v2-0-2a583460ef26@linaro.org > > Changes in v2: > - Rebase > - Pick up tags > - Fix up missing pm_runtime_put in SM6375 GCC (Johan) > - Clarify the commit message of "Add runtime PM" commits (Johan) > - "GPU_CCC" -> "GPU_CC" (oops) > - Rebase atop next-20231129 > - Also fix up camcc-sm8550 & gcc-sm4450 > - Unify and clean up the comment style > - Fix missing comments in gcc-sc7180.. > - Drop Johan's ack from "clk: qcom: Use qcom_branch_set_clk_en()" > - Improve 6115 dt patch commit message (Bjorn) > - Link to v1: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org > > --- > Konrad Dybcio (12): > clk: qcom: branch: Add a helper for setting the enable bit > clk: qcom: Use qcom_branch_set_clk_en() > clk: qcom: gcc-sm6375: Unregister critical clocks > clk: qcom: gpucc-sm6375: Unregister critical clocks > clk: qcom: gpucc-sm6115: Unregister critical clocks > clk: qcom: gpucc-sm6115: Add runtime PM > clk: qcom: gcc-sm6115: Unregister critical clocks > clk: qcom: gcc-qcm2290: Unregister critical clocks > arm64: dts: qcom: sm6375: Add VDD_CX to GCC > arm64: dts: qcom: qcm2290: Add VDD_CX to GCC > arm64: dts: qcom: sm6115: Add VDD_CX to GCC > arm64: dts: qcom: sm6115: Add VDD_CX to GPU_CC > > arch/arm64/boot/dts/qcom/qcm2290.dtsi | 1 + > arch/arm64/boot/dts/qcom/sm6115.dtsi | 3 + > arch/arm64/boot/dts/qcom/sm6375.dtsi | 1 + > drivers/clk/qcom/camcc-sc8280xp.c | 6 +- > drivers/clk/qcom/camcc-sm8550.c | 10 +-- > drivers/clk/qcom/clk-branch.h | 7 ++ > drivers/clk/qcom/dispcc-qcm2290.c | 4 +- > drivers/clk/qcom/dispcc-sc7280.c | 7 +- > drivers/clk/qcom/dispcc-sc8280xp.c | 4 +- > drivers/clk/qcom/dispcc-sm6115.c | 4 +- > drivers/clk/qcom/dispcc-sm8250.c | 4 +- > drivers/clk/qcom/dispcc-sm8450.c | 7 +- > drivers/clk/qcom/dispcc-sm8550.c | 7 +- > drivers/clk/qcom/dispcc-sm8650.c | 4 +- > drivers/clk/qcom/gcc-qcm2290.c | 106 +++-------------------------- > drivers/clk/qcom/gcc-sa8775p.c | 25 +++---- > drivers/clk/qcom/gcc-sc7180.c | 22 +++--- > drivers/clk/qcom/gcc-sc7280.c | 20 +++--- > drivers/clk/qcom/gcc-sc8180x.c | 28 +++----- > drivers/clk/qcom/gcc-sc8280xp.c | 25 +++---- > drivers/clk/qcom/gcc-sdx55.c | 12 ++-- > drivers/clk/qcom/gcc-sdx65.c | 13 ++-- > drivers/clk/qcom/gcc-sdx75.c | 10 +-- > drivers/clk/qcom/gcc-sm4450.c | 28 +++----- > drivers/clk/qcom/gcc-sm6115.c | 124 +++------------------------------- > drivers/clk/qcom/gcc-sm6375.c | 105 +++------------------------- > drivers/clk/qcom/gcc-sm7150.c | 23 +++---- > drivers/clk/qcom/gcc-sm8250.c | 19 ++---- > drivers/clk/qcom/gcc-sm8350.c | 20 +++--- > drivers/clk/qcom/gcc-sm8450.c | 21 +++--- > drivers/clk/qcom/gcc-sm8550.c | 21 +++--- > drivers/clk/qcom/gcc-sm8650.c | 16 ++--- > drivers/clk/qcom/gcc-x1e80100.c | 16 ++--- > drivers/clk/qcom/gpucc-sc7280.c | 9 +-- > drivers/clk/qcom/gpucc-sc8280xp.c | 9 +-- > drivers/clk/qcom/gpucc-sm6115.c | 53 ++++++--------- > drivers/clk/qcom/gpucc-sm6375.c | 34 ++-------- > drivers/clk/qcom/gpucc-sm8550.c | 10 +-- > drivers/clk/qcom/lpasscorecc-sc7180.c | 7 +- > drivers/clk/qcom/videocc-sm8250.c | 6 +- > drivers/clk/qcom/videocc-sm8350.c | 10 +-- > drivers/clk/qcom/videocc-sm8450.c | 13 ++-- > drivers/clk/qcom/videocc-sm8550.c | 13 ++-- > 43 files changed, 234 insertions(+), 653 deletions(-) > --- > base-commit: 8d04a7e2ee3fd6aabb8096b00c64db0d735bc874 > change-id: 20230717-topic-branch_aon_cleanup-6976c13fe71c > > Best regards, > -- > Konrad Dybcio <konrad.dybcio@linaro.org> > >
On 14.01.2024 05:53, Dmitry Baryshkov wrote: > On Sat, 13 Jan 2024 at 16:51, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: >> >> On Qualcomm SoCs, certain branch clocks either need to be always-on, or >> should be if you're interested in touching some part of the hardware. >> >> Using CLK_IS_CRITICAL for this purpose sounds like a genius idea, >> however that messes with the runtime pm handling - if a clock is >> marked as such, the clock controller device will never enter the >> "suspended" state, leaving the associated resources online, which in >> turn breaks SoC-wide suspend. >> >> This series aims to solve that on a couple SoCs that I could test the >> changes on and it sprinkles some runtime pm enablement atop these drivers. > > Probably it is out of scope for this > I wonder if it makes sense to route (some) of the clocks properly. > Should we use GCC_foo_SLEEEP_CLK as a sleep clock for the > corresponding device? > I'm not sure about the AHB and XO clocks. > > Another question is regarding the suspended state. Wouldn't leaving > GCC_foo_XO clocks enabled keep the XO enabled as well? Doesn't seem to be the case Konrad
On 24-01-13 15:50:49, Konrad Dybcio wrote: > On Qualcomm SoCs, certain branch clocks either need to be always-on, or > should be if you're interested in touching some part of the hardware. > > Using CLK_IS_CRITICAL for this purpose sounds like a genius idea, > however that messes with the runtime pm handling - if a clock is > marked as such, the clock controller device will never enter the > "suspended" state, leaving the associated resources online, which in > turn breaks SoC-wide suspend. Generally speaking, HW-wise, if the power domain of a clock controller is being disabled, all clocks that it provides are being disabled. Are you saying that is not the case ? > > This series aims to solve that on a couple SoCs that I could test the > changes on and it sprinkles some runtime pm enablement atop these drivers. > > Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> > --- > Changes in v6: > - Rebase (next-20240112) > - Reorder qcom_branch_set_clk_en calls by register in "*: Unregister > critical clocks" (Johan) > - Pick up tags > - Link to v5: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v5-0-99942e6bf1ba@linaro.org > > Changes in v5: > - Change the "Keep the critical clocks always-on" comment to "Keep > some clocks always-on" > - Add the same comment to commits unregistering clocks on 6115/6375/2290 > - Link to v4: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v4-0-32c293ded915@linaro.org > > Changes in v4: > - Add and unify the "/* Keep the critical clocks always-on */" comment > - Rebase (next-20231222), also include 8650, X1E and 8280camcc drivers > - Drop enabling runtime PM on GCC > - Improve the commit message of "clk: qcom: gpucc-sm6115: Add runtime PM" > - Link to v3: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v3-0-3e31bce9c626@linaro.org > > Changes in v3: > - Rebase (next-20231219) > - Fix up a copypaste mistake in "gcc-sm6375: Unregister critical clocks" (bod) > - Pick up tags > - Link to v2: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v2-0-2a583460ef26@linaro.org > > Changes in v2: > - Rebase > - Pick up tags > - Fix up missing pm_runtime_put in SM6375 GCC (Johan) > - Clarify the commit message of "Add runtime PM" commits (Johan) > - "GPU_CCC" -> "GPU_CC" (oops) > - Rebase atop next-20231129 > - Also fix up camcc-sm8550 & gcc-sm4450 > - Unify and clean up the comment style > - Fix missing comments in gcc-sc7180.. > - Drop Johan's ack from "clk: qcom: Use qcom_branch_set_clk_en()" > - Improve 6115 dt patch commit message (Bjorn) > - Link to v1: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org > > --- > Konrad Dybcio (12): > clk: qcom: branch: Add a helper for setting the enable bit > clk: qcom: Use qcom_branch_set_clk_en() > clk: qcom: gcc-sm6375: Unregister critical clocks > clk: qcom: gpucc-sm6375: Unregister critical clocks > clk: qcom: gpucc-sm6115: Unregister critical clocks > clk: qcom: gpucc-sm6115: Add runtime PM > clk: qcom: gcc-sm6115: Unregister critical clocks > clk: qcom: gcc-qcm2290: Unregister critical clocks > arm64: dts: qcom: sm6375: Add VDD_CX to GCC > arm64: dts: qcom: qcm2290: Add VDD_CX to GCC > arm64: dts: qcom: sm6115: Add VDD_CX to GCC > arm64: dts: qcom: sm6115: Add VDD_CX to GPU_CC > > arch/arm64/boot/dts/qcom/qcm2290.dtsi | 1 + > arch/arm64/boot/dts/qcom/sm6115.dtsi | 3 + > arch/arm64/boot/dts/qcom/sm6375.dtsi | 1 + > drivers/clk/qcom/camcc-sc8280xp.c | 6 +- > drivers/clk/qcom/camcc-sm8550.c | 10 +-- > drivers/clk/qcom/clk-branch.h | 7 ++ > drivers/clk/qcom/dispcc-qcm2290.c | 4 +- > drivers/clk/qcom/dispcc-sc7280.c | 7 +- > drivers/clk/qcom/dispcc-sc8280xp.c | 4 +- > drivers/clk/qcom/dispcc-sm6115.c | 4 +- > drivers/clk/qcom/dispcc-sm8250.c | 4 +- > drivers/clk/qcom/dispcc-sm8450.c | 7 +- > drivers/clk/qcom/dispcc-sm8550.c | 7 +- > drivers/clk/qcom/dispcc-sm8650.c | 4 +- > drivers/clk/qcom/gcc-qcm2290.c | 106 +++-------------------------- > drivers/clk/qcom/gcc-sa8775p.c | 25 +++---- > drivers/clk/qcom/gcc-sc7180.c | 22 +++--- > drivers/clk/qcom/gcc-sc7280.c | 20 +++--- > drivers/clk/qcom/gcc-sc8180x.c | 28 +++----- > drivers/clk/qcom/gcc-sc8280xp.c | 25 +++---- > drivers/clk/qcom/gcc-sdx55.c | 12 ++-- > drivers/clk/qcom/gcc-sdx65.c | 13 ++-- > drivers/clk/qcom/gcc-sdx75.c | 10 +-- > drivers/clk/qcom/gcc-sm4450.c | 28 +++----- > drivers/clk/qcom/gcc-sm6115.c | 124 +++------------------------------- > drivers/clk/qcom/gcc-sm6375.c | 105 +++------------------------- > drivers/clk/qcom/gcc-sm7150.c | 23 +++---- > drivers/clk/qcom/gcc-sm8250.c | 19 ++---- > drivers/clk/qcom/gcc-sm8350.c | 20 +++--- > drivers/clk/qcom/gcc-sm8450.c | 21 +++--- > drivers/clk/qcom/gcc-sm8550.c | 21 +++--- > drivers/clk/qcom/gcc-sm8650.c | 16 ++--- > drivers/clk/qcom/gcc-x1e80100.c | 16 ++--- > drivers/clk/qcom/gpucc-sc7280.c | 9 +-- > drivers/clk/qcom/gpucc-sc8280xp.c | 9 +-- > drivers/clk/qcom/gpucc-sm6115.c | 53 ++++++--------- > drivers/clk/qcom/gpucc-sm6375.c | 34 ++-------- > drivers/clk/qcom/gpucc-sm8550.c | 10 +-- > drivers/clk/qcom/lpasscorecc-sc7180.c | 7 +- > drivers/clk/qcom/videocc-sm8250.c | 6 +- > drivers/clk/qcom/videocc-sm8350.c | 10 +-- > drivers/clk/qcom/videocc-sm8450.c | 13 ++-- > drivers/clk/qcom/videocc-sm8550.c | 13 ++-- > 43 files changed, 234 insertions(+), 653 deletions(-) > --- > base-commit: 8d04a7e2ee3fd6aabb8096b00c64db0d735bc874 > change-id: 20230717-topic-branch_aon_cleanup-6976c13fe71c > > Best regards, > -- > Konrad Dybcio <konrad.dybcio@linaro.org> > >
On 1/24/24 08:41, Abel Vesa wrote: > On 24-01-13 15:50:49, Konrad Dybcio wrote: >> On Qualcomm SoCs, certain branch clocks either need to be always-on, or >> should be if you're interested in touching some part of the hardware. >> >> Using CLK_IS_CRITICAL for this purpose sounds like a genius idea, >> however that messes with the runtime pm handling - if a clock is >> marked as such, the clock controller device will never enter the >> "suspended" state, leaving the associated resources online, which in >> turn breaks SoC-wide suspend. > > Generally speaking, HW-wise, if the power domain of a clock controller > is being disabled, all clocks that it provides are being disabled. Generally speaking, if that's the case, that's true. > > Are you saying that is not the case ? Dragons however, are peculiar creatures and it seems like the clock controllers are not *really* disabled when we think they are, e.g. due to RPM(h) owning a share of GCC clocks, or due to the MX rail being always-on. It would indeed be an issue with hibernation where the registers would need to be reprogrammed after battery power is removed. As we spoke off-list, I'll split this series into two: adding common helpers and then taking care of 2290/6375/6115. I'm not yet sure how far we can go with converting existing clock drivers to use pm_clk_add so that the _AHB, _XO, and _SLEEP clocks for a given subsystem are only enabled when necessary - if we require an entry in clock-names, backwards compatibility goes away, and if we don't - we potentially miss out on a devlink between X_CC and GCC, plus the name needs to be hardcoded for global parent lookup. For new drivers, we'll likely just require a clean solution (runtime PM enabled + subsys clocks gotten as pm_clk through a dt entry on the consumer). Konrad
Hi Konrad, Thanks for your patch. On 1/13/2024 8:20 PM, Konrad Dybcio wrote: > On Qualcomm SoCs, certain branch clocks either need to be always-on, or > should be if you're interested in touching some part of the hardware. > > Using CLK_IS_CRITICAL for this purpose sounds like a genius idea, > however that messes with the runtime pm handling - if a clock is > marked as such, the clock controller device will never enter the > "suspended" state, leaving the associated resources online, which in > turn breaks SoC-wide suspend. I am really curious to know a little more about the SoC-Wide Suspend not happening on these targets. Could you add more details here ? The Resource Power Manager (RPM) is the main aggregator on these targets where the active & sleep votes on XO, shared rails (CX/MX) decide the SoC wide suspend. The High Level OS on our internal platforms never had any suspend issues due to clocks(GCC/GPUCC) or shared rails being kept enabled from the consumers. > > This series aims to solve that on a couple SoCs that I could test the > changes on and it sprinkles some runtime pm enablement atop these drivers. > As CX is a shared resource/rail on these specific targets we definitely do not achieve any power saving with the runtime pm attached to these clock controllers, but I see a little more SW overhead. Though you could please add your observations/comments. Removing the CLK_IS_CRITICAL is a good cleanup and moving them to probe is a good way to handle the always-on clocks. > Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> > --- > Changes in v6: > - Rebase (next-20240112) > - Reorder qcom_branch_set_clk_en calls by register in "*: Unregister > critical clocks" (Johan) > - Pick up tags > - Link to v5: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v5-0-99942e6bf1ba@linaro.org > > Changes in v5: > - Change the "Keep the critical clocks always-on" comment to "Keep > some clocks always-on" > - Add the same comment to commits unregistering clocks on 6115/6375/2290 > - Link to v4: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v4-0-32c293ded915@linaro.org > > Changes in v4: > - Add and unify the "/* Keep the critical clocks always-on */" comment > - Rebase (next-20231222), also include 8650, X1E and 8280camcc drivers > - Drop enabling runtime PM on GCC > - Improve the commit message of "clk: qcom: gpucc-sm6115: Add runtime PM" > - Link to v3: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v3-0-3e31bce9c626@linaro.org > > Changes in v3: > - Rebase (next-20231219) > - Fix up a copypaste mistake in "gcc-sm6375: Unregister critical clocks" (bod) > - Pick up tags > - Link to v2: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v2-0-2a583460ef26@linaro.org > > Changes in v2: > - Rebase > - Pick up tags > - Fix up missing pm_runtime_put in SM6375 GCC (Johan) > - Clarify the commit message of "Add runtime PM" commits (Johan) > - "GPU_CCC" -> "GPU_CC" (oops) > - Rebase atop next-20231129 > - Also fix up camcc-sm8550 & gcc-sm4450 > - Unify and clean up the comment style > - Fix missing comments in gcc-sc7180.. > - Drop Johan's ack from "clk: qcom: Use qcom_branch_set_clk_en()" > - Improve 6115 dt patch commit message (Bjorn) > - Link to v1: https://lore.kernel.org/r/20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org > > --- > Konrad Dybcio (12): > clk: qcom: branch: Add a helper for setting the enable bit > clk: qcom: Use qcom_branch_set_clk_en() > clk: qcom: gcc-sm6375: Unregister critical clocks > clk: qcom: gpucc-sm6375: Unregister critical clocks > clk: qcom: gpucc-sm6115: Unregister critical clocks > clk: qcom: gpucc-sm6115: Add runtime PM > clk: qcom: gcc-sm6115: Unregister critical clocks > clk: qcom: gcc-qcm2290: Unregister critical clocks > arm64: dts: qcom: sm6375: Add VDD_CX to GCC > arm64: dts: qcom: qcm2290: Add VDD_CX to GCC > arm64: dts: qcom: sm6115: Add VDD_CX to GCC > arm64: dts: qcom: sm6115: Add VDD_CX to GPU_CC > > arch/arm64/boot/dts/qcom/qcm2290.dtsi | 1 + > arch/arm64/boot/dts/qcom/sm6115.dtsi | 3 + > arch/arm64/boot/dts/qcom/sm6375.dtsi | 1 + > drivers/clk/qcom/camcc-sc8280xp.c | 6 +- > drivers/clk/qcom/camcc-sm8550.c | 10 +-- > drivers/clk/qcom/clk-branch.h | 7 ++ > drivers/clk/qcom/dispcc-qcm2290.c | 4 +- > drivers/clk/qcom/dispcc-sc7280.c | 7 +- > drivers/clk/qcom/dispcc-sc8280xp.c | 4 +- > drivers/clk/qcom/dispcc-sm6115.c | 4 +- > drivers/clk/qcom/dispcc-sm8250.c | 4 +- > drivers/clk/qcom/dispcc-sm8450.c | 7 +- > drivers/clk/qcom/dispcc-sm8550.c | 7 +- > drivers/clk/qcom/dispcc-sm8650.c | 4 +- > drivers/clk/qcom/gcc-qcm2290.c | 106 +++-------------------------- > drivers/clk/qcom/gcc-sa8775p.c | 25 +++---- > drivers/clk/qcom/gcc-sc7180.c | 22 +++--- > drivers/clk/qcom/gcc-sc7280.c | 20 +++--- > drivers/clk/qcom/gcc-sc8180x.c | 28 +++----- > drivers/clk/qcom/gcc-sc8280xp.c | 25 +++---- > drivers/clk/qcom/gcc-sdx55.c | 12 ++-- > drivers/clk/qcom/gcc-sdx65.c | 13 ++-- > drivers/clk/qcom/gcc-sdx75.c | 10 +-- > drivers/clk/qcom/gcc-sm4450.c | 28 +++----- > drivers/clk/qcom/gcc-sm6115.c | 124 +++------------------------------- > drivers/clk/qcom/gcc-sm6375.c | 105 +++------------------------- > drivers/clk/qcom/gcc-sm7150.c | 23 +++---- > drivers/clk/qcom/gcc-sm8250.c | 19 ++---- > drivers/clk/qcom/gcc-sm8350.c | 20 +++--- > drivers/clk/qcom/gcc-sm8450.c | 21 +++--- > drivers/clk/qcom/gcc-sm8550.c | 21 +++--- > drivers/clk/qcom/gcc-sm8650.c | 16 ++--- > drivers/clk/qcom/gcc-x1e80100.c | 16 ++--- > drivers/clk/qcom/gpucc-sc7280.c | 9 +-- > drivers/clk/qcom/gpucc-sc8280xp.c | 9 +-- > drivers/clk/qcom/gpucc-sm6115.c | 53 ++++++--------- > drivers/clk/qcom/gpucc-sm6375.c | 34 ++-------- > drivers/clk/qcom/gpucc-sm8550.c | 10 +-- > drivers/clk/qcom/lpasscorecc-sc7180.c | 7 +- > drivers/clk/qcom/videocc-sm8250.c | 6 +- > drivers/clk/qcom/videocc-sm8350.c | 10 +-- > drivers/clk/qcom/videocc-sm8450.c | 13 ++-- > drivers/clk/qcom/videocc-sm8550.c | 13 ++-- > 43 files changed, 234 insertions(+), 653 deletions(-) > --- > base-commit: 8d04a7e2ee3fd6aabb8096b00c64db0d735bc874 > change-id: 20230717-topic-branch_aon_cleanup-6976c13fe71c > > Best regards,
On 1/25/24 11:16, Taniya Das wrote: > Hi Konrad, > > Thanks for your patch. > > On 1/13/2024 8:20 PM, Konrad Dybcio wrote: >> On Qualcomm SoCs, certain branch clocks either need to be always-on, or >> should be if you're interested in touching some part of the hardware. >> >> Using CLK_IS_CRITICAL for this purpose sounds like a genius idea, >> however that messes with the runtime pm handling - if a clock is >> marked as such, the clock controller device will never enter the >> "suspended" state, leaving the associated resources online, which in >> turn breaks SoC-wide suspend. > > I am really curious to know a little more about the SoC-Wide Suspend not happening on these targets. Could you add more details here ? > > The Resource Power Manager (RPM) is the main aggregator on these targets where the active & sleep votes on XO, shared rails (CX/MX) decide the SoC wide suspend. The High Level OS on our internal platforms never had any suspend issues due to clocks(GCC/GPUCC) or shared rails being kept enabled from the consumers. With the common clock framework, CLK_IS_CRITICAL blocks pm operations, as clk_disable fails at some point. Since RPM(h)PDs are modeled as pmdomains, this in turn results in them never getting disabled, leading to outstanding votes. Then, RPM(h) sees these votes and (among other things which are not properly described on most SoCs leading to dangling votes) decides that CXPD/XOSD/AOSD can't be entered because there's a request on a resource. > >> >> This series aims to solve that on a couple SoCs that I could test the >> changes on and it sprinkles some runtime pm enablement atop these drivers. >> > > As CX is a shared resource/rail on these specific targets we definitely do not achieve any power saving with the runtime pm attached to these clock controllers, but I see a little more SW overhead. Though you could please add your observations/comments. Hm, simply adding a power-domains entry to denote the required performance state values when voting for downstream GDSCs would be enough and runtime PM only makes sense if there's an additional rail, say MMCX or GFX. But see the comment below. > > Removing the CLK_IS_CRITICAL is a good cleanup and moving them to probe is a good way to handle the always-on clocks. Unless it turns out to be really messy with keeping backwards DTS compatibilty, the goal is to use the pm_clk APIs to only keep the interface/xo/sleep clocks for subsystems active when that subsystem is active (i.e. when SUBSYS_CC is *runtime-active*). This will result in a treewide patchset. Konrad