From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.118 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796354381; b=j6pduOTk2xuqpL9pWCNBpcasaQUyxxDN8Q4CClFbMvP8RswXFKRD6ADd6aCR1tHBDiN/ u/PGUGMRVbqRhh6Uwgq72LNmYPplnlmjFo/nJh2FhZtAmKbvKm3QUcFrYYLXxM8WqLb2e gb19ChWf9KCNLiEuX4WUKqphtiOi4Tj/GQa1m76XLmd1Sl2C/vmrHRHZLYwB8uP6NLlfR 9bopBJof/MGzugr105WSQR5hDkUUOEfVjt9Cz1dgvs58Ng5jdzMUM615hPaAJSg7bGkuW TFRR+wLG5IyjwR+g2Ku5ifkZklpiumCXIr5XWLPYmBwVWKR2dsL5jzkJL/+UTT8SKLQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796354381; h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:From:To:Cc: Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=6AuJngtMZBL/poWstyGxQx2xx9u5yH+lIppTnSNJy7U=; b=0yoFjy/lsrbXkZil8mTuIeNSBjocEeXinRp2cW+1pgyTzV9Jdj9mb2/NyvgkOHJeyP/A PEnaq5rXXd/kcbN21aeUqdgSv6cMns0crex+WA9Pr/zy3UkLBDybWmBAX1aPV+YBbFSqC wiZAqhVwQiDL8opDMJr6+6A9cEyAXZpI5uGG4k5ZTOPEdjBvLY81Eih5nZKCWQh8aNrV6 +W+U8QgRRvTWrNNrd2wx2fuxKmIyofl+D9mKGjNt1lbjt6mJVs/C8fh7YJlW9kDc1cd6N Oki/fAjXUdPqIvfODVYBFIUy75axvre4aQ9m/rncHAHSUyreDpdRPZkIOdNyJDiAIew== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=o9PIzhvC; arc=none smtp.remote-ip=115.124.30.118 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98A86606A330; Fri, 4 Dec 2026 03:19:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 98A86606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=o9PIzhvC DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1796354378; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=6AuJngtMZBL/poWstyGxQx2xx9u5yH+lIppTnSNJy7U=; b=o9PIzhvCBQTVdECuARnRK+un+tXn9TG/ErJw0lITs1jNeSJlmqm+0qk4vIX90c6NXFCBIko/4yiwlBUJW0S3xySymP8AKmq5WLX0CQGnyjv9jYt5rmOkOtTaYOGXf5y0vROfHh4fQMZKwGUUej8n+pkdFq+9ZgcPQ/tuhIWV5i8= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033071064103;MF=jiangtianfeng@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0XGFrZpa_1796354368; Received: from h68d07384.sqa.eu95.tbsite.net(mailfrom:jiangtianfeng@linux.alibaba.com fp:SMTPD_---0XGFrZpa_1796354368 cluster:ay36) by smtp.aliyun-inc.com; Fri, 04 Dec 2026 11:19:37 +0800 From: Jiangtian Feng To: rafael@kernel.org, viresh.kumar@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, zhongqiu.han@oss.qualcomm.com, christian.loehle@arm.com, ananthu.cv@oss.qualcomm.com, pierre.gondois@arm.com, zhangpengjie2@huawei.com, zhenglifeng1@huawei.com, zhanjie9@hisilicon.com, Jiangtian Feng Subject: [PATCH v7 0/2] cpufreq: Keep global boost enabled after partial enable Date: Fri, 4 Dec 2026 11:19:24 +0800 Message-ID: <20261204031926.278915-1-jiangtianfeng@linux.alibaba.com> X-Mailer: git-send-email 2.47.3 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series treats global boost as a persistent permission that userspace can configure even when no active policy currently supports boost. The first patch initializes ret to 0 so the no-active-capable-policy case records the requested setting and returns success. The active-policy loop is unchanged: active, boost-capable policies are still updated through policy_set_boost(), and real callback failures are preserved. This intentionally removes the no-policy -EOPNOTSUPP result introduced by 77cf053b041f, which userspace sees as an -EINVAL write failure. This also handles the CPPC default-enabled case: userspace can disable boost before a capable policy becomes available instead of having a failed write leave the global permission enabled. The second patch is the existing partial-enable change. If enabling at least one policy succeeds before a later failure, global boost remains enabled so that the valid mixed per-policy state remains locally repairable. Disable and no-success failure paths retain their previous behavior. The two patches are functionally independent. Patch 1 changes only the no-active-capable-policy case; patch 2 changes only a failed enable after at least one successful policy update. Changes in v7: - Keep patch 1 code unchanged and collect Christian's and Zhongqiu's Reviewed-by, Viresh's Acked-by and Pengjie's Reviewed-by. - Add Christian's Reviewed-by to patch 2. - Rename the patch 2 policy_success boolean to restore, as suggested by Viresh. Initialize restore to true and clear it only after a successful enable, preserving the v6 failure semantics. In particular, an enable with no successful policy update and every failed disable still restore the old global value. - No functional change from v6. Previous version: https://lore.kernel.org/all/20261201023001.1131130-1-jiangtianfeng@linux.alibaba.com/ Viresh's restore naming suggestion: https://lore.kernel.org/all/axFKMdliDVkbXG6b@vireshk-B250M-D3H/ Validation: - Executable boolean model covering 28 state/old-value/call-sequence combinations, including no active capable policy, all-success, zero-success failure, partial-success failure and same-value success; v6 and v7 results are identical. This is a state model, not kernel runtime testing. - ARM64 W=1 build of drivers/cpufreq/cpufreq.o with Buildroot GCC 13.3.0 and binutils 2.43.1. - Complete ARM64 Image build; size 43,010,560 bytes, SHA-256 070d6a30ab0343a584630737561a0439c8b2301735a0a881ac3a3f5049eabc5b. - Final v7 patches: checkpatch 0 errors and 0 warnings for both patches. Independent reviewer feedback: - Zhongqiu reported code reading and QEMU testing with a fake cpufreq driver that injects ->set_boost() failures, including the no-policy, partial-enable and online/offline behavior matrix: https://lore.kernel.org/all/c01a0ff4-abda-4aad-9e29-e04780188edc@oss.qualcomm.com/ - This is Zhongqiu's independently reported testing, not testing performed by this submission. No Tested-by tag has been inferred from it. NOT_RUN: - CPU hotplug, suspend/resume, driver unregister/global-write concurrency, lockdep and KCSAN testing. - CPPC, ACPI, AMD and ARM hardware frequency/QoS testing. - Local runtime fault injection for policy_set_boost() failures. - The existing policy-online callback-failure handling is unchanged and is not claimed to be fixed by this series. Qoder, an AI coding assistant, helped analyze the review history, design and draft the preparatory change, and review the state matrix and failure paths. The submitter reviewed the resulting changes and is responsible for the final validation and submission. Jiangtian Feng (2): cpufreq: Allow global boost updates without active capable policies cpufreq: Keep global boost enabled after partial enable drivers/cpufreq/cpufreq.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244 -- 2.47.3