From patchwork Wed Mar 8 21:35:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 66456 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp584752wrd; Wed, 8 Mar 2023 13:37:29 -0800 (PST) X-Google-Smtp-Source: AK7set/tS3H+Q5IARi19QNU5q988XU3+KRFBsJmZua8EBwIhbk7UcMZ4VwZtHpttlJwFeXesTNhr X-Received: by 2002:a17:902:cece:b0:196:63d0:a674 with SMTP id d14-20020a170902cece00b0019663d0a674mr23110831plg.9.1678311449657; Wed, 08 Mar 2023 13:37:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678311449; cv=none; d=google.com; s=arc-20160816; b=KFUXzR0B9a4qLVG5nXUJ/c0l1nAwTKBuGb0fOpxboIt3miK+iwAqWwWsFtlur0EiN/ WMGi6L5UZ0KpYSj4wr5LdrH5msnNajg/rJtdV9DZcwWyylZOVrBJimMBS78iVP979qi+ 2o6Tkj0hTLc7mMi072IxjW9/wUq2rOAryJG1pv5GG0WRRy9n52sQfmz+GkhOj6d7yGRu sxWoxlhux5YTlzM8DdAFVrtUO19Iii3BUbeP9b/PcRGMnQVQt23wqGqsJFqhSKtVPbFs qxajJqcAyNcul/zeXU/dgLbbCzSjqYL9j37jPxJVOxF5YXizlhQa/1sWgRIf7iyeMC++ yIOw== 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=WwZMH96UXfkc0AccFCgdHWqtpm71+Gjc4i/Nm8NSEJg=; b=ZGZCpBlm1AB0trgtdg6kBgIYVMDgEJnMqSyyCnvQcRIVPxoWPtLzLD7Cq12GnlKCub vnlUllVeeoqwAFrtTfGCkcieA468Cxww24Y3WTxgoffwGtCHb7t8zXpIBxKWHa7PM47m Fx77zZcqNWOjMt8+L6ubdy3/+dmVdsAUcFvSCCl+zYbKUxgczkZN2RxSQcpu3DDUwkVe EjWNvfER3UBKZLciIA8abTQg0A+u7pnmn8prdGu6zzjWivgeUkZPonRYzG1aIf5Yq3rJ 0DV2kKJDVWDtXcsWqI8SiLAtgSIkJ6n46s/CkrBTTmOw7VtlGNjH6HhYNW0T/zINc+Kb 7g2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hXBEuXzG; 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 c6-20020a170902c1c600b0019a5aa4d768si15369130plc.611.2023.03.08.13.37.13; Wed, 08 Mar 2023 13:37:29 -0800 (PST) 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=hXBEuXzG; 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 S230130AbjCHVgQ (ORCPT + 99 others); Wed, 8 Mar 2023 16:36:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbjCHVfz (ORCPT ); Wed, 8 Mar 2023 16:35:55 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DD38B856A for ; Wed, 8 Mar 2023 13:35:47 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id s20so23096163lfb.11 for ; Wed, 08 Mar 2023 13:35:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678311345; 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=WwZMH96UXfkc0AccFCgdHWqtpm71+Gjc4i/Nm8NSEJg=; b=hXBEuXzGMdj72xSPbg/KZ0ZJ0aETajx9yHPyiwgOFt0X1hTP8zQd5MS0i2U5vFEwfH pPPAGpWf1GoL2gATieKsJ/f6RnWuWoSB05oiMl2XdIjnLSw6NFqKdb/tFR83zRtjPZry ayu0Y7ftEnndA1gN+kBzO+r9ThFsGWL2XiC7ylY3GhYup3b1CPA3SQTZujAX2+mwZzoJ vHhxLYUqJ+5kfO2DLCFPXLATsD+E1ZWoIETRgQ4w29wc4j8U9VkgshFBgs6nXYKiE/+1 z++PKMsRMGHzzrYxFm0ZsYGBw1wElZt3rdh7FG7mb+zk7LYiOhFskqmSkbKpdzShS5gO Hs3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678311345; 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=WwZMH96UXfkc0AccFCgdHWqtpm71+Gjc4i/Nm8NSEJg=; b=zHH98M3U4Zf6ABdu5IexJeJVRF9ynp88nk7cmwSdygLvYwgEyBQqNSIyt0UOZGwnd5 dBCC6GknBl0hge/seCvn8r7kzqIdB+Bc0odOe0lyy7Ux3JDH8s0XaazKdXD2fCsK4VfY Ty5zWdEsX96ado4cWqNUghWoTDO4v1a1oFS/VkX1IlpZowmMa3Yg9IWBqpUAN/OgEz3t /GjcOpLI30dd1T4y+MM8mA3RE9guRuSeyXF1wjhc5/tpyFpsnGGMqjGU6UgAHldDvBB/ RXXloMLNpTIXyC/NhDBXYs1qZFIj9nlL0gJmlB2/ruko8VW8dHUk0jKvyGx9lcCWkNMG UqLQ== X-Gm-Message-State: AO0yUKXONstKuBNeU9RmVX09LrUMOocSBPdriY5A1c+VrGyvJS5bR5O9 R4/sdxEd6jlw3BcMSBPI94Gu1g== X-Received: by 2002:a19:f00f:0:b0:4c0:91d0:e7ab with SMTP id p15-20020a19f00f000000b004c091d0e7abmr4595915lfc.28.1678311345559; Wed, 08 Mar 2023 13:35:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 13:35:45 -0800 (PST) From: Konrad Dybcio Date: Wed, 08 Mar 2023 22:35:22 +0100 Subject: [PATCH RFT v2 06/14] clk: qcom: smd-rpm: Make BI_TCXO_AO critical MIME-Version: 1.0 Message-Id: <20230303-topic-rpmcc_sleep-v2-6-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=1209; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=TISC+Oc8V9fBm+Q+IBeIefGIjS6ebEWVyUTx7mIEAsw=; b=R+M8Tbyxgn5h+HC/KiEpepKUFCu2bNNp8TswNI/3zNht3TSAvrONTg5dU73dvGjmFn/8guhHpguL RBE7PiI7AhPCKKU6oJK30w2Zvsq0AjO1z03dGN3IB4jXAx9VGi8i X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_HTTP,RCVD_IN_SORBS_SOCKS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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?1759837106924819596?= X-GMAIL-MSGID: =?utf-8?q?1759837106924819596?= 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 Reviewed-by: Dmitry Baryshkov --- 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 fec6ae4a8989..9dc779360ada 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -450,7 +450,8 @@ 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, 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);