From patchwork Wed Mar 8 21:35:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 661846 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 055BFC64EC4 for ; Wed, 8 Mar 2023 21:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230007AbjCHVfr (ORCPT ); Wed, 8 Mar 2023 16:35:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbjCHVfq (ORCPT ); Wed, 8 Mar 2023 16:35:46 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AF7BB8550 for ; Wed, 8 Mar 2023 13:35:38 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id s20so23095762lfb.11 for ; Wed, 08 Mar 2023 13:35:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311336; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=Yx3K8KXfYeN1w6FBBGidGftrh4dFPASfNQz/HmCNuJ8=; b=Ul/itAD16p+95xv4fGh1OJ/KR0f+oFGvCtotcuPrQfa9VgDxo/A1SAp8F8YDoqwI74 lVMCy44wkwYFZrHNnvBe7mF09/7GMZMXoTLpoUXWyZo8B1i1HmY/AC3OF87f+JEf4iho /pyGCdDxL79VrH9tEx0hkVm7r3OdTo5f2D3FUuLW5N8v1z4i2Th7+amOUygNV/x1K2/E mkQ+DWU8tI9DkyWqZfrkoD57JA8JBgHiPiLEFmGJsFPuDgZjRwfqmdjevLUjoKhsokZI 7S2Alegth4zMb/Kuw56A3tsYZSlvVVSwloT8xA/mMBLH+oZwXUxfQfaN3MmSnihcj8G3 mxOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311336; 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=Yx3K8KXfYeN1w6FBBGidGftrh4dFPASfNQz/HmCNuJ8=; b=SBR0ugGoKAfG+8QdWbRJWlxQqoCgTxp1tNpOYlVaLROin4CQOOqb6BA4yR9XnOAVy2 HmKXaM+SiYEk/c+iURNOrp9b+sK/s/h7EIEjC0RpYfpHVxKBIL/7kqTxWdfsQ0vL+MR0 10b7cVXpf4EgZ15ktAXnlBovVY/SKiMXve1BcVN+OUXOxoVJlDftkG2jPHHqKEZtp5dY Z4lXCmtvSxv6C5ygT1dQX30lWcCSKoCi4nYSlRhg9+k8XfeATgC/OV6CsOBEO4mCnH8N Ltxu3rvNZpFodeR+pvRxq2BxWkq64QYbPj36MwrQPElLmGA9X2QmZUX6YpCMRGyf+yj8 pSXg== X-Gm-Message-State: AO0yUKVKqjzQ1oBW2pNJpT2NuNa0/Or+x2QCVNCiiE62znaKGhWCnW6h 27W/t93ysPMBd9fCZCRmQKfpRw== X-Google-Smtp-Source: AK7set/DjKLJA19+zcHCwu+AW5vV0IYu8eoUU+rBhf2JR453NmNf/hM7fz8BUXz4HDuZGxsjiI4ESQ== X-Received: by 2002:ac2:48a7:0:b0:4da:ae47:6615 with SMTP id u7-20020ac248a7000000b004daae476615mr5800547lfg.49.1678311336396; Wed, 08 Mar 2023 13:35:36 -0800 (PST) Received: from [192.168.1.101] (abyj16.neoplus.adsl.tpnet.pl. [83.9.29.16]) by smtp.gmail.com with ESMTPSA id u7-20020ac243c7000000b004dc4d26c324sm2467479lfl.143.2023.03.08.13.35.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:35 -0800 (PST) From: Konrad Dybcio Subject: [PATCH RFT v2 00/14] SMD RPMCC sleep preparations Date: Wed, 08 Mar 2023 22:35:16 +0100 Message-Id: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAJT/CGQC/32NQQrCMBBFr1JmbSRNwVJXrjyAuJMi02TSBmISJ rUopXc39ADyV+9/Pm+FTOwow7lagWlx2cVQQB0q0BOGkYQzhUFJ1cgSMcfktOD00vqZPVES5tQ ims42slZQfgNmEgNj0FN5hrf3pUxM1n120QNu1zv0pZxcniN/d/lS79Mfz1ILKUynLdpuUC22F +8CcjxGHqHftu0HCyZurc0AAAA= To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Konrad Dybcio , Shawn Guo , Taniya Das X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=2646; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=ag6sS2vNWieo5YFXrKuNAA3nF1wtvbbIdfAZ+4LnBg4=; b=872IBcUN9ZTJYbHMIDpj9icWsfsYZZXpj4dUIVgvkburRlwinDvLaWezNUvaqPTK6LEF2H5Gj73+ FO+gbPVbBcZRRL+aTA/MEpZhZWRq3u23wIVoPxogJ9LsAbIBCrES X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org v1 -> v2: - Use CLK_IS_CRITICAL instead of leaving a clk enable vote, expand macros to do so - Fix the keepalive clocks for 8998 & 660 (CNoC -> PNoC, it was confusingly named cnoc_periph downstream) - Introduce .determinte_rate to ensure we don't set keepalive clocks' rates below 19.2 MHz - Add a (!conditional!) way to test the ultimate goal of all these changes by essentially enabling unused clk cleanup through a dt property (for legacy reasons) v2 was tested on: - MSM8996 Sony Kagura (can disable unused) - MSM8998 Sony Maple (can disable unused with OOT icc) - SM6375 Sony PDX225 (can disable unused with OOT icc) v1: https://lore.kernel.org/r/20230303-topic-rpmcc_sleep-v1-0-d9cfaf9b27a7@linaro.org This series brings support for a couple of things necessary for the full system idle on SMD RPM SoCs, namely unused clk shutdown and keepalive votes (permanent active votes that are required on certain clocks for the platform to function). Tested on MSM8996 and SM6375, does not seem to introduce any additional regressions. Keepalive clocks for other platforms were gathered by digging in old downstream kernels, please give them a test. Signed-off-by: Konrad Dybcio --- Konrad Dybcio (11): dt-bindings: clock: qcom,rpmcc: Add a way to enable unused clock cleanup clk: qcom: smd-rpm_ Make __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX accept flags clk: qcom: smd-rpm: Make DEFINE_CLK_SMD_RPM_BRANCH_A accept flags clk: qcom: smd-rpm: Make BI_TCXO_AO critical clk: qcom: smd-rpm: Make __DEFINE_CLK_SMD_RPM_PREFIX accept flags clk: qcom: smd-rpm: Separate out a macro for defining an AO clock clk: qcom: smd-rpm: Add support for keepalive votes clk: qcom: smd-rpm: Introduce DEFINE_CLK_SMD_RPM_BUS_KEEPALIVE clk: qcom: smd-rpm: Hook up PCNoC_0 keep_alive clk: qcom: smd-rpm: Hook up CNoC_1 and SNoC_2 keep_alive arm64: dts: qcom: msm8996: Enable rpmcc unused clk disablement Shawn Guo (3): clk: qcom: smd-rpm: Add .is_enabled hook clk: qcom: smd-rpm: Add .is_prepared hook clk: qcom: smd-rpm: Mark clock enabled in clk_smd_rpm_handoff() .../devicetree/bindings/clock/qcom,rpmcc.yaml | 6 + arch/arm64/boot/dts/qcom/msm8996.dtsi | 1 + drivers/clk/qcom/clk-smd-rpm.c | 133 +++++++++++++++------ 3 files changed, 106 insertions(+), 34 deletions(-) --- base-commit: fc31900c948610e7b5c2f15fb7795832c8325327 change-id: 20230303-topic-rpmcc_sleep-d67aad9f3012 Best regards,