From patchwork Mon May 1 12:57:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89041 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2673496vqo; Mon, 1 May 2023 05:59:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6F7Ke4X9LNlkiPjOjWXkWg2cinv08KZnLY9n8ZcCCt+v8GhcfwhfgniFqK7C+D+R9QtGI5 X-Received: by 2002:a05:6a20:8f08:b0:ef:5f:3c15 with SMTP id b8-20020a056a208f0800b000ef005f3c15mr17736677pzk.47.1682945973539; Mon, 01 May 2023 05:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682945973; cv=none; d=google.com; s=arc-20160816; b=Ht3sBvpxz/9npAA17HrUjgiGWvlNAgDnS1iv0+6eSrRTCh83RoOC9yRpvHyty6CoEp qFhJ627M6qrVF1g0Qk7ft2BSm/u+77elDTOgLq+9VtgxEoQ2xvsC3jhlTjCIAgr4jHFN GJ+TYhJBkfF+zCilSWS45icQ712HvBFvkuCT0ODL2v11tvnhXoBbvX1vs0xZ+7anL+oi aZg0uloqdzmVG6KF9xyr4Ai8BaZkjCLAMY7iSXDFGU/Xtrs4s6QuCXDrpNhyIEGGlqcQ BhyOs4Civ62oeA+ZIk6vhTvN0Hk4o85wTgots12WSNUbRcfaeU/n/zaz3qh0Xanf64gE o/Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=uHlUeuh/pHwqLKIz8o/1xZKZmLDz+WudWNOBRqRlbus=; b=FGo/V6HZGSWrCrTXZ5ZID9FuvJ3zgAUdADxxNt4WDF+LJwtlaDKgfha0Mov1vD6dRG LXMIH5KLPTSslX7UrmaQSZmTrXe/jpNTiIfRMgFO8BwTcVTWN6rUqXJm8MY3QPb1ZCYH Zj2FA8+OGmrCkHeNCVFmz5DFdZT4gUFis04FYlR7G3AUAztFyBSNtrfwmhLXMmckMpo2 Bq5YcxUObfvzTjktWut6UCWFfuKvXdT2DzNq53ljkcR7ab5nxkANf50/AutWN93YoWWW FOVPPLHLYxp+/dqlgdWnUNb8eablJKtC+U2SgBi8uoUZiMqcB1Tr9vgBj0hdSuXCMFvT oOMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X7cxIG9t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t189-20020a6381c6000000b005288d3c34f7si12762366pgd.195.2023.05.01.05.59.17; Mon, 01 May 2023 05:59:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X7cxIG9t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232658AbjEAM5Y (ORCPT + 99 others); Mon, 1 May 2023 08:57:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232421AbjEAM5V (ORCPT ); Mon, 1 May 2023 08:57:21 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1783A10E4 for ; Mon, 1 May 2023 05:57:18 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2a8c51ba511so23067681fa.1 for ; Mon, 01 May 2023 05:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682945836; x=1685537836; 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=uHlUeuh/pHwqLKIz8o/1xZKZmLDz+WudWNOBRqRlbus=; b=X7cxIG9tiNOMWLsNhQ4cTuHzOz/dWFUxC6qoG4JfJZxnsewQ41oZV5FmwYZ4O+wn+r y1tTflf7wUkQTO9zVPeYfyv6PgmgIWQ7MsLGbd1h5nU0x9vuHlsY8qgnEJt2lsNbb1oO 0z9mcyk8fdA04pgS6IHoKbjnGLB01UVvsXpxOZwrlq6WX26rxpAzBRO1YmQr989nrXsf ZYOAR9EZPvkwI7IDmbgC6CJWxPzWo1tnc4WfCo7HGl1hZXNtjX1Ab99umUy7YS0skz3g cysZR6j38nuVepj28bCuJBHW34w6UJOZ53KDDRzegW1/Ixduk5U9EFlXfiArs2kFPgwt e7Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682945836; x=1685537836; 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=uHlUeuh/pHwqLKIz8o/1xZKZmLDz+WudWNOBRqRlbus=; b=PFfCT7skKZEKoYFdExCw4RS5E7BI606Zyl4E4ufrAi0/NoqomdBNSzwQLUJDfDFCwo asmttCDG3qEgC42lxFaPO+r6NxgJxa4yAwzdvNeP1za97QyH8Gjwt5g7ZDc5HBfU58OB liISz+kzy51l4ra2nsRVq65MEn9jLRzChcI5fE4266rarg49dBezhgTx7x761Iff6yI4 auP5LfE8/lacLbLCXnLKV4kMfF2b1g2xJt8q3nkTnbxDp+IB6PA369O9keur83iNSnKD i7u5z2X546RBYkP5JXFYNbA/Q6WuLUibBhZ0mSxTGfiGdXx/o4DnFMlUkZePOCd/Ealo 5rdw== X-Gm-Message-State: AC+VfDzwvdJRv3fqVC+7vVx4/oaylV4klsJr5JO1q82bcJ2NVLEe7QA5 Vjai+6OG4ZA6N4zIb0KdNkzFkw== X-Received: by 2002:a05:651c:238:b0:2a9:f584:659a with SMTP id z24-20020a05651c023800b002a9f584659amr4013592ljn.23.1682945836262; Mon, 01 May 2023 05:57:16 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id y6-20020a2e95c6000000b002a77ab1d73dsm58332ljh.96.2023.05.01.05.57.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 May 2023 05:57:15 -0700 (PDT) From: Konrad Dybcio Date: Mon, 01 May 2023 14:57:11 +0200 Subject: [PATCH 1/3] clk: qcom: smd-rpm_ Make __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX accept flags MIME-Version: 1.0 Message-Id: <20230501-topic-rpmcc_xo_a-v1-1-93f18e47b607@linaro.org> References: <20230501-topic-rpmcc_xo_a-v1-0-93f18e47b607@linaro.org> In-Reply-To: <20230501-topic-rpmcc_xo_a-v1-0-93f18e47b607@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1682945834; l=2532; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Mq5bwFOL9cmaK290SYW2KDaNzLEfPikSHhS+lIezcWY=; b=1ViYumVyzv2y3lEP6jFG3+C5sctZEwY4wUfcjBh34sBwMp5IELQ43UNPr2V4ZTceG/jgWt635//Z PoSGoGJEBMX5nQFpp/8sJyYSEvpUsSmgS48+iY31qzzBDL8vGWuX X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764696757261047625?= X-GMAIL-MSGID: =?utf-8?q?1764696757261047625?= 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_PREFIX macro accept clock flags for the active-only clock. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 887b945a6fb7..e559755a86e0 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -67,7 +67,7 @@ type, r_id, key) #define __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(_prefix, _name, _active,\ - type, r_id, r, key) \ + type, r_id, r, 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), \ @@ -102,12 +102,13 @@ .name = "xo_board", \ }, \ .num_parents = 1, \ + .flags = (ao_flags), \ }, \ } #define __DEFINE_CLK_SMD_RPM_BRANCH(_name, _active, type, r_id, r, key) \ __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(/* empty */, \ - _name, _active, type, r_id, r, key) + _name, _active, type, r_id, r, key, 0) #define DEFINE_CLK_SMD_RPM(_name, type, r_id) \ __DEFINE_CLK_SMD_RPM(_name##_clk, _name##_a_clk, \ @@ -126,12 +127,12 @@ #define DEFINE_CLK_SMD_RPM_BRANCH(_name, type, r_id, r) \ __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(branch_, \ _name##_clk, _name##_a_clk, \ - type, r_id, r, QCOM_RPM_SMD_KEY_ENABLE) + type, r_id, r, QCOM_RPM_SMD_KEY_ENABLE, 0) #define DEFINE_CLK_SMD_RPM_BRANCH_A(_name, type, r_id, r) \ __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(branch_, \ _name, _name##_a, type, \ - r_id, r, QCOM_RPM_SMD_KEY_ENABLE) + r_id, r, QCOM_RPM_SMD_KEY_ENABLE, 0) #define DEFINE_CLK_SMD_RPM_QDSS(_name, type, r_id) \ __DEFINE_CLK_SMD_RPM(_name##_clk, _name##_a_clk, \ @@ -146,7 +147,7 @@ __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX(_prefix, \ _name, _name##_a, \ QCOM_SMD_RPM_CLK_BUF_A, r_id, r, \ - QCOM_RPM_KEY_SOFTWARE_ENABLE) + QCOM_RPM_KEY_SOFTWARE_ENABLE, 0) #define DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(_name, r_id, r) \ DEFINE_CLK_SMD_RPM_XO_BUFFER(_name, r_id, r); \ From patchwork Mon May 1 12:57:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89043 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2677584vqo; Mon, 1 May 2023 06:04:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5QUFyQCAoRH93FGltJUu/DXqv3T0axVtBlhUOM9qotjhyyXPuQKPeqygU1QEhJiYnLTcNS X-Received: by 2002:a05:6a00:181e:b0:624:7c9a:c832 with SMTP id y30-20020a056a00181e00b006247c9ac832mr20266848pfa.8.1682946244060; Mon, 01 May 2023 06:04:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682946244; cv=none; d=google.com; s=arc-20160816; b=Y/9HDAaOY4vPiG1qVyGQuvUCPwDTT+0htsyq/5euzZSFT01mEmKpAN6RFbsnS2CF4w RxTeASPOiTSZIu523MtYuv0T7lNxdC5Cti2Lf73DfhrbpdOjuN1eTNCeXXRbfEvLKLdS m6gWLD2zRrRFTAlmlHzHHSG0K1P4tQOr7gRzDaXktnYvFjd3RFLT07tP/ShjzGa7HdH6 RF9NOcRWnRX3P4lDAf0DuGcBn5eW/PD1qq+kgN8LPlYN+5F9iJ1YJ1rVjjqn0bfzfusf BjBCWpuR2rULBvPa0VJlPF8a5bXaIw40L9VTKJAUFeMBZnCM9iSCVdTbqg3pTf81wdc+ FUCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=28S63ma6Nc4wW+jWaKui5HjUs7at3nzDPT9xYvZc0Iw=; b=nq8l7mRyDYHiZwPH+s1CEZehAEqXTJ2cIc4cP8yklZtddxUqiZIYROrNvssdXjhe4r JHZevdpdiPtT+4PSs89m1gKSlSwmdnf8iu/lfMCZ2h9sHsQQn1DXWJl53i9y48j7B4T9 86SHQN/aeib0dyYzNoeyXHllB5eGHr6u71TT8WrmxInB7Q/nxfbeHFLrfuWJzWprm6y9 TtcA7MXFyPFxpMAqaMrBqDdPDN37a16R8dL/1mrgu58BFKohLUQNG+FZBho5C+C37ox4 fnMUl2NLVJ1dQUlFV+Sz5OfXZZJpKtEDHHUXyE2SkqjP6suOMbmag4mcnRr1idgtYib5 j7AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iVhpir8k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e15-20020a056a0000cf00b00640fbfb639asi13503629pfj.360.2023.05.01.06.03.48; Mon, 01 May 2023 06:04:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iVhpir8k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232698AbjEAM5a (ORCPT + 99 others); Mon, 1 May 2023 08:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232679AbjEAM5W (ORCPT ); Mon, 1 May 2023 08:57:22 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F401A10F7 for ; Mon, 1 May 2023 05:57:18 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2a8b1b51dbdso23179791fa.0 for ; Mon, 01 May 2023 05:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682945837; x=1685537837; 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=28S63ma6Nc4wW+jWaKui5HjUs7at3nzDPT9xYvZc0Iw=; b=iVhpir8kH8Y7P8d4uXIJs00hmKzJ3IXqak4Dl/VXaTZjIvf1dTySSlkb661qv/AW3e kUjLNqugCcJASpaAsEEfcK1FzLT3CulsPYIxsYm/+JVZdVuR5HOr8sZrYhOAYkiC13PS uhVncwyjAabPbEJNqE+5razoCoZ/rXy9faRks8kqtnUkcKYg9ebMSiu2mY0b1aDkrB6+ XObQokZdSFrOvyx7R+ZQYwk7yrHra3Rs24IpLb563MaTP3cETFjeCgQIKTO6/RFyPRna mW5KZ9+Mk1NCllWTYjZTfCORN13TECBhEHaI/2ujazJ3xiwT06Lk/Xh0+yiabB4z5RVL 8rhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682945837; x=1685537837; 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=28S63ma6Nc4wW+jWaKui5HjUs7at3nzDPT9xYvZc0Iw=; b=N7SgluIzL3sL9LwjXZcGKTQnjq+y0WVLvRfIi3twxUg0ql65p3ALxcqBpElVr0cRYH ji9sJw84l7znA5Is/H6AeIirohkvLCFAOSnAwhLbAdX+VeRudCHQ+A8qoIeg4XnjLycj K4E3X3BjZT2gsbkdwFwm+hIkmHiej/VtlIv5Gne5QQByRPrLrthBOGdreYGwq3fp0/x6 96L4gTtawQMkXCoXgU/tq8XmLnFmRD9MNIq4KHy721HTeLmDIddjqx1ieyU1rdyQkqa7 t6qkjd1tYefyQDJKOwDPbmJxSVWW6kZnTCubz5jDncuQOjISFyREBgNIrT6Vgt24jVsF 6GHA== X-Gm-Message-State: AC+VfDyfEwJ2JTGSFvIoh2M6XqsH/X0tuP1/S3pyHvBfMd3XwPF9Ri26 gDlrGccyoQmK9dNLLx04hFFrXw== X-Received: by 2002:a2e:b61c:0:b0:29a:1f7d:38b1 with SMTP id r28-20020a2eb61c000000b0029a1f7d38b1mr3884374ljn.28.1682945837300; Mon, 01 May 2023 05:57:17 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id y6-20020a2e95c6000000b002a77ab1d73dsm58332ljh.96.2023.05.01.05.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 May 2023 05:57:17 -0700 (PDT) From: Konrad Dybcio Date: Mon, 01 May 2023 14:57:12 +0200 Subject: [PATCH 2/3] clk: qcom: smd-rpm: Make DEFINE_CLK_SMD_RPM_BRANCH_A accept flags MIME-Version: 1.0 Message-Id: <20230501-topic-rpmcc_xo_a-v1-2-93f18e47b607@linaro.org> References: <20230501-topic-rpmcc_xo_a-v1-0-93f18e47b607@linaro.org> In-Reply-To: <20230501-topic-rpmcc_xo_a-v1-0-93f18e47b607@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1682945834; l=1813; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=9Jacz1Yu9Sh2wayMooJRt9aLJtA6AgNtuaR8+zaLHzY=; b=HcEVnGLvfBMKeXtYOzYtd/gAfzaeZQQdZIAv2yNiEV19Q/mVPoKngIpZ5ftjRB2h9COLbjtXNAwp SInBx/g/CMzw5aRLCXI6/iye66GBxozDjEGzYM35Ay9Yt/wQmgpi X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764697040747146564?= X-GMAIL-MSGID: =?utf-8?q?1764697040747146564?= 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 e559755a86e0..e00889fddc7b 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, \ @@ -439,10 +439,10 @@ static const struct clk_ops clk_smd_rpm_branch_ops = { .recalc_rate = clk_smd_rpm_recalc_rate, }; -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 Mon May 1 12:57:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 89042 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2675458vqo; Mon, 1 May 2023 06:01:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ793Am66dFcNSIvpslSIMKj0PQzx52W14fy0KYkHrCIix7sUFDVIuEkrNzdMh3I/hvwTS6J X-Received: by 2002:a05:6a20:6a05:b0:ee:9272:73f8 with SMTP id p5-20020a056a206a0500b000ee927273f8mr16630047pzk.36.1682946103729; Mon, 01 May 2023 06:01:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682946103; cv=none; d=google.com; s=arc-20160816; b=PZiUeGAzTfc+9VjM8jMZJqw8YFXdNtpGn9EHvmWWgktXr7sb4qShppe7N9iLnrn53U ORT7RS+94zvhkJt2bZ6iCAmUQner4UGVD0qw4hv7i1Ww6AXL5/3Nmzd30Jp7uWRlCnkF 8Lmt4lU0YSCesc7jDN+W2VhH8+grcnh8YH4PxKyuqW2AntGHzSSAJcoT0H2OqK44EvXU vPL9kFTmwUQ2RjLgxbFl3gJWKRyNxeX1gzJ7EpyhMDuWsIugq8+pQA+yfKJq9oKTiSKt w1dcGj5SQvrmpPvHxJYynjOwnKhDukODtVOaZvnN7+bkyPlmM9yXDRfuWoGAP7pf2sw6 ZkdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=mVxPqZEZqxT/xble5HJfq8Vj9DqelOFd4DLS6YwEQRk=; b=Ctha9/DCxERWL8UAaR3o5uz4phJhNSLs7rDeblfcXBKmg8AauM/qKskIGNFe6N2+oj 4UyRFFH7T1jqorB6xSKDTfWrmQUhhzaQitm9gWF4Rh3+n2ECj8h8/ncI0NgjnAkJlX03 w+ksJe//8mVXUiqvFhotWr+udpu1GJhMPvWyRgZPrOdxIrJzmD+Z1Og4/CzpoHa9VXk5 nOLl8BrXu+GmvGd8C/4PGFO5nQYgRodiJOrDKdWFryalFgFQTjSuT0kr011rPTFCWpwo xh/QIANY3WslO+T1p2PztfkodfVKKxUP+zaVXO7sGhdNYblO4F1uv4lgqHP9u7sHklrU sVNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qAwu+pVr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t63-20020a638142000000b0052883b4cfd7si14324951pgd.177.2023.05.01.06.01.02; Mon, 01 May 2023 06:01:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qAwu+pVr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232692AbjEAM52 (ORCPT + 99 others); Mon, 1 May 2023 08:57:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232683AbjEAM5W (ORCPT ); Mon, 1 May 2023 08:57:22 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11B4A10F9 for ; Mon, 1 May 2023 05:57:20 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f0025f4686so3114900e87.3 for ; Mon, 01 May 2023 05:57:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682945838; x=1685537838; 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=mVxPqZEZqxT/xble5HJfq8Vj9DqelOFd4DLS6YwEQRk=; b=qAwu+pVrhIlLgf33SSBK3DoiYgjhCcfLThZcPo0eXws58slERBFYB7TmvXZLNqBbum GDigKGjE/m87a2yBWbzTcliEntbid58PWp03W7mC674y6S9p9Z3L/hu3evKT/Ig/m5xn E5D2jxk5IoBkNyuycWgmf4JRZsbM2xdRMsHoZQX3rLvWiodt1C2GyzWlFk0R/atiXXXX F/sFUOz50S+8FtYsCzpSekCdpzvHPHpE477hJvXJcSq2vtQcpGMs+2uY+ZVYfJzfnPTD fDsjqXf+lQ7/+v/5hs70g5iUxRyfh5a5I1BdZtlXIrvNSa1OFK/lViVvL91diGUGjfLJ 0Rrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682945838; x=1685537838; 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=mVxPqZEZqxT/xble5HJfq8Vj9DqelOFd4DLS6YwEQRk=; b=LeRyT0i8meVIb4MNT0o7etyP35bgZntwndz0ytjclOwN5Ev/wNttAiUEPDHM0TeuGY aysPA1mgpXTCi1lZMzcjZSjOYHbsT+Wa25u1lzXP5akM06jtBdqS62ptHl9A0sH+VsUj L6zlXz+6dWbVl1rLxHsuogk0t22C6v2UKctcn41Bs/tmtzbmuWlAL3RF2CtdP1H3KNOd k0jLnt93HXTJum8DMKLn3B8vblbR84mvZ8HozYlaXkbHbcef+i0H8zbILRYABSXf0KAB 3jtOgp6roXf7T8rVrPIFRJBM0ikpeZrsJsKjkvHOrChVygskGS8Q5JJV6timtbpzqLwj kMiA== X-Gm-Message-State: AC+VfDzQhzTeSbt1+Y+NRkbY2Di+QZO8wVBWpHvvQwz2dtnc+cVHh6L+ gxDH4ATc7Xl/vQuhz+7pMaj7dA== X-Received: by 2002:ac2:4c8c:0:b0:4ef:e6a1:6cc2 with SMTP id d12-20020ac24c8c000000b004efe6a16cc2mr4290688lfl.47.1682945838345; Mon, 01 May 2023 05:57:18 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id y6-20020a2e95c6000000b002a77ab1d73dsm58332ljh.96.2023.05.01.05.57.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 May 2023 05:57:18 -0700 (PDT) From: Konrad Dybcio Date: Mon, 01 May 2023 14:57:13 +0200 Subject: [PATCH 3/3] clk: qcom: smd-rpm: Make BI_TCXO_AO critical MIME-Version: 1.0 Message-Id: <20230501-topic-rpmcc_xo_a-v1-3-93f18e47b607@linaro.org> References: <20230501-topic-rpmcc_xo_a-v1-0-93f18e47b607@linaro.org> In-Reply-To: <20230501-topic-rpmcc_xo_a-v1-0-93f18e47b607@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1682945834; l=1210; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=l8l7+8uAcDF71yxaJqogJmWLjOCgIdZPw3YgQE8kOBk=; b=A0ur+z7Q0fpXelwJBH7Z48fWErgxHPy74GDXgwcZ1IjmPo+Fao6wDfDdxyTt0aiYs8jNGG0gQzEF dR2R0BvDBkQ+uhidoh10ufW1jQPXcK8hqKJBTAsxyhWNMRKlQsUS X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764696893250871541?= X-GMAIL-MSGID: =?utf-8?q?1764696893250871541?= We should never let go of the active-only XO vote, as otherwise the RPM may decide that there are no online users and it can be shut down, resulting in a total, uncontrolled system collapse. Guarantee this through adding the CLK_IS_CRITICAL flag. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index e00889fddc7b..9649f4644d71 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -439,7 +439,8 @@ static const struct clk_ops clk_smd_rpm_branch_ops = { .recalc_rate = clk_smd_rpm_recalc_rate, }; -DEFINE_CLK_SMD_RPM_BRANCH_A(bi_tcxo, QCOM_SMD_RPM_MISC_CLK, 0, 19200000, 0); +/* Disabling BI_TCXO_AO could gate the root clock source of the entire system. */ +DEFINE_CLK_SMD_RPM_BRANCH_A(bi_tcxo, QCOM_SMD_RPM_MISC_CLK, 0, 19200000, CLK_IS_CRITICAL); 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, 0);