From patchwork Wed Mar 8 21:35:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 660749 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 32AD8C74A4B for ; Wed, 8 Mar 2023 21:35:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230021AbjCHVfs (ORCPT ); Wed, 8 Mar 2023 16:35:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbjCHVfq (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 B2FCC9CBE2 for ; Wed, 8 Mar 2023 13:35:39 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id bi9so23153610lfb.2 for ; Wed, 08 Mar 2023 13:35:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311338; 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=QDlHCsdatk7h5R3zUsXpTRiwKW19DDuLF4HKqV/q1bg=; b=osg1GpfiQPSnkCrXraQM+3UriA4cjKvMkix3J0/xqRUCIIoUUX4nnNhIrBmtBQiKnD gePP3GBZ6QMmX5q4kilek17tUpgbO1ASRe776L8tUVxqk3TmpwlNJzqKPURdyyHE/WMU BT3pPYibiXQlN6feiN2B+AInyVpl/Y9yXdo+9vMUnspdaubHww4SRB/18DqQen3eVzHC 0R/KeD5QV4ZI4LWlIg13vyRz+4oGYnfF1Ft7AH4oyqClKnkCxy8OZpYDUBzSdZq9ZffP M36yfO0hKGomA91p8WSsOY/mwYDUjVFDlVVX1y5VPQYoTYtu4tpFVSIKTcJ10eENQ1qD tQHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311338; 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=QDlHCsdatk7h5R3zUsXpTRiwKW19DDuLF4HKqV/q1bg=; b=EsuplI1BD/nmtOzzuU32/nKlCpMs9kb+1PR87GcAf+MWq3NhFjYH5Xvwy7FqNF0lmd PggDXPNh6KqtyM2/8Yym0FAJxKtIbiRfVFeNt52cAZMU2dF7mNuQveawXydk2szw/buz l9xD1TC/QMw1w65UhgrLzLakCgVTDthdYZvdbWfmmVaxGhy+wEzB1fwca7XHcWE+2llw cOGGaJpKz/SUaM10PWHi+JDby0pWV4Ys0DJST43efjkSSYoYiSs2U4KhFjQiv3pXCwQm bDY9WASWKuqSkIFNOcmIzodozjyw7N2iJW9U14C6dhoKC/idVx0mldOa8zwW6yIIzPWy dxHA== X-Gm-Message-State: AO0yUKWAJQP2UnOsRyvN6O4J2WkQ0of1kci7g0fqncD8u9ai/nfuRKVR vpzv1r+n1xaIXG7s8oOqS1xYRg== X-Google-Smtp-Source: AK7set9jKKS1d8eD16jz2TNullASEgcLm6DVH+d8w29UZNhGZI2EIfH5sDM7BrWWmTsnagUc8sH6Ag== X-Received: by 2002:a05:6512:25b:b0:4dd:ab39:86e0 with SMTP id b27-20020a056512025b00b004ddab3986e0mr6214451lfo.27.1678311337931; Wed, 08 Mar 2023 13:35:37 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:37 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:17 +0100 Subject: [PATCH RFT v2 01/14] dt-bindings: clock: qcom,rpmcc: Add a way to enable unused clock cleanup MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-1-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> 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 X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=2006; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=kU+or0SIwjfCFe3CHtYMpTgzGECGUtYX8Fz74pRBjmw=; b=xakONkb1YLP0DXpf6jbByNh8PngvZtgp8nUR3XoamblbthS/l/94cTLlNZLqyAgOaLmx+zNacVua CppU+tiMDl4K7Y31exizgRwrFp/ZEBt95LxBUjQfHTTMDa5jS9yo X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Disabling RPMCC clocks can be a bit touchy. If we can't guarantee all (or at least most) of the oneline peripherals ask the interconnect framework to keep their buses online and guarantee enough bandwidth, we're relying on bootloader defaults to keep the said buses alive through RPM requests and rate setting on RPM clocks. Without that in place, the RPM clocks are never enabled in the CCF, which qualifies them to be cleaned up, since - as far as Linux is concerned - nobody's using them and they're just wasting power. Doing so will end tragically, as within miliseconds we'll get *some* access attempt on an unlocked bus which will cause a platform crash. On the other hand, if we want to save power and put well-supported platforms to sleep, we should be shutting off at least some of these clocks (this time with a clear distinction of which ones are *actually* not in use, coming from the interconnect driver). To differentiate between these two cases while not breaking older DTs, introduce an opt-in property to correctly mark RPM clocks as enabled after handoff (the initial max freq vote) and hence qualify them for the common unused clock cleanup. Signed-off-by: Konrad Dybcio --- Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml index 2a95bf8664f9..386153f61971 100644 --- a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +++ b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml @@ -58,6 +58,12 @@ properties: minItems: 1 maxItems: 2 + qcom,clk-disable-unused: + type: boolean + description: + Indicates whether unused RPM clocks can be shut down with the common + unused clock cleanup. Requires a functional interconnect driver. + required: - compatible - '#clock-cells' From patchwork Wed Mar 8 21:35:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 660748 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 F0C33C76186 for ; Wed, 8 Mar 2023 21:35:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbjCHVfv (ORCPT ); Wed, 8 Mar 2023 16:35:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbjCHVfs (ORCPT ); Wed, 8 Mar 2023 16:35:48 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BF1999BD0 for ; Wed, 8 Mar 2023 13:35:42 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id s22so23091658lfi.9 for ; Wed, 08 Mar 2023 13:35:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311341; 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=hMJaPWZzvgr1zZRk25pniV8MNs32JGnZ0ctQITcox7M=; b=vKrNdtp74XinQeNY4eMDGuSmvkyKQGDqeQBhsMhjY4fdPFriJ/A/gnKkP1o1Rj5hGd d17LdIQDyFuSpT2Vfj7n7jHcMdiuoTW/TlXkk2saJZraSak8jwZ4Q24GswuNvxiAG74y UIkMljkp3U+T6aBAVWMxiZCBNWyRgmu0YLRi9L8sGgJwaKegUSS8EDgULQ+IQ03gMFx6 l2fjXcX3reu/Cu0ptyee4UayN1EImRLVAhamofdEb9uEo3zSaVG7Ko97sziZIay7InL2 XuZXMX/aRgxC28XHPPNGYfZej9i+JhM/Hg2bsCWhnKvmC0bkRYhNQuyOSLjeTRXqhT5r tcFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311341; 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=hMJaPWZzvgr1zZRk25pniV8MNs32JGnZ0ctQITcox7M=; b=G8UxOhfsXm09eS6MwDrAd22nTWfAGBzgX30uz0zbtJ8Y9corn4bEwugLFBu2z3NOaQ jeTepkhBbpKkL7xe8r3He6mRUNSDKWPvu9WPhmd4SkAriLdKcwNWs5rjnGUo2jUvGPJ4 eidC1dbcxeD5Www+vyNSMqq64ZuBVataiICPFiPzEmtCYAWowl56dktLwyF6v9kaQoPf 02NztAdFTBkUmnCfzT7yPrscvf0pdCXkxdESKDtIYARQfzWtWlZ4tUKLWCjx8aMEwlJj TQFUc/tkTyZSR+KNylwK1+H0xNV+tmDJsOi7JfxTMu+NcODciS/BrnAVtj7vrPNRzc8e 3iCQ== X-Gm-Message-State: AO0yUKV4zM8Sg4A/Qwa0dwVTZLN3vORlfZIY6+2hLJ3BKuZnlz7TJXVH vZ3GJtuDBrCFc8h4VzsFZm9jgQ== X-Google-Smtp-Source: AK7set/JPTntxaKTZcLdE5KqdvSF5AcoXwGRJn/HF6O72/daeXJyZEV1ZobxCAwgpbYkndOGpkFLRA== X-Received: by 2002:ac2:533c:0:b0:4dd:a7fb:1e7c with SMTP id f28-20020ac2533c000000b004dda7fb1e7cmr6210843lfh.3.1678311341007; Wed, 08 Mar 2023 13:35:41 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:40 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:19 +0100 Subject: [PATCH RFT v2 03/14] clk: qcom: smd-rpm: Add .is_prepared hook MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-3-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> 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 X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=1482; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=IcjgjHunD3zMZaFeCfHoL5cnPI0PmUW34gmf6fJPVyQ=; b=XRRU/aPY7IT5XMd/T58u1InRETQd/B3Yhxj0yGAMrEQOfmdVugwndUVxyE9RQFkJpxKP4wWNbu/N yGcVWciwAl1WH/YY2FamRSLaf5lO4N4wNpnx5oA33Np6wonJwq7K X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Shawn Guo The RPM clocks are enabled/disabled through clk framework prepare/unprepare hooks. Without .is_prepared hook, those unused RPM clocks will not be disabled by core function clk_unprepare_unused_subtree(), because clk_core_is_prepared() always returns 0. Add .is_prepared hook to clk_ops and return the clock prepare (enable) state, so that those unused RPM clocks can be disabled by clk framework. Signed-off-by: Shawn Guo [Konrad: rebase, don't duplicate the enable func] Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index ecacfbc4a16c..cce7daa97c1e 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -438,6 +438,7 @@ static const struct clk_ops clk_smd_rpm_ops = { .round_rate = clk_smd_rpm_round_rate, .recalc_rate = clk_smd_rpm_recalc_rate, .is_enabled = clk_smd_rpm_is_enabled, + .is_prepared = clk_smd_rpm_is_enabled, }; static const struct clk_ops clk_smd_rpm_branch_ops = { @@ -445,6 +446,7 @@ static const struct clk_ops clk_smd_rpm_branch_ops = { .unprepare = clk_smd_rpm_unprepare, .recalc_rate = clk_smd_rpm_recalc_rate, .is_enabled = clk_smd_rpm_is_enabled, + .is_prepared = clk_smd_rpm_is_enabled, }; DEFINE_CLK_SMD_RPM_BRANCH_A(bi_tcxo, QCOM_SMD_RPM_MISC_CLK, 0, 19200000); From patchwork Wed Mar 8 21:35:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 660747 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 AC580C64EC4 for ; Wed, 8 Mar 2023 21:36:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229577AbjCHVf7 (ORCPT ); Wed, 8 Mar 2023 16:35:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229760AbjCHVfy (ORCPT ); Wed, 8 Mar 2023 16:35:54 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CDDED1ADC for ; Wed, 8 Mar 2023 13:35:45 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id f18so23133979lfa.3 for ; Wed, 08 Mar 2023 13:35:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311344; 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=ov5RMn4u4UzKJ3B2Go2X9BkWY6GJei++Q812Yrin8NQ=; b=AxhmL4HahGAmk4iXonM1WZnW6wfLggY8ACu1c7y/UUUX50xPNa6ZMfCFXIdx9ySf9B Kp4CHTl5eVmBoqaiegAqMDHPGeA2jm281La5XN8hGZVQvfGFZPsXi/2R8Wx4Xqg8pSTL 7x2cD7elmtx62OdCkJA1uYcgy3YzpiMjMbAoD7eT5EpYnM5eBkIHm0gzGtFmbICOGZwc /pAJESYHr5wN7jd9vh8sNHflicgIO3Nt+KatIewTqS178ZSiBiquaBGAIsgUtUlZlLFf q4blRWTFq9zvFxeNLz39okmM+Fa7hlQK3WL5qijMd7pjfdcoe6xh2RrcbbRP+7fMpq2S SUvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311344; 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=ov5RMn4u4UzKJ3B2Go2X9BkWY6GJei++Q812Yrin8NQ=; b=69Pfgebb//8EIrk/v8uhf6NNflfKGMBUZST/NjmTw5Ri43ZRpmZ4mzbv7VOI607clE r/+tsGQ+HiNLMZkLb30bEbMSq5eNQFVpNVmufRH5ebydOsbFkNMjoOqTKXFUw7mBrCft /wE0hIZXqd0J2zJcuxVuSJwO2LmPCAjf80oE7RPac1BjhC6clf1TrdyNQO+bRdDc/q82 Djf3iV36Pt0pJa24M7E36oAHOoeKWrEXW8lxpNUYulrV41vQmzrZ1vC7NIDZLH1IebpC 5Q459gtAx8uc0ynzL5hcc/ngsl7fYw+8MQqkwJ8icPwmEGGnOcrIFistOg//2u/PVw6l IOzw== X-Gm-Message-State: AO0yUKWTohNqxQ9c69YQRMFReLBZdDPCcEJbpqpZR5L+yTiCNDP9RwKP 6uXpujzf5/7odGD5dz4v16hrWhWeQZksnsVwtxk= X-Google-Smtp-Source: AK7set9dma1j6Hpgq09B0UyfOJ4VTgSFw6jduwHFeZviyO9dnKsNOae9xfK14OlgNweaqopTCKXu7g== X-Received: by 2002:a05:6512:38c6:b0:4db:387f:a3af with SMTP id p6-20020a05651238c600b004db387fa3afmr4619602lft.4.1678311343950; Wed, 08 Mar 2023 13:35:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:43 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:21 +0100 Subject: [PATCH RFT v2 05/14] clk: qcom: smd-rpm: Make DEFINE_CLK_SMD_RPM_BRANCH_A accept flags MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-5-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> 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 X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=1812; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=svZJYxWNeuanDoOsLpbm2ZL4k08Cxtikg953kjcomQI=; b=sWofPdTB+S2gmrrLLUFIgZQAJ2Dpw8GiAIqWBFrlUA0dFPLwJP/f1iFMOzWa5eP3iGN9mRFIVl6i PnKA34jlACMIaRLdI7hJ6pz6gH95zN0ugXHXujjpvItq48fx3w8B X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org In preparation for supporting keepalive clocks which can never be shut off (as the platform would fall apart otherwise), make the DEFINE_CLK_SMD_RPM_BRANCH_A macro accept clock flags for the active-only clock. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 72b1f010509b..fec6ae4a8989 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -129,10 +129,10 @@ _name##_clk, _name##_a_clk, \ type, r_id, r, QCOM_RPM_SMD_KEY_ENABLE, 0) -#define DEFINE_CLK_SMD_RPM_BRANCH_A(_name, type, r_id, r) \ +#define DEFINE_CLK_SMD_RPM_BRANCH_A(_name, type, r_id, r, ao_flags) \ __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(branch_, \ _name, _name##_a, type, \ - r_id, r, QCOM_RPM_SMD_KEY_ENABLE, 0) + r_id, r, QCOM_RPM_SMD_KEY_ENABLE, ao_flags) #define DEFINE_CLK_SMD_RPM_QDSS(_name, type, r_id) \ __DEFINE_CLK_SMD_RPM(_name##_clk, _name##_a_clk, \ @@ -450,10 +450,10 @@ static const struct clk_ops clk_smd_rpm_branch_ops = { .is_prepared = clk_smd_rpm_is_enabled, }; -DEFINE_CLK_SMD_RPM_BRANCH_A(bi_tcxo, QCOM_SMD_RPM_MISC_CLK, 0, 19200000); +DEFINE_CLK_SMD_RPM_BRANCH_A(bi_tcxo, QCOM_SMD_RPM_MISC_CLK, 0, 19200000, 0); DEFINE_CLK_SMD_RPM_BRANCH(qdss, QCOM_SMD_RPM_MISC_CLK, 1, 19200000); DEFINE_CLK_SMD_RPM_QDSS(qdss, QCOM_SMD_RPM_MISC_CLK, 1); -DEFINE_CLK_SMD_RPM_BRANCH_A(bimc_freq_log, QCOM_SMD_RPM_MISC_CLK, 4, 1); +DEFINE_CLK_SMD_RPM_BRANCH_A(bimc_freq_log, QCOM_SMD_RPM_MISC_CLK, 4, 1, 0); DEFINE_CLK_SMD_RPM_BRANCH(mss_cfg_ahb, QCOM_SMD_RPM_MCFG_CLK, 0, 19200000); From patchwork Wed Mar 8 21:35:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 660746 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 2A08EC6FD19 for ; Wed, 8 Mar 2023 21:36:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230189AbjCHVgP (ORCPT ); Wed, 8 Mar 2023 16:36:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbjCHVfz (ORCPT ); Wed, 8 Mar 2023 16:35:55 -0500 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B62CDD293C for ; Wed, 8 Mar 2023 13:35:49 -0800 (PST) Received: by mail-lj1-x22e.google.com with SMTP id f16so18013524ljq.10 for ; Wed, 08 Mar 2023 13:35:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311348; 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=TQfh2WbVBXCGhONYJZDP8O9PA2kbZ/WsteDRJW+CEEo=; b=jlT64jGnX9EyFQbSCp7Bn017VtmEaLUeLCtmD5RVnxofRuyJmVNspcSNivRnK5XL5L +kBcOEEzSDuEgU7b5i/s+wlOoTNWHuiLKd4Lw5kKvZL0hG0JCt0zIbjQCb4odX3G2+tQ Z2D7WcIwQMkP+fkb81gxKNyp9oIhxobO/7OB9PYZYrKVBBoPNLcz+va9hOaC0aBhIMkJ Bkfx/OMZXVCo4A9m/mpkZka7E1WvILbGrlGC4xwN9JuOCdZ8XxWxKJ7GlNNB/Z/SWd1T 7VZBsAfX9UEgiJcCeJ519HuSqoZCQVsLfiVqCJgOhlhdSfp37F80B5hSzlbW5T7J3JmL 6yZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311348; 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=TQfh2WbVBXCGhONYJZDP8O9PA2kbZ/WsteDRJW+CEEo=; b=LT9K0UPIkjppZWYf2NLtMNdP56IEkdYAHkrPPdYnasV1hUIfivj73IghiE040/NNzH de7W9QWZDmTDkxf+SC2qjRu2Rm+/yWhC7osC/XvqLSjj1WFAqZmqGIrHLOUbJLWwW5DP h73BX0wLatyxx7rW2soxLXRmy/yE854ZZE9C7Orvxh8nZBmdSV95EudnGUs7VIS92kz7 SjVxJ6J1jCGcjctCcx6jqvkEeYxrdBpWa6+V0hRYhC2RoCAllLVS7JzVYpI14T+cbz0R QbMNwTAbAZZ9DNZYZGE/8p97zjr+ayJFIFvdXW0mevQO717KMoPQ8gYJN1cSE/u/nR7a 3RQA== X-Gm-Message-State: AO0yUKWTuw1cG4LQzSyYY7vkvbqnZz18W8HM8ayPJJeo8qc+sfrBf87P kWpXuItsSzS8K2Jru4QGD5/WxA== X-Google-Smtp-Source: AK7set+y+DjLgIW7cnOdetKMsRZ4JWT/c1FWUTq7ipcbLcRS7Ib4CpBEwYEsN1IXPTaza1CY4QrbrQ== X-Received: by 2002:a2e:7810:0:b0:295:b005:1d56 with SMTP id t16-20020a2e7810000000b00295b0051d56mr5751684ljc.17.1678311347868; Wed, 08 Mar 2023 13:35:47 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:47 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:23 +0100 Subject: [PATCH RFT v2 07/14] clk: qcom: smd-rpm: Make __DEFINE_CLK_SMD_RPM_PREFIX accept flags MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-7-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> 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 X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=1880; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=psKSvGQDNyeXFzjuSkxyveilkS0EXbnLPmqC1X+KBDY=; b=BNP9g6R4cFS3/Yrb9t5P/MOac0VdgbxoI+qmXh6hIoCVitEsxsgiU5LyXmHV31X+F2mf/Q0b+636 4HBTf54rCPB/sF1gXBv7ClninZknYlvqL3ULKsdw8p1TJd1D0NJV X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org In preparation for supporting keepalive clocks which can never be shut off (as the platform would fall apart otherwise), make the __DEFINE_CLK_SMD_RPM_PREFIX macro accept clock flags for the active-only clock. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 9dc779360ada..ddb4268ba2a5 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -26,7 +26,7 @@ #define QCOM_RPM_SCALING_ENABLE_ID 0x2 #define __DEFINE_CLK_SMD_RPM_PREFIX(_prefix, _name, _active, \ - type, r_id, key) \ + type, r_id, key, ao_flags) \ static struct clk_smd_rpm clk_smd_rpm_##_prefix##_active; \ static struct clk_smd_rpm clk_smd_rpm_##_prefix##_name = { \ .rpm_res_type = (type), \ @@ -58,13 +58,14 @@ .fw_name = "xo", \ .name = "xo_board", \ }, \ + .flags = (ao_flags), \ .num_parents = 1, \ }, \ } #define __DEFINE_CLK_SMD_RPM(_name, _active, type, r_id, key) \ __DEFINE_CLK_SMD_RPM_PREFIX(/* empty */, _name, _active, \ - type, r_id, key) + type, r_id, key, 0) #define __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(_prefix, _name, _active,\ type, r_id, r, key, ao_flags) \ @@ -117,7 +118,7 @@ #define DEFINE_CLK_SMD_RPM_BUS(_name, r_id) \ __DEFINE_CLK_SMD_RPM_PREFIX(bus_##r_id##_, \ _name##_clk, _name##_a_clk, QCOM_SMD_RPM_BUS_CLK, r_id, \ - QCOM_RPM_SMD_KEY_RATE) + QCOM_RPM_SMD_KEY_RATE, 0) #define DEFINE_CLK_SMD_RPM_CLK_SRC(_name, type, r_id) \ __DEFINE_CLK_SMD_RPM( \ From patchwork Wed Mar 8 21:35:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 660745 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 C4784C76188 for ; Wed, 8 Mar 2023 21:36:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230078AbjCHVgT (ORCPT ); Wed, 8 Mar 2023 16:36:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230140AbjCHVgI (ORCPT ); Wed, 8 Mar 2023 16:36:08 -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 1D225DC3AC for ; Wed, 8 Mar 2023 13:35:52 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id bi9so23154217lfb.2 for ; Wed, 08 Mar 2023 13:35:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311351; 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=/go9JzzVOEsVKPzeAceWp3TS35nZ2mbESw1jgSMGm7A=; b=y1r7IR/q5CFB+NwNRrjeOgw5mcgy6SiAP4aq4/6uUugMPqIEkqrjka4MJovtVPukAF KtjQCWEh9dDUBqPQA9A4S7UT+t+FBa5pSCbrC0fiZhIKlITgO622Vfmpa2RVgdFtlz/b OWGm55WlYQtq5LoEBJultPT4Tff4KXJS8GEJgbnE9rS/VN7UwD6YRqEDEecUb+A2FmWU 13pImcnL1JbaAdAdcI2QmXGce/DRUOnEhUcPUXzAOvPOx19QmeBe+BGAxEghssfzCNLn upVManq9skJmwnplxBX5CudGvJSkxVkzwloS6kvE3imD96UWE61rlEB2wDD+DGFiGr5B npFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311351; 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=/go9JzzVOEsVKPzeAceWp3TS35nZ2mbESw1jgSMGm7A=; b=5KfbmbO7YTTwWdANN9Pjgm94QgPT6uHm0SlbXKJ69JANZOFzc3SXLu0ik54neYpwUL v3vK6DpMRBYGBazj+kc5xKz6H5WnFlAP5D+Mzxg6B1TBKU5A+XOmRQY1Kqzz2Ylx7bsr 7wDst1e8Pj1aQlLsnHfse7Q14NF1bX0aIwPPh4lac8nYtxOubxybv3TAup5VJbaKK339 2BLSWi/beUpNVZqBr7VQT64fgpkBftGB7Efz6LMDXe/aF4sEZQwzyUaptNGxM9V2g8B/ ZeeMSaIoZsMp5pDPe0UD5Cal4bA2fZvPgECPvj0TPbBxM5F0hD4bDaL5WuD9V7waf03b uQVQ== X-Gm-Message-State: AO0yUKW8Pud2q6hVrBzQH1x0/yBCvcRRVLuIQ2Iao4tAZMsF5d7KOv+Y 3U9pj3zneCpnBDQz+epWDxgYYQ== X-Google-Smtp-Source: AK7set+wUGkTJxfe/LDVdq6Rbt04pIceTywLx4q2uqA4bXqqssqCvaGnGHMD/pXuXb535yBp1Hb3yg== X-Received: by 2002:a05:6512:401d:b0:4e7:ff1c:6030 with SMTP id br29-20020a056512401d00b004e7ff1c6030mr4353486lfb.15.1678311351542; Wed, 08 Mar 2023 13:35:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:51 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:25 +0100 Subject: [PATCH RFT v2 09/14] clk: qcom: smd-rpm: Add support for keepalive votes MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-9-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> 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=3522; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=PET/xgo25kPZz4y++jzQYNkadiG9KbkszadHqMCSmYo=; b=U8c6gZZepRlLHsxJCUUNeNSgs2R1pXwK8Oz0lee09UzA9sQohyMnpsOokWw2mt5ez6+UA+8waarz 1XTH+4oZBjlT8ZUcGNF9pFFN0kJ4hArj/ANRqAQUEIswdP4QS8cl X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Some bus clock should always have a minimum (19.2 MHz) vote cast on them, otherwise the platform will fall apart, hang and reboot. Add support for specifying which clocks should be kept alive and always keep a vote on XO_A to make sure the clock tree doesn't collapse. This removes the need to keep a maximum vote that was previously guaranteed by clk_smd_rpm_handoff. This commit is a combination of existing (not-exactly-upstream) work by Taniya Das, Shawn Guo and myself. Co-developed-by: Shawn Guo Co-developed-by: Taniya Das Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index eb7781e5c8c1..d89918f9ae60 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -45,15 +45,17 @@ }, \ }; \ __DEFINE_CLK_SMD_RPM_AO_PREFIX(_prefix, _name, _active, type, \ - r_id, key, ao_flags) + r_id, key, ao_flags, false) #define __DEFINE_CLK_SMD_RPM_AO_PREFIX(_prefix, _name, _active, \ - type, r_id, key, ao_flags) \ + type, r_id, key, ao_flags, \ + _keep_alive) \ static struct clk_smd_rpm clk_smd_rpm_##_prefix##_active = { \ .rpm_res_type = (type), \ .rpm_clk_id = (r_id), \ .active_only = true, \ .rpm_key = (key), \ + .keep_alive = (_keep_alive), \ .peer = &clk_smd_rpm_##_prefix##_name, \ .rate = INT_MAX, \ .hw.init = &(struct clk_init_data){ \ @@ -170,6 +172,7 @@ struct clk_smd_rpm { const bool active_only; bool enabled; bool branch; + bool keep_alive; struct clk_smd_rpm *peer; struct clk_hw hw; unsigned long rate; @@ -198,11 +201,16 @@ static int clk_smd_rpm_handoff(struct clk_smd_rpm *r) .value = cpu_to_le32(r->branch ? 1 : INT_MAX), }; + /* Set up keepalive clocks with a minimum bus rate */ + if (r->keep_alive) + req.value = cpu_to_le32(19200); /* 19.2 MHz */ + ret = qcom_rpm_smd_write(r->rpm, QCOM_SMD_RPM_ACTIVE_STATE, r->rpm_res_type, r->rpm_clk_id, &req, sizeof(req)); if (ret) return ret; + ret = qcom_rpm_smd_write(r->rpm, QCOM_SMD_RPM_SLEEP_STATE, r->rpm_res_type, r->rpm_clk_id, &req, sizeof(req)); @@ -438,12 +446,29 @@ static int clk_smd_rpm_is_enabled(struct clk_hw *hw) return r->enabled; } +static int clk_smd_rpm_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) +{ + struct clk_smd_rpm *r = to_clk_smd_rpm(hw); + + /* + * RPM resolves the rates internally. All we have to do on the kernel + * side is ensure that we don't accidentally put down the keepalive + * clocks, which could happen if they received a vote below 19.2 MHz. + */ + if (r->keep_alive) + req->rate = max(req->rate, 19200000UL); + + return 0; +} + static const struct clk_ops clk_smd_rpm_ops = { .prepare = clk_smd_rpm_prepare, .unprepare = clk_smd_rpm_unprepare, .set_rate = clk_smd_rpm_set_rate, .round_rate = clk_smd_rpm_round_rate, .recalc_rate = clk_smd_rpm_recalc_rate, + .determine_rate = clk_smd_rpm_determine_rate, .is_enabled = clk_smd_rpm_is_enabled, .is_prepared = clk_smd_rpm_is_enabled, }; From patchwork Wed Mar 8 21:35:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 660744 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 33C39C64EC4 for ; Wed, 8 Mar 2023 21:36:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230207AbjCHVgk (ORCPT ); Wed, 8 Mar 2023 16:36:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230036AbjCHVgQ (ORCPT ); Wed, 8 Mar 2023 16:36:16 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2363D30A7 for ; Wed, 8 Mar 2023 13:35:55 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id s22so23092307lfi.9 for ; Wed, 08 Mar 2023 13:35:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311355; 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=18sKuiUZ5qcOhA0BPqaLsV7V9u6MXywtAtqfprvdNpA=; b=kuEZA5WBA7SdWEEPArS0NM4NxQySePTy4hToYIWbXUWY7BIyxK5OQOkExJoqS37sqJ ksUsiRFu6luv9pWWU7g/iArQgc+tvBiEtwQ2zIllLO2sp3mUvM+eiTTEg1BRiyR33bAj 4Z3ghgRDlyXwUbcVOqv/J4VZUv/mG9OiBFzkVCegd/+ZWI9y43yRNm2mL5QKdVsX+r7N RGfKC9CnAcucB2u8kLgPifyNjkRP3Szmv29xF2jztYOY1Ip2kfqH0k4jMn08jH6leefy jTFnLaMu8kAWVjtBt0aii740oa0lU8Y2I/lGP+1P9y7CoK4zqvjWKDuBV8wiAOH7hjyq 2aVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311355; 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=18sKuiUZ5qcOhA0BPqaLsV7V9u6MXywtAtqfprvdNpA=; b=Z4ljF+W86cPGFw/GOPKBHQG13k7d1au9V95VXeWLyw7mXow0MMg2Tic7ezySM0KL0e L44RBCnYEGIDhL5sYuRX/yFjU5v2P969U75XeMN0N6/za29Dt3ig0kfBNomjcD6QOcdn tA4uxjqXpZOCeeMv2L+hNOqycgHu32MuVd8rasLd+CtwTNlpiC1BVsATZS6MMplbcNTC svctaqOuE+TcGWzkHS02lgAewxgZHiJSR/AmwgsSkXTrHQmTfMvc+C5/D7/V+gw2updj EOpKvpauX5RNpQsGTAoX9eoxrbazWzU+xyi6Xr7ntVh1T8ErPJen/qZv9SdXxsJ6a+Kj EAHg== X-Gm-Message-State: AO0yUKW8/TNG0tTWFFkA0jdt+Zwcu+ENEpPCGEY/9/0ekqBepEe2CHv5 3Adq3B0da5azT7Xg929OiZMvVw== X-Google-Smtp-Source: AK7set85U3bH/mA2/qRDLBvxVOfcB9k/oV2D4aRe319AMMSu9H7/PRIKpH/rib4+Bj4ImxyKxSAOCQ== X-Received: by 2002:ac2:50c9:0:b0:4a4:68b7:d64b with SMTP id h9-20020ac250c9000000b004a468b7d64bmr5468773lfm.50.1678311355132; Wed, 08 Mar 2023 13:35:55 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:54 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:27 +0100 Subject: [PATCH RFT v2 11/14] clk: qcom: smd-rpm: Hook up PCNoC_0 keep_alive MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-11-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> 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 X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=7589; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=ht1r9OGUoEseRFNQ9l7Gc9DH17HBnASp+IBgQCKWpG4=; b=w8IKPEIDXvKB2pFy9RLASr+KNH5tUDGfcQhHLgRHnGVwcpV2nKhRVeQEXX36aZ3QdUHn0lcvbqYr ZRlBn1P1D7uMDgi/2kj3Lyqx1PRn0SQ0zldTs02q2hUdgHshrcZi X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 14 [1] of our 18 supported platforms need an active keepalive vote on PCNoC_0 so as not to cause havoc on the entire SoC. Guarantee that. [1] there are 13 changes to driver data, but 8226 reuses 8974. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 8e25b3d7d30c..a44b52bd0c83 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -500,6 +500,7 @@ DEFINE_CLK_SMD_RPM(aggre1_noc, QCOM_SMD_RPM_AGGR_CLK, 1); DEFINE_CLK_SMD_RPM(aggre2_noc, QCOM_SMD_RPM_AGGR_CLK, 2); DEFINE_CLK_SMD_RPM_BUS(pcnoc, 0); +DEFINE_CLK_SMD_RPM_BUS_KEEP_ALIVE(pcnoc, 0); DEFINE_CLK_SMD_RPM_BUS(snoc, 1); DEFINE_CLK_SMD_RPM_BUS(sysmmnoc, 2); DEFINE_CLK_SMD_RPM_BUS(cnoc, 2); @@ -558,7 +559,7 @@ DEFINE_CLK_SMD_RPM_XO_BUFFER(div_clk3, 13, 19200000); static struct clk_smd_rpm *msm8909_clks[] = { [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -592,7 +593,7 @@ static const struct rpm_smd_clk_desc rpm_clk_msm8909 = { static struct clk_smd_rpm *msm8916_clks[] = { [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -626,7 +627,7 @@ static struct clk_smd_rpm *msm8936_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -660,7 +661,7 @@ static const struct rpm_smd_clk_desc rpm_clk_msm8936 = { static struct clk_smd_rpm *msm8974_clks[] = { [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, @@ -712,7 +713,7 @@ static struct clk_smd_rpm *msm8976_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -746,7 +747,7 @@ static struct clk_smd_rpm *msm8992_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_OCMEMGX_CLK] = &clk_smd_rpm_ocmemgx_clk, [RPM_SMD_OCMEMGX_A_CLK] = &clk_smd_rpm_ocmemgx_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -804,7 +805,7 @@ static struct clk_smd_rpm *msm8994_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_OCMEMGX_CLK] = &clk_smd_rpm_ocmemgx_clk, [RPM_SMD_OCMEMGX_A_CLK] = &clk_smd_rpm_ocmemgx_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -864,7 +865,7 @@ static struct clk_smd_rpm *msm8996_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, @@ -918,7 +919,7 @@ static struct clk_smd_rpm *qcs404_clks[] = { [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_qdss_a_clk, [RPM_SMD_PNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, @@ -948,7 +949,7 @@ static struct clk_smd_rpm *msm8998_clks[] = { [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, @@ -1010,7 +1011,7 @@ static struct clk_smd_rpm *sdm660_clks[] = { [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_2_cnoc_clk, [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_2_cnoc_a_clk, [RPM_SMD_CNOC_PERIPH_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_CNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_CNOC_PERIPH_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_MMSSNOC_AXI_CLK] = &clk_smd_rpm_mmssnoc_axi_rpm_clk, @@ -1052,7 +1053,7 @@ static struct clk_smd_rpm *mdm9607_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QPIC_CLK] = &clk_smd_rpm_qpic_clk, @@ -1074,7 +1075,7 @@ static struct clk_smd_rpm *msm8953_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_PCNOC_CLK] = &clk_smd_rpm_bus_0_pcnoc_clk, - [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_clk, + [RPM_SMD_PCNOC_A_CLK] = &clk_smd_rpm_bus_0_pcnoc_a_keep_alive_clk, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_1_snoc_clk, [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_1_snoc_a_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, From patchwork Wed Mar 8 21:35:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 660743 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 AC146C742A7 for ; Wed, 8 Mar 2023 21:36:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230285AbjCHVg5 (ORCPT ); Wed, 8 Mar 2023 16:36:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjCHVgS (ORCPT ); Wed, 8 Mar 2023 16:36:18 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3808D309A for ; Wed, 8 Mar 2023 13:35:58 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id n2so23075200lfb.12 for ; Wed, 08 Mar 2023 13:35:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311356; 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=D4XnwTKK+r/ENEsY5xL5W4CAtIX7vncEORsdYqk3zz8=; b=gX777jL/5l6kIjI27QmqsyX79SF8nW8A0qVANxM9lSgrvA8+n6GoLs/Yv5v0fxKza+ 0MP40fOz85b2O+zV1XDcRsBXKqL8MH2QhoSYNWwyS6DU2nEsoRhpSiLQu8TzK5fxUt8z jvYebb9QXjQ5m2e80f7aRscvKrspADRTmI0iRXPdhs8Tnm3Dkpp998ZsV5tYMjbTzTKo r0oZR/UvRX5lZBAMNO+xJjhrwc2Co1YG1384CWujXk+ZTEvCeXemwCafgZAv8BAsxiTE NBixBt2VTokQiO3QMXgzP7PQV1kxX2JkP28T6Dkh8D0AUeSrSar8rGAqgiY4wnfYqp2L fflA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311356; 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=D4XnwTKK+r/ENEsY5xL5W4CAtIX7vncEORsdYqk3zz8=; b=cqBewQL9dzZlae+MsjmxtCQ2lncE7SjVNyzVApBfHdJNpm9B1KtQlhQ9z0FNP43lre t56gtqujxwXFES4klubMhZQ29WziW5LzgXg+Sf3te73h+EXqMp53lytDZgdTWOHoSwD/ U2GEF+AuQViG9i+6PQawVrSyKUaJgIMn4QkpzuFnzTRyaN8OTvNM6nmTDEr1Eirsu3yS HJqN0q6dIPzpIenz1NCmqu/UfgRkpjibpAtmhGryDS1YaTOQi7idBLIg5cOe/OmVcDEU Ze7ntVS7V1uUy+W4YBpfM6kIaw/eOzdrU8zwnm9ssxZk03cyOgPJ/BEHW121EF28yEFS X/ug== X-Gm-Message-State: AO0yUKU6T2zIBEUvTleDXXy4iZsipfyiRU0onV0ha5BBQLRUZrFwgcZh fNWAnch7O+apusztmWEczDl1KA== X-Google-Smtp-Source: AK7set+LiU1LGn6kjvZ8TOavZQwSLWsnj3ZSJWqAQ5ozQw6k0x5p7VRZoONoQjyaQkuDHYzdmnKmfw== X-Received: by 2002:ac2:5a45:0:b0:4cc:8682:ec5c with SMTP id r5-20020ac25a45000000b004cc8682ec5cmr5076161lfn.34.1678311356522; Wed, 08 Mar 2023 13:35:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:56 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:28 +0100 Subject: [PATCH RFT v2 12/14] clk: qcom: smd-rpm: Hook up CNoC_1 and SNoC_2 keep_alive MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-12-ae80a325fe94@linaro.org> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> In-Reply-To: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> 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 X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1678311334; l=4801; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=bvsdJLy7tgag7pJIG/YhqythrBFn4s7xKZ0bdeefut8=; b=J7M28LAzUYEMYIao58B7D+APzztZRI1TsQUe1Yors/2XpeGwGjVfdXjMHBiYHvyvbLpjaLGKin5g lGpXKd06B4R8gu/XE9vn+KOlp5fJ1ZS1P/6FK2MWGQOr2N9+4kFD X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 4 of our 18 supported platforms need an active keepalive vote on CNoC_1 and SNoC_2 so as not to cause havoc on the entire SoC. Guarantee that. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index a44b52bd0c83..ef3157fd29d5 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -507,7 +507,9 @@ DEFINE_CLK_SMD_RPM_BUS(cnoc, 2); DEFINE_CLK_SMD_RPM_BUS(mmssnoc_ahb, 3); DEFINE_CLK_SMD_RPM_BUS(snoc_periph, 0); DEFINE_CLK_SMD_RPM_BUS(cnoc, 1); +DEFINE_CLK_SMD_RPM_BUS_KEEP_ALIVE(cnoc, 1); DEFINE_CLK_SMD_RPM_BUS(snoc, 2); +DEFINE_CLK_SMD_RPM_BUS_KEEP_ALIVE(snoc, 2); DEFINE_CLK_SMD_RPM_BUS(snoc_lpass, 5); DEFINE_CLK_SMD_RPM(bimc, QCOM_SMD_RPM_MEM_CLK, 0); @@ -1111,7 +1113,7 @@ static struct clk_smd_rpm *sm6125_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, + [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_keep_alive_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, @@ -1121,7 +1123,7 @@ static struct clk_smd_rpm *sm6125_clks[] = { [RPM_SMD_RF_CLK2] = &clk_smd_rpm_rf_clk2, [RPM_SMD_RF_CLK2_A] = &clk_smd_rpm_rf_clk2_a, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, + [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_keep_alive_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, @@ -1154,7 +1156,7 @@ static struct clk_smd_rpm *sm6115_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, + [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_keep_alive_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, @@ -1164,7 +1166,7 @@ static struct clk_smd_rpm *sm6115_clks[] = { [RPM_SMD_RF_CLK2] = &clk_smd_rpm_rf_clk2, [RPM_SMD_RF_CLK2_A] = &clk_smd_rpm_rf_clk2_a, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, + [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_keep_alive_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_CE1_CLK] = &clk_smd_rpm_ce1_clk, @@ -1194,13 +1196,13 @@ static struct clk_smd_rpm *sm6375_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, + [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_keep_alive_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, [RPM_SMD_QDSS_A_CLK] = &clk_smd_rpm_branch_qdss_a_clk, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, + [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_keep_alive_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_QUP_CLK] = &clk_smd_rpm_qup_clk, @@ -1231,7 +1233,7 @@ static struct clk_smd_rpm *qcm2290_clks[] = { [RPM_SMD_XO_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo, [RPM_SMD_XO_A_CLK_SRC] = &clk_smd_rpm_branch_bi_tcxo_a, [RPM_SMD_SNOC_CLK] = &clk_smd_rpm_bus_2_snoc_clk, - [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_clk, + [RPM_SMD_SNOC_A_CLK] = &clk_smd_rpm_bus_2_snoc_a_keep_alive_clk, [RPM_SMD_BIMC_CLK] = &clk_smd_rpm_bimc_clk, [RPM_SMD_BIMC_A_CLK] = &clk_smd_rpm_bimc_a_clk, [RPM_SMD_QDSS_CLK] = &clk_smd_rpm_branch_qdss_clk, @@ -1241,7 +1243,7 @@ static struct clk_smd_rpm *qcm2290_clks[] = { [RPM_SMD_RF_CLK3] = &clk_smd_rpm_38m4_rf_clk3, [RPM_SMD_RF_CLK3_A] = &clk_smd_rpm_38m4_rf_clk3_a, [RPM_SMD_CNOC_CLK] = &clk_smd_rpm_bus_1_cnoc_clk, - [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_clk, + [RPM_SMD_CNOC_A_CLK] = &clk_smd_rpm_bus_1_cnoc_a_keep_alive_clk, [RPM_SMD_IPA_CLK] = &clk_smd_rpm_ipa_clk, [RPM_SMD_IPA_A_CLK] = &clk_smd_rpm_ipa_a_clk, [RPM_SMD_QUP_CLK] = &clk_smd_rpm_qup_clk,