From nobody Tue Feb 10 11:39:32 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 ABFBB2D47E1 for ; Tue, 2 Dec 2025 21:24:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764710694; cv=none; b=pZAuGKuJXKTWIY+8ZOm3MmKwJW/tAP47ya6uhuRdvH4ggAbhk0VkVyc5UABdmuRRZTnVUbqzWBJ/ESb6neq5503F5TikCzJb/+ZRgtPTZRRprRlZHEbB9S1KuI2oOALJq9jY+mgxCsLfMBMmyxIxIvl5oyqD57uQSt4M+5yxKdc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764710694; c=relaxed/simple; bh=35LQ9I2D8sgTqvco4KR2TdC+gW/u0iH3W9S2dWEAL+o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=cAmbS2mWlGfoxfPpqPWTHJO2XuRc8aueS7mbj28/eU1WPubfDaRDY9oMOaTuTRyfPLr7Fc4L975sCTLliXLb9De8/BpDc/DT3QFy5A33+bfoZm/d3BBDTvGjUF34DmZnsWwoRy7TN19YSX81Plcb4T0gnwcz1tyfYS15vZnqtEE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=RDKHOD+B; arc=none smtp.client-ip=209.85.128.43 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RDKHOD+B" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4775ae77516so58173535e9.1 for ; Tue, 02 Dec 2025 13:24:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764710689; x=1765315489; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=cuw6J5SFvtlnOBlEnvGjx5pMUfYrsLR4o0ttGHLkZCY=; b=RDKHOD+B/q1oVFvfnHtnTIrhr8FJwlSuw9AuT5M6fxmxG1wgGORUR16WLkqSg7v/kp UJLc0b+nVHLDVflBQYmtdisQUa659Nu6w7mLUa1VZJmWhWHn05oXT0QY0PmpYkWSyHwW FOJCVUPuEu8W6bJvmyU/lrWGknuH8pLwIW+WL5cRO6JoGPJeSPziTcuBP9ENnNIrMQbq Ohg4KBB9eRlq/5ONhfTsrlLW3pxWsV99nlDOoBJ6329sCV16qwmxxflRE2w7JNyiKeg+ vzK08Rm42KgxYxoSWnwSpZzMjvSfoTr/7flo0QiJGPUIdEuCA9WxJPEnBW/saKndvcBk 1jHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764710689; x=1765315489; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cuw6J5SFvtlnOBlEnvGjx5pMUfYrsLR4o0ttGHLkZCY=; b=bzx/BY2352/W09u9DFLbBdVGU5FMo5AQ4eVhyqe/FpalLRZPsLfR8hNW2AOuQReiE7 ba8R5lrYK6povPcRlUV2aeB5M5Nx1BEEG4vpml7OVvtYZ2+TqMLWeQGFqw2aGQjYwUIH 3DXkszhKHa8uVM09hv+LZ92OCAbUlE++8ETtQ+fM2KMAPqTZb5Y3/Jr3GSVgkuemeu6H tzIbe5OWX79zRhZttbezVRsV+X6xiNPg4YCh2kINxdGO1jJAZcx5xmrXkQkU1zCEtehn nIJ3p6U7bDJGkx9XsW+ORz2XwQIyoMRSpLh28QKM82XLPlqHkz/St8I7QZ31ip3wk78P e1dw== X-Forwarded-Encrypted: i=1; AJvYcCVDQnNPYEF7PzCvE/SpmK4MCICGc+7LqjzgVq3hudYJur9SP3ulUXmxo8icUerc9rpWwM2F6xulxMAg+wM=@vger.kernel.org X-Gm-Message-State: AOJu0Ywq2KlmjzdKFvH4YR+8dTOBE8ZWsP06ukdOvEHQh9FhE93qVwXd FufO3w0BletVITh/Gpnze04hQlaGQWRLYCnIuSTv2UKEnIrkmhuKEFljh8WMpgxGLVM= X-Gm-Gg: ASbGncta2jzACAXeQ4jUS6T9OlnHopBz9oJFSmZNH0eMdNhNviViw0sVDQzVIAziLrm bbwjqe8VXe5oHzB77tQfVJ/89i9exoXw0UwzdBO20eFUf6vhFZRs6b6NCcE3K6BAKDYV2mpEunp EPFyhExJ8JKWJA9pBC1pTUMGNVqiNFsSw9C7+nHKrpA4gADtW/6/Z+THxVldc5rxkzoiKgflCno xZ6uASbQJ7fbZHmBHsjf2sY5Y5eW9Is9BI+ShSqHm2vQH5ciqGK+7gKEkvxukGDlAl3kpbzKj1u lxLdEziDmQYnjLWia8xDSt8lJqMQoNx59AV22Wf+1ea8RsBNQ+OLH2aOgBTalYovM8Esg1zaKoi TFlttSUMdM9gKzGrYjy+YGmFRezgs1ZxCl/h7wG9bQPNOI+7pV8/Wp6mPlv13TmmyYtBQNKHrbI H9EpKSxlfu5CaQGazFuW8xxksXb7hAB++94cfO/czwU0KjMNs7YJZD4ZrB/9FPM2HDgRR8oJZKe k4p X-Google-Smtp-Source: AGHT+IFox10GcDFRLg9oRMiP6QSOJ7YJb9PofOs2XVYtMot3hu1dlt9E0/Av0VWVwD3/+gYyJFDBxQ== X-Received: by 2002:a05:600c:a45:b0:477:639d:bca2 with SMTP id 5b1f17b1804b1-4792aedfbe8mr916775e9.4.1764710688909; Tue, 02 Dec 2025 13:24:48 -0800 (PST) Received: from localhost (host109-150-127-3.range109-150.btcentralplus.com. [109.150.127.3]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42e1c5c30c4sm35551550f8f.9.2025.12.02.13.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Dec 2025 13:24:48 -0800 (PST) From: Christopher Obbard Date: Tue, 02 Dec 2025 21:24:38 +0000 Subject: [PATCH] Revert "clk: qcom: cpu-8996: simplify the cpu_clk_notifier_cb" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251202-wip-obbardc-qcom-msm8096-clk-cpu-fix-downclock-v1-1-90208427e6b1@linaro.org> X-B4-Tracking: v=1; b=H4sIABVZL2kC/x2NywrCMBBFf6XM2oGmmGr9FXGRTEYd2jxM0Aql/ +7g5sCBw70bNK7CDS7dBpU/0iQnFXPogJ4uPRglqMPQD9YocJWC2XtXA+GLcsTY4rmfRqRlRip vvMsXQ14TLZlm9Cc7muCO5CcLOloqa/A/vN72/Qe+vX3LgAAAAA== X-Change-ID: 20251202-wip-obbardc-qcom-msm8096-clk-cpu-fix-downclock-b7561da4cb95 To: Bjorn Andersson , Michael Turquette , Stephen Boyd , Konrad Dybcio , Dmitry Baryshkov Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Christopher Obbard , stable@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4267; i=christopher.obbard@linaro.org; h=from:subject:message-id; bh=35LQ9I2D8sgTqvco4KR2TdC+gW/u0iH3W9S2dWEAL+o=; b=owEBbQKS/ZANAwAKAWNNxPBocEb4AcsmYgBpL1kcfTLMmAOhVrAyqDxii+3UeG0407/uJH7P2 7xMZtxgdy+JAjMEAAEKAB0WIQTxi9yLbCX5CqI9UXRjTcTwaHBG+AUCaS9ZHAAKCRBjTcTwaHBG +AWQD/9C2P4UKOMmndE4+H8q98vqD7xxRMNegr8gBwOVrxbl+RwiReY9Mqhm3SugvR3uD+u2/eU rnKcvzKCvMkiwYd3EyQnfo8UJXEUWJnTlC5VtFv7Mfdi6TVJQ/1zn8BI7MbgqiZ4CMFUakoRF2x 7+w4D4BA6szUHnM8ApW++H80fkH4JmPPQsbnSaJiYnxxgM1JDSGesyd+aFic2LujeDYLudpKVMn pez9Ugy4R6QIYHnzHHAqIAp4pqKgRAwd3Zdn+uAjNJ7zZX3HFuux4e6TbIvdSmRUU05yIEyhPKE 6iUi7OoIL4b6s2z4Rse7O+MtXrG3290SzTXu1+p4vsD5zHTktOerozW2ShvOMnUDhhMgk+UYzaS AahqJO0yxeIm5PLatcV1lC6n6ZxN1M5QiVFdpzalZffgTW+w1lPF3JbK/15+yREZuW44wlYjwCb gQmaInYiIe6owU/N8pAvKbYcz7lUOB4yBlD9yh106RdzXL04dRzF3bIKXhF9ann/FZTyIFdqE3l pZp0snuVsg2Q+PnRWVvhYqYw/xZ7lSZPDijWAvEVM1U6WPR+MLBIQyMRZ1+AEgg5nSISZFUUlrk w3NmS5lOGc31mxFIWJt+25J3LzVbrL0ZsAB6Ribb7dKnMF8ntPIzH/tiX/VS050FIsZOm7UB3tR Ghtl/p4e3wBV7VQ== X-Developer-Key: i=christopher.obbard@linaro.org; a=openpgp; fpr=F18BDC8B6C25F90AA23D5174634DC4F0687046F8 This reverts commit b3b274bc9d3d7307308aeaf75f70731765ac999a. On the DragonBoard 820c (which uses APQ8096/MSM8996) this change causes the CPUs to downclock to roughly half speed under sustained load. The regression is visible both during boot and when running CPU stress workloads such as stress-ng: the CPUs initially ramp up to the expected frequency, then drop to a lower OPP even though the system is clearly CPU-bound. Bisecting points to this commit and reverting it restores the expected behaviour on the DragonBoard 820c - the CPUs track the cpufreq policy and run at full performance under load. The exact interaction with the ACD is not yet fully understood and we would like to keep ACD in use to avoid possible SoC reliability issues. Until we have a better fix that preserves ACD while avoiding this performance regression, revert the bisected patch to restore the previous behaviour. Fixes: b3b274bc9d3d ("clk: qcom: cpu-8996: simplify the cpu_clk_notifier_cb= ") Cc: stable@vger.kernel.org # v6.3+ Link: https://lore.kernel.org/linux-arm-msm/20230113120544.59320-8-dmitry.b= aryshkov@linaro.org/ Cc: Dmitry Baryshkov Signed-off-by: Christopher Obbard Reviewed-by: Dmitry Baryshkov --- Hi all, This series contains a single revert for a regression affecting the APQ8096/MSM8996 (DragonBoard 820c). The commit being reverted, b3b274bc9d3d ("clk: qcom: cpu-8996: simplify the= cpu_clk_notifier_cb"), introduces a significant performance issue where the CPUs downclock to ~50% of their expected frequency under sustained load. The problem is reproducible both at boot and when running CPU-bound workloads such as stress-ng. Bisecting the issue pointed directly to this commit and reverting it restores correct cpufreq behaviour. The root cause appears to be related to the interaction between the simplified notifier callback and ACD (Adaptive Clock Distribution). Since we would prefer to keep ACD enabled for SoC reliability reasons, a revert is the safest option until a proper fix is identified. Full details are included in the commit message. Feedback & suggestions welcome. Cheers! Christopher Obbard --- drivers/clk/qcom/clk-cpu-8996.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/drivers/clk/qcom/clk-cpu-8996.c b/drivers/clk/qcom/clk-cpu-899= 6.c index 21d13c0841ed..028476931747 100644 --- a/drivers/clk/qcom/clk-cpu-8996.c +++ b/drivers/clk/qcom/clk-cpu-8996.c @@ -547,35 +547,27 @@ static int cpu_clk_notifier_cb(struct notifier_block = *nb, unsigned long event, { struct clk_cpu_8996_pmux *cpuclk =3D to_clk_cpu_8996_pmux_nb(nb); struct clk_notifier_data *cnd =3D data; + int ret; =20 switch (event) { case PRE_RATE_CHANGE: + ret =3D clk_cpu_8996_pmux_set_parent(&cpuclk->clkr.hw, ALT_INDEX); qcom_cpu_clk_msm8996_acd_init(cpuclk->clkr.regmap); - - /* - * Avoid overvolting. clk_core_set_rate_nolock() walks from top - * to bottom, so it will change the rate of the PLL before - * chaging the parent of PMUX. This can result in pmux getting - * clocked twice the expected rate. - * - * Manually switch to PLL/2 here. - */ - if (cnd->new_rate < DIV_2_THRESHOLD && - cnd->old_rate > DIV_2_THRESHOLD) - clk_cpu_8996_pmux_set_parent(&cpuclk->clkr.hw, SMUX_INDEX); - break; - case ABORT_RATE_CHANGE: - /* Revert manual change */ - if (cnd->new_rate < DIV_2_THRESHOLD && - cnd->old_rate > DIV_2_THRESHOLD) - clk_cpu_8996_pmux_set_parent(&cpuclk->clkr.hw, ACD_INDEX); + case POST_RATE_CHANGE: + if (cnd->new_rate < DIV_2_THRESHOLD) + ret =3D clk_cpu_8996_pmux_set_parent(&cpuclk->clkr.hw, + SMUX_INDEX); + else + ret =3D clk_cpu_8996_pmux_set_parent(&cpuclk->clkr.hw, + ACD_INDEX); break; default: + ret =3D 0; break; } =20 - return NOTIFY_OK; + return notifier_from_errno(ret); }; =20 static int qcom_cpu_clk_msm8996_driver_probe(struct platform_device *pdev) --- base-commit: c17e270dfb342a782d69c4a7c4c32980455afd9c change-id: 20251202-wip-obbardc-qcom-msm8096-clk-cpu-fix-downclock-b7561da4= cb95 Best regards, --=20 Christopher Obbard