From patchwork Fri Jan 24 08:58:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 859948 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 4F83121A428 for ; Fri, 24 Jan 2025 08:58:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709119; cv=none; b=TeZspBaGX+Xn4EpYe6p1lrxVB1NhMECWcbQAM8jr0oPgHh24zY1F8ffFu9cryyoYC8GPi0A4FsYOBSaSU0Wh361Ta4t0vqjFYadRvT6KaZjs6Hl4kgvQSoIcWjvhfRSgWQjtkh/o8nO4seqeRhDjd4AxUmknWNjIL4Uobq8ubEk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709119; c=relaxed/simple; bh=Mh+lJKZyh+KkyabU155CrYHrGrHw881vMoEak+KHpyk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X4ArX6YjVwSyWgDiAC03c253xbYuS/XOcbFEek5MmpqvvXRGS8CVOVxkPvP1ae881GLujmQfPuKYuRp2Rrlf2xOQ3Otwuq3PD92EneZxv2b6r3Gae8DPyFoJxRo3TMQm3W1Pr/bvcSmpKFJke37JQUMYmLVpwinxDRrJoA3bggY= 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=Taddr+L4; arc=none smtp.client-ip=209.85.214.179 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="Taddr+L4" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2167141dfa1so34201035ad.1 for ; Fri, 24 Jan 2025 00:58:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709117; x=1738313917; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+cSIv9AP4YVY8II7Ap2oNu0OryQ4xRNmR3tG5lkJHKs=; b=Taddr+L4rf9IgMrgf8BrEXk1JhXP63t/YJmSl3FeOsHolFWpipkO4x9yybDmxp8Zsn LaLLRQb6k7GC+bLCWjA6f0ADN5SCjsHW/SPelSb4I9LLa3Rsi3WQeO09xoUqOYLqKINk 6TehgtiSaqsVkRywIqAKurO//gISjCemI4mPXCj0J/Xzwf2bPdQ/CxCTP2R02LsTm+PY KzBvK9Wi8dvV20H7hg3VD6aUltNJZwVb2Fw2bVG0xto/XD0S1Hlx+ODoJ8N6P7xyQ7Yu ZJsDuCcTQDVzPG9ESxYRPDrsmQR9+cLdENxmjiBSDklELLi/snkWPpEBeyV8gGBQwAHV fEPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709117; x=1738313917; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+cSIv9AP4YVY8II7Ap2oNu0OryQ4xRNmR3tG5lkJHKs=; b=SKH6Kn4mbOa8JbPU/bKMxmRrFSYqv01CEC9vfBSnflnOn0AE7tsKOLG9K8XTMsEOjP Phn24J636w2NO5+rPHTXDwj7LtNGGHwqfzrwkQIhPOu3maNwfM0r83yVcaUbraR79e0u OEL8CFWdOesai0T2OPwGyZ4KJqpzLwV1sqbOoxQU7MMnuV53B3VEepadsI6QsVxkwHuY 4OYaQGdG6QfDdO6CK8cdyeCTGFbSbmFbs84Mzuv4tsuWoQS0tmxb0uPpVkKJD+J3EtDP xY0Ab3IvFDUo3K+Hjo6d626v+exw5P0ZerlT1W9L2vc1oZ0+r165aqMVFCHcYyrD0OQQ IktA== X-Gm-Message-State: AOJu0YxJrYBKn1C7L350D+Yiu3t4dNlTPMdfBGWu1vW4hx3VpIHr1oOc GDyRk/IwGcmUAQsh/LXal1d6WkhHownZ+AH+Kd0ZLbtSBQT/PKMH5UxyW/DVWT8= X-Gm-Gg: ASbGncvzyyJp7KYn4mzobWk/M+oHvA0p4IItEP/gPPw/VTcJeq4dRE+pyzebtetxs8l 2R5Qq/cUm8SzPbNo1JXUi/0m9S4bs5s23ueK2Y/z5LUKFX7McZh5XlmQNU8auluc/1LlG10tpJo fzBntXpK88uPcKex1sGsqaVw2/tbQUqTM+ON+/SeGKFN2ptg2zGBtiOvJAPF3PiGP+fFF+4Shc/ lDCbftPZpT2xeJvqMC2BYmS2ElrNjxXW/+DyVgrxbzLoenMcmSrFVQolyAUDuwm2CfJ9GkKQ781 gbWcDF0= X-Google-Smtp-Source: AGHT+IFdQFEMk3CcgOdQGVEgE0iH+83SO6Gdqu0lR5PqUhFZ6mg4COOnw41rl14vZoxm0ZQ+NOESiA== X-Received: by 2002:a17:903:1206:b0:215:2d2c:dd0c with SMTP id d9443c01a7336-21da4a54381mr47881155ad.14.1737709117666; Fri, 24 Jan 2025 00:58:37 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21da414edb3sm11472525ad.202.2025.01.24.00.58.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:58:37 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Lifeng Zheng , linux-kernel@vger.kernel.org Subject: [PATCH 02/15] cpufreq: Export cpufreq_boost_set_sw() Date: Fri, 24 Jan 2025 14:28:06 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This will be used directly by cpufreq driver going forward, export it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 3 ++- include/linux/cpufreq.h | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 0782a6d89df2..8b0754b506fa 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2786,7 +2786,7 @@ EXPORT_SYMBOL_GPL(cpufreq_update_limits); /********************************************************************* * BOOST * *********************************************************************/ -static int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state) +int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state) { int ret; @@ -2805,6 +2805,7 @@ static int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state) return 0; } +EXPORT_SYMBOL_GPL(cpufreq_boost_set_sw); static int cpufreq_boost_trigger_state(int state) { diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 0e708830d30d..c7d1fe5ebf7a 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -781,6 +781,7 @@ ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); bool cpufreq_boost_enabled(void); int cpufreq_enable_boost_support(void); bool policy_has_boost_freq(struct cpufreq_policy *policy); +int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state); /* Find lowest freq at or above target in a table in ascending order */ static inline int cpufreq_table_find_index_al(struct cpufreq_policy *policy, @@ -1164,6 +1165,11 @@ static inline bool policy_has_boost_freq(struct cpufreq_policy *policy) return false; } +static inline int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state) +{ + return -EOPNOTSUPP; +} + static inline int cpufreq_table_set_inefficient(struct cpufreq_policy *policy, unsigned int frequency) From patchwork Fri Jan 24 08:58:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 859947 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 B141D21A45A for ; Fri, 24 Jan 2025 08:58:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709123; cv=none; b=Hv694M0yyt3r9U8OggLdl9MucQdIfc4YpQtx4XRIqZ7mml1EhtrrLWC/Dhog2BV5cMp7aNJwX4LdPN4vzPs/FpE3ehK2suJTEwt33JVvsuwW7zImyx4N0WZi2Fw0JFmejjkInb+JlrBTfQhDA/bKJYNNtZcF6JQ7y9vnAVZ93cE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709123; c=relaxed/simple; bh=znSW+w1v4+BqQtTVGnLiRgqkgsqi1gEv9fB8ofPO/uU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hxfSEUAoO5SbSORpSYrcTEwuWT0bfVGy5WWbaDElTh7e5V47Ga3EEOHWhRexT8ZnTTAw9jzWXJYBPHScMSi7ci1Ay71cz+p5FLYX9ZR7v6hwQJkus5+VQL06BXs8X/ScrVW6gbCWt48CHeoZTAVZFGSBR3WxsZ/xvuVmiAaVu2I= 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=QUvWnzG2; arc=none smtp.client-ip=209.85.214.173 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="QUvWnzG2" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-21c2f1b610dso40079455ad.0 for ; Fri, 24 Jan 2025 00:58:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709121; x=1738313921; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LvdbY4/AKo15uXXJkPA6XTvZrqE667hU3K6CfKEA8Zo=; b=QUvWnzG2uRk7llsHOmyqcxSpgNSLVNjh9lV6T3MJgOzcc5z512u/JtKBunB2lZL0av h15w8m736r2Bd6RAPw8IfF2Y482Z+bv87+21D/T5zk4Ef21DnizuThdOhM9qJaMLJH6i k8MMJUuDgcj7xn/GWmSdMIYrJtyYwRLDx7dNCeFPaXBxZZEXDPJ4jotGZLRjlZdUmWTl X8mTyqUB7wgMPeXnqVTWQcMJbuvbRrQlUvk/j/EWWllpQvvqJKf4FYOb4wyxqXVl4P91 NgnPVda/bxTFRBix06jWp3o7qDtdc1SXBvW4+NgtDZeccOID3hiA8t+LanmDqueUJppJ ZtSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709121; x=1738313921; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LvdbY4/AKo15uXXJkPA6XTvZrqE667hU3K6CfKEA8Zo=; b=ghfYTfK48AzqAGSFRNQ57EHx8++8oE6eecOXp8DFygr9ZCfTlC3RJ32Tw88liRotJv 3jxq96V32BT+jIuNySNLyqS6vTftEcfBgp6tV3capx8RiMICGFalKNOyrLf/tQuS2Fre /d2aAT2G+S8WeKg+vfqDzTDD51mNuI06BJR2COGfJRIiJJZ56tadNw+gvegI7whyAdGh KT0yHKprGJ07ku8TQBTNGVtW7R3se2cRQUTe7U6ym1N81pNxocZKPvcIfZVNXSY+Ui9q pSbps1UbRH5Q551/SJmXnqS0riXv7leCx5KFj+kCjzYgYUVaGcGZTUbHqN259nOV9JSX T22A== X-Gm-Message-State: AOJu0YxlgrZS8dahX12NmJKy5NyKer+sAQEiBEM6gaNaO7wd5DZvIjL1 sdtGWZeZNy1Ggl7fG4zxj+3Ltdt06wQi4MHA2RA/RRAsSy3Etw+oUo9ZgzXkOhQ= X-Gm-Gg: ASbGnct3rhAR/HyDi4jUjwfVSmGc90WfJW4R9eTtY/HgCefCmvk3zjRMaEt4zlLBEv1 d1/vyf/qsFkI27mVO+Vd6cwtLo8MXozmcwiPO78s5+w9ggDQ/uLoE+n3uRxPWy8SNm6pgoDtDCB dsbOzbbB1/C517LY2DlKvwhrK6Colw95f0jI9yUSU0kbNogL8hz+9mxNtH6UtryvflK1ISwA5Sp q+FMVaitKTaF/Xq6pmWGXt9WMPm1lc7MHn5YX/rath8CqKX7nPJt68lt4sV0W30fNFzZrydbu0D ym8rhDM= X-Google-Smtp-Source: AGHT+IHuCYPoMveSKfSnW64isYzqBc1It/cW98VCzyz0WynpxJ9l951hdasMB8SxE5p49YNv5MjiQA== X-Received: by 2002:a05:6a20:734e:b0:1e1:ac4f:d322 with SMTP id adf61e73a8af0-1eb214a0817mr46368460637.14.1737709121060; Fri, 24 Jan 2025 00:58:41 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72f8a69fb24sm1322219b3a.8.2025.01.24.00.58.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:58:40 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Lifeng Zheng , linux-kernel@vger.kernel.org Subject: [PATCH 03/15] cpufreq: Introduce policy->boost_supported flag Date: Fri, 24 Jan 2025 14:28:07 +0530 Message-Id: <97f0694fc5a3b408251ec5456b17bd8692938f02.1737707712.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 It is possible to have a scenario where not all cpufreq policies support boost frequencies. And letting sysfs (or other parts of the kernel) enable boost feature for that policy isn't correct. Add a new flag, boost_supported, which will be set to true by the cpufreq core only if the freq table contains valid boost frequencies. Some cpufreq drivers though don't have boost frequencies in the freq-table, they can set this flag from their ->init() callbacks. Once all the drivers are updated to set the flag correctly, we can check it before enabling boost feature for a policy. Signed-off-by: Viresh Kumar --- drivers/cpufreq/freq_table.c | 4 ++++ include/linux/cpufreq.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c index 16e56f2fcee4..185070052b41 100644 --- a/drivers/cpufreq/freq_table.c +++ b/drivers/cpufreq/freq_table.c @@ -359,6 +359,10 @@ int cpufreq_table_validate_and_sort(struct cpufreq_policy *policy) if (ret) return ret; + /* Driver's may have set this field already */ + if (policy_has_boost_freq(policy)) + policy->boost_supported = true; + return set_freq_table_sorted(policy); } diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index c7d1fe5ebf7a..b017af4398b9 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -144,6 +144,9 @@ struct cpufreq_policy { /* Per policy boost enabled flag. */ bool boost_enabled; + /* Per policy boost supported flag. */ + bool boost_supported; + /* Cached frequency lookup from cpufreq_driver_resolve_freq. */ unsigned int cached_target_freq; unsigned int cached_resolved_idx; From patchwork Fri Jan 24 08:58:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 859946 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (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 0202C21B199 for ; Fri, 24 Jan 2025 08:58:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709130; cv=none; b=jkq0VkT94rc7DENL544ieiWvnH3txagNc2VjAlN51VCmsPPx9Dwwn+hKPXUEVR9DZ8Ca/Ib/O6UkZaHuSekvd/B0jlUk+p5AUo9qczT2ADIgrP5jcJDg8HLjbMzhdwfWfmB5cIO3zlNUzzOXCqD1wVw1xoN5cAiKsz27eSG/oLI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709130; c=relaxed/simple; bh=6mXBnkUYkeuCFPL7Gkqa0yz5ytnNiILKmJ2qkF9krL0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=V6wwWAltLZfxJsFRReS0o/kvWWmapePfui0/kbla549aOZSV0OzrAemNMlAOyJJ/XlJ+j1ZqPzRj+5PaxhCPcdX1Nq9lzHtMTM3AsvU3Vzu63tlJbibwHXVrgVA7ehqdu86nt61j7T5+JLYFi9fddUXIjn+GZmZGKNivdKGYG+Q= 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=WdFB/YXQ; arc=none smtp.client-ip=209.85.216.50 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="WdFB/YXQ" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2ee46851b5eso2633432a91.1 for ; Fri, 24 Jan 2025 00:58:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709128; x=1738313928; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7+Dv/xS0EPUQsWWYtMVVK6x6Cs/IySXp4CbRL6B8jQM=; b=WdFB/YXQ0kkJTEmk2xUwV5E9L4kl/R1ym9xPVxXhfIcNdgC8smu6Xze/1frkY4N0JB rHl92JRpyT3BDpB3QCx5txTfjKJ/8A6t8+LpVYnYVeURVP2OCVcfkEYtI/bnN4mQ32PN DOyGJV+yw9y6+76hjeAbecsemYbh5E9udP8O5+F0JFcQIf8TL2yi0p4a9tQE7cnFJubw qIyOrDXoehmyH3dfrDxeoospZdbONZs03NNXtolTKfA8pmiNONINMSCQFEBMA+3dHUHV UFpqD19WRySx8INQNzdriYDtKlSzQRUDuGza0sUcEWQVU1kHDAoRaabG25nCbJlpqyZL bamw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709128; x=1738313928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7+Dv/xS0EPUQsWWYtMVVK6x6Cs/IySXp4CbRL6B8jQM=; b=X3OTSLE8iTNe/t5Pb1BK0o2RUbgAj3MdW7B7nLd2EHG3kcPTOtRZlXupFDzZbL/3By 2vocbrLM+M6CIdpOaDWtoyLVYbCMAPXr+SX2cdG1WQkG+5H3Ooy8kjctc4XcoROq3Pvr XuGUqLT1SLpI4p3kW7CAeoiT6+zxgm0cZl47tplOgm2NNJO1Oo6b4eQxgQ0mdkyjKvs3 LU9UKYkVvp+n4AFg1ZoAEKBQYS6oQgI0XojHhJ+M8oTcrgOkcXYyWbjH/LF22JSKOPj3 RUbR2YJXAllVZkrtB7QDlTLFB9JOpSkLhCsrC/5dHK0sNiEKdl6+NyisRX9ONJaRTzhj SiLQ== X-Gm-Message-State: AOJu0Yxsj+jFgw/1OTyBv6x3I9M1V7dOs/SvsDZMrlc0oNwc1PTO5Vy6 ZRrgnE8l4JaBSNKcKpckXRXQjpQM/4pN3SUzBYUnF+F9WhvqfHSzmYN8l1UxcRk= X-Gm-Gg: ASbGncsUg4iGUTH4cP9HP6WYvKeTKmDyWIsT4sy2MSLL88qdjcdqUwUKjH5LYU3i3gj gqBNPavLexBOhN1Jyco67xkNtbe6wHPSEMEdcl4gReIsPTfZbk/Y5EnkeeQQZAvLnbpbU5qDDuH G6q/BEnuP4msJ3aTDcri6XsIJkHuTzlKGkW3EfwdTt1vYxMN9itnoE+/VIfSoX0wSkPUI3BO+FT ZKuQ1uD5QW/DewVr7Kxy3VSiZVxuwYw2NlDv+BPUO3muUKN1e9AaO2ccHqVWY93ENc6EMvOmWJh qcpINHA= X-Google-Smtp-Source: AGHT+IFgVqVjXeoB+9lH1lr6zg3WDC0Dl91MBuKayllLk60pxLtupa56Fvtz004QWNAnoT5ZmnXGvA== X-Received: by 2002:a17:90b:3cd0:b0:2ea:4578:46d8 with SMTP id 98e67ed59e1d1-2f782c77989mr43705871a91.9.1737709128279; Fri, 24 Jan 2025 00:58:48 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f7e3672e1bsm1454047a91.0.2025.01.24.00.58.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:58:47 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Huang Rui , "Gautham R. Shenoy" , Mario Limonciello , Perry Yuan , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Lifeng Zheng , linux-kernel@vger.kernel.org Subject: [PATCH 05/15] cpufreq: amd: Set policy->boost_supported Date: Fri, 24 Jan 2025 14:28:09 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 With a later commit, the cpufreq core will call the ->set_boost() callback only if the policy supports boost frequency. The boost_supported flag is set by the cpufreq core if policy->freq_table is set and one or more boost frequencies are present. For other drivers, the flag must be set explicitly. The policy->boost_enabled flag is set by the cpufreq core once the policy is initialized, don't set it anymore. Signed-off-by: Viresh Kumar --- drivers/cpufreq/amd-pstate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index d7630bab2516..8d3cc494c92c 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -995,7 +995,7 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.min_freq = min_freq; policy->cpuinfo.max_freq = max_freq; - policy->boost_enabled = READ_ONCE(cpudata->boost_supported); + policy->boost_supported = READ_ONCE(cpudata->boost_supported); /* It will be updated by governor */ policy->cur = policy->cpuinfo.min_freq; @@ -1480,7 +1480,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) policy->min = policy->cpuinfo.min_freq; policy->max = policy->cpuinfo.max_freq; - policy->boost_enabled = READ_ONCE(cpudata->boost_supported); + policy->boost_supported = READ_ONCE(cpudata->boost_supported); /* * Set the policy to provide a valid fallback value in case From patchwork Fri Jan 24 08:58:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 859945 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 B553621B910 for ; Fri, 24 Jan 2025 08:58:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709137; cv=none; b=RfxZAIjKF7p0T1LFfC2hfjrAiQJUjqaNywz4BipVWCuEqB1f4M7Dt5mPhVzyxmdoWuziwY1c8lBd08Fi57iXjy7ZiY9dFmbNOcy8A03fxzylmve0QAX9bkFvMZ6GUalZK17QPS39BiouZezSA0Jn0YYZR8ZYDi+Tuko6cvZLNn8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709137; c=relaxed/simple; bh=uYhHZdbr64hdPoU54/0DIov0rDAVvGEb3ytqetE8eIY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Gihb7ub54vEPrlKOWtnug3n6hWDqolBxc8JuVXjz42KNdpjm0ekeuFAnClxJFzKlWUjKu3SC8icV33oU3Ct27oZmMhEGtFQgXr+Ixfsyd5wNVwXt7PcD6UusjARuTgIayc3VC0TOPsnZWmVqx744prRzr2/9oBjcxaP13Xp9Wd0= 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=QI0CqMVg; arc=none smtp.client-ip=209.85.214.173 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="QI0CqMVg" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-219f8263ae0so34664965ad.0 for ; Fri, 24 Jan 2025 00:58:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709135; x=1738313935; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LiL8oqpXAlFH/FMIkjYWkKmW/Cs3uhy3DDlxYi5jlOQ=; b=QI0CqMVgN997O906MbJNE0QRP5Kqzm/W6B7Efh0S5nDmMgkj06VhMMs16v9mg6ghUU aEwBtL14/nqcJGLZznti+WCc9HOw58ohJhmXSqZMCAoNVNATmzLsAQnt2fZ0ot3ohMt0 BQHG3fZLRufUXeqxYS5F52/X70WsghJ/JJqY9jOL2MLn2+3zqrPNyDfP8ct3dQbIEljZ H9lR+k9bIc1Xip+xYcOzCedO8EhX6yapLKsPKyO6rP4TEoBiFG+ppMxTH4H0aMWjIxkG M0Hx0Vkm662Yc7UuBne/QtORyfvHYwkLda9VBpN1ttI1RlPsrFORjBtRYGETEimkoUJO giXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709135; x=1738313935; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LiL8oqpXAlFH/FMIkjYWkKmW/Cs3uhy3DDlxYi5jlOQ=; b=NI+laka/1s4BPklTLJsTbV80syZw9N+53+9mQZfNksKN6QhHzk7KWAyDoIs20rSUw+ bT2vz0qGVe1DhU8LJpFyobahHPcmmIKmFFkT+BrDIr9YCXeUq2L5cLAKdv5BINTPUE8X h0mIm9pBmp/oq4QchV9smGYuQeacoKjqep+eysWrWZUqi/w+XvkwvYnHKOwnHiDvwjvY fzO/KDxJn6UGo+UjmPyEaE7Cm1sqNA10UNNEfcizV8G/Ki4mGdOFxFvuqtz2W8IEOgAx jZ5QQav9A14uF2dLO0MMQzpSiFDO8ZTUZbgwJxCFH/6FogaSymdAVltUG6eTXXFdQxgg ZZLg== X-Gm-Message-State: AOJu0Yy5CkkrjOg7w4apsUgXfrn39Nd3vS6IIojAQIqZaXLpX1BAiQI/ +xJwBW2hfbmhdtrQkw3UsJuL6zhMYLK0fdGC4PKDMbyRtjGy7mhMw1iO3Cfh7sk= X-Gm-Gg: ASbGncvKzgaYrghs5/YgJ279zNzXBJwu+35aWSHPXaPFBEEgDmPiWBHyPl7CdR50swB EZOLD/3YFxJ4Zkh6G+UCb9DjdCcxIW78NqfuBJq2mM22qO5O49KHjP8KdG96E57ebRky2AFgNOR sXtwxWkxOUtKk5mwPEOALmu8dHTorH03Kg3iry2KihiRCPrs2/vSI83m4Sr76XqvxmMAvo6YUYu nbgz95IHlZwk56PyvnMK0TXZRPWQJ0bQfL8PMLveRU5cxmoi3YbmOOd4MHQYY7TqCjqEMdr+4w/ /znQqZ0= X-Google-Smtp-Source: AGHT+IEsz2Y0I/86SGoar4cxilqh6u/4N68lmrkUwz97Jaxsbzl2m+7O6b5bkF3tOeNVC5P95iG6dA== X-Received: by 2002:a17:902:d2c8:b0:216:5e6e:68ae with SMTP id d9443c01a7336-21c3558c76bmr447252415ad.31.1737709134962; Fri, 24 Jan 2025 00:58:54 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21da4141302sm11568035ad.154.2025.01.24.00.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:58:54 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Lifeng Zheng , linux-kernel@vger.kernel.org Subject: [PATCH 07/15] cpufreq: Restrict enabling boost on policies with no boost frequencies Date: Fri, 24 Jan 2025 14:28:11 +0530 Message-Id: <7121e83e58bfd004d6e0d94e11e3e810b669eb51.1737707712.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 It is possible to have a scenario where not all cpufreq policies support boost frequencies. And letting sysfs (or other parts of the kernel) enable boost feature for that policy isn't correct. Now that all drivers (that required a change) are updated to set the policy->boost_supported properly, check this flag before enabling boost feature for a policy. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 8b0754b506fa..1e6ab42b405f 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -631,6 +631,9 @@ static ssize_t store_local_boost(struct cpufreq_policy *policy, if (!cpufreq_driver->boost_enabled) return -EINVAL; + if (!policy->boost_supported) + return -EINVAL; + if (policy->boost_enabled == enable) return count; @@ -1586,7 +1589,8 @@ static int cpufreq_online(unsigned int cpu) policy->cdev = of_cpufreq_cooling_register(policy); /* Let the per-policy boost flag mirror the cpufreq_driver boost during init */ - if (policy->boost_enabled != cpufreq_boost_enabled()) { + if (policy->boost_supported && + policy->boost_enabled != cpufreq_boost_enabled()) { policy->boost_enabled = cpufreq_boost_enabled(); ret = cpufreq_driver->set_boost(policy, policy->boost_enabled); if (ret) { @@ -2822,6 +2826,9 @@ static int cpufreq_boost_trigger_state(int state) cpus_read_lock(); for_each_active_policy(policy) { + if (!policy->boost_supported) + continue; + policy->boost_enabled = state; ret = cpufreq_driver->set_boost(policy, state); if (ret) { From patchwork Fri Jan 24 08:58:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 859944 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (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 A874B21A446 for ; Fri, 24 Jan 2025 08:59:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709145; cv=none; b=VtFGeaBeg5oZ7ue5NwqLZJta1qQaknuEpNl/fk/aaSfEmC2ousP/LCSDIrtgr8WSspgoM4hfagPfaEgqGHtlgCAKUq+tAr+q8v/W5HTxn1pVNqY8ShLWWTUZaO3XGaafyS5PHMAgmSMR8b5dfjBKhpxbzOJ4nM2Tw2EoLSf9vZU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709145; c=relaxed/simple; bh=DNyXYLNqnDGTpYMMmN2+u7aiSbjZBEJB+HjmmWjpP64=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=er4EIrdpxXgk0J0GwmkQl9uOWMUc/XhQx8KHSk6oiYxQmo9b2wVzke0wmW2Eu1Ikn+jhAYKk5kjQ44+uxNF3moVFKHEc+ew+baNQaQwjT1mEHoCicu1zIGEa0MMfmL9E7hdbTYcNU0Wk1cOQBkmHZ9/7mN0Xj6QfUSTF74SFXk0= 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=xGlxnFQS; arc=none smtp.client-ip=209.85.216.45 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="xGlxnFQS" Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2f78a4ca5deso2608576a91.0 for ; Fri, 24 Jan 2025 00:59:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709143; x=1738313943; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vlxTGa2NoXf0U2Bhx3PIAC2y2IpE66IWBZ2zi6Nlb6w=; b=xGlxnFQSsZpVy8xWaWD/2p0Yd4KDfVu8md/hwNpnNhWxOfe9kSAzuv0WoSn9zJKmYZ 5e+UNGoobEyaBdsYxLyA9Ser3Hd+4leenDs9hCG/tHHnLkDYsx2qUNmVxIxESnBGW2Ya /LyCpSAc3vzMEFtIeEHlhxGwBtg9KXAiLUeDn8Tymm260CYQ8IPUREQk+r7GgOjJVQm9 1p7B7xF9a+InhlACE8n0mP1plVb4K67hQej9h45TKctWPJXF+P6WIBeuFrlmFvn0sUnU X2pLJKrb+Qa0XUoynEq+WTZdy+FZvOHoRdWs1g//mZ8nDzgUOIrAfG+2iHAmDHzrIoOz TL2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709143; x=1738313943; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vlxTGa2NoXf0U2Bhx3PIAC2y2IpE66IWBZ2zi6Nlb6w=; b=YWBblpVyZedajGNpNQ3vVOAMwSDcgg0INmX7A/t6OjtkuYhW8aKL/qCwEcdWByxVy0 oo3vJCNp6jvWWv2g0ADuhvB9EmvvPpH0ueHpHPmrzN4epqZoOQBVSn3E6Ke8ayIf93Cp uTFP72TgetSkl/oFQSn2U2LLNk64qg7aPrv+UNYCeF6KU1CR58kj/fNgYmFK8ZcieNqB Yn/ujeRX6Li4cMc0q5HgzCTOVun4Z7hdHwVtHae+AXG1JIIzP9jhhEcFlkynxnfsvufA /d2NgovLuDbky2e8QY6KBwYGJY+TdOq3cl+eL3oCtXI7dHBSi9s51e9Ko9+fcPkiM64A dU7A== X-Gm-Message-State: AOJu0Yyg0DE5ZcXeeh0cx7JBL1Y1JFG5x+Phnr9qJf9jY7kFHYe4uxlM ccZh9K03La5xIuBLbXkFVSNZ2fqci/8QQHxpg7s9LIRYwo/KODcu7WEB7lQrXrM= X-Gm-Gg: ASbGncvfNQDN8Boqa7/1F/47iggqhAWohMdF7IiAYLqWr4RGnHCXDOZBifcebg9FwUz BRTgT2bxOM33jieUnfsbOv5Zld024J0A07Ydcat+jqz3FXkWDj8uBcdVQAmxojaPktpG3/Fl+Kq Nf+bVw1g1bG6ldu7Fbbd2W/lbFj4ESOX9yFOL6fCZppADCFxZkB7y3+l4DHd1rtuo/S0IP4pNHZ AAEqBhYHp0oZfI1wz35vsStMryi4H7OYoTNi7XIeOAJiUPupDaRnBqj7Ykqn+CbSRzbHAouhcvI 2RcYRs4= X-Google-Smtp-Source: AGHT+IEIQFAd+nDcE1KZztHOLcwIZcsISxikWrtqikmaVDwNIDlSGV8IHx2h7CCPFEPGAtyydYzt+A== X-Received: by 2002:a05:6a00:4c0a:b0:725:e015:9082 with SMTP id d2e1a72fcca58-72daf92bee2mr36684993b3a.5.1737709141450; Fri, 24 Jan 2025 00:59:01 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72f8a78e3cesm1322652b3a.168.2025.01.24.00.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:59:00 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Huacai Chen , WANG Xuerui , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Lifeng Zheng , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 09/15] cpufreq: loongson: Set .set_boost directly Date: Fri, 24 Jan 2025 14:28:13 +0530 Message-Id: <0cef4a792391f50463fb1e72a96645e34eafbc89.1737707712.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The boost feature can be controlled at two levels currently, driver level (applies to all policies) and per-policy. Currently the driver enables driver level boost support from the per-policy ->init() callback, which isn't really efficient as that gets called for each policy and then there is online/offline path too where this gets done unnecessarily. Instead set the .set_boost field directly and always enable the boost support. If a policy doesn't support boost feature, the core will not enable it for that policy. Keep the initial state of driver level boost to disabled and let the user enable it if required as ideally the boost frequencies must be used only when really required. Signed-off-by: Viresh Kumar --- drivers/cpufreq/loongson3_cpufreq.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/cpufreq/loongson3_cpufreq.c b/drivers/cpufreq/loongson3_cpufreq.c index ea516b939c44..1e8715ea1b77 100644 --- a/drivers/cpufreq/loongson3_cpufreq.c +++ b/drivers/cpufreq/loongson3_cpufreq.c @@ -299,15 +299,6 @@ static int loongson3_cpufreq_cpu_init(struct cpufreq_policy *policy) per_cpu(freq_data, i) = per_cpu(freq_data, cpu); } - if (policy_has_boost_freq(policy)) { - ret = cpufreq_enable_boost_support(); - if (ret < 0) { - pr_warn("cpufreq: Failed to enable boost: %d\n", ret); - return ret; - } - loongson3_cpufreq_driver.boost_enabled = true; - } - return 0; } @@ -338,6 +329,7 @@ static struct cpufreq_driver loongson3_cpufreq_driver = { .get = loongson3_cpufreq_get, .target_index = loongson3_cpufreq_target, .verify = cpufreq_generic_frequency_table_verify, + .set_boost = cpufreq_boost_set_sw, .suspend = cpufreq_generic_suspend, }; From patchwork Fri Jan 24 08:58:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 859943 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 B992121C9FB for ; Fri, 24 Jan 2025 08:59:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709150; cv=none; b=DcHnlrxDYSARNsLvW2eaK8arvYsC1Km2IBPuEi8n4h68n0qny4BHSp4FIOHidXUdRRirjG2xFJoHfpImzqnn1xqnUCkQEOgRK07ddpoKqienYYq+8BmynkgKFINX3WiJn73tfii/LptyhOifa9VZUz2KRoX0Y0B4sTFjs/BGlxw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709150; c=relaxed/simple; bh=NLORqzd35DVESYWY8n/o0RhRe7T7py6pVm8BHGxPOaQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iFMHNrYPFtn+s1j9r+T1cyfx82NlijR6BjLZ2zdpSX5ca13tUFxV2F5cNkZgoJDSCz16VxmxXtYR7G6VwnorLOcFFVfGlvRX5rSJLuTqKZeWGO2n2NyCrB4e6qOg4TuutBW2s68eOqnR3hFJWqSskoYUvXrOSwHobQjvD1zh/4U= 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=HsnfOOv4; arc=none smtp.client-ip=209.85.214.176 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="HsnfOOv4" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2164b1f05caso31546625ad.3 for ; Fri, 24 Jan 2025 00:59:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709148; x=1738313948; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5lzQ5jAgJPMOysDkyB7FBY4kIjh3CZ6BVNPDK8eFRq4=; b=HsnfOOv4K+rr0NVVkwoAWRR1eXorhoyLyeZFbl13o0LyDn2C1qMJM0oMMsA2JbJqRQ G5BcslORGTCDOSBZ/mDZsfPzfnQm0KSaJeUKJNr43/UP1VxApYj+cahQrmP/O33OaqZi M0l/5507yLQj8z/twAr0at7J9HU4d/vmMepvG8BUO5VHfEVx+1u5bIZf9tfuDc+jS9pj yZIbwN67Kat93Q4CQUvPFUMWnsaJ9qYyxCzmNQ5+t4U67JQRjCbQxNllojJDpUr0AbFY URqeWyPUV3Rslf3Edfr/b3uuq+fykH0CvpbvE+f2rZy3pk4wYoCd3ifBVwb2FhUI2G2J 0HzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709148; x=1738313948; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5lzQ5jAgJPMOysDkyB7FBY4kIjh3CZ6BVNPDK8eFRq4=; b=w2ZXbWUtII9n5GFWUbctqV57fpu7i4RxQvYW0w04A5nicYZKiUCoqms4RTx3o9g4MJ 7fAz3V1IduXwq2CqzBb4yI9qm5mBjP60qjEhMXpBvfFQW+j+qXLtKP8Yx0M339cDUqPB l7vBrpZDYw6iFvfaukU8Bzqs79d9VQ20OzNysxPJktFfv/TteNfvLrh2dK+zpYtP/YTQ IFcrK1sP4Lbe7JCHK8RMxi8JlUniOgRmO5UxBvtar1G37rAGGqw928ICa+wFRuKTRGAG T6ofAhgM/XtrRglxvvLB3NucxSwX8Y1mYu9Jajf6QC6+cfsW3Z+ZlaoljGsw4kPOwBPR nstQ== X-Gm-Message-State: AOJu0Ywh0/wxNobGiRRL/SGpqFf/zFJxIAs8n+5tqM2nz4yMDWe3oCDw EEnMxonpayhNWCOrTZwHfQQ1fxskr8OuHCdUfaYtINxlVVOaxn1MUxp3wPNcDFA= X-Gm-Gg: ASbGncsjkae1w82UBlSlZkpJJdEzuKI0t1blDXlI0SGUbBKpZOGy6tX7Bpq+Mrk4At1 PKlOI86OrqPaXCOua47tiJ/3oZhEMDVhDfiAGgY7jxlH0S+Ty23Dv14y0dPRrQGdv9qDAKHjA+L lLfjPem14mL+e7k4ARlz63wyS4HYnHgIFw0FFOZsBWqQ+Jk/23RVDn7rJR6RmG50UqTAvTM8JGJ 6SE/GhLnpr9nIlLoCYUNNZb0Z/olacufEBytw+c4a9qzn+dtyRwjrZ0jYPVjEqR4j1nLiLsf1cu 0ZSk8NM= X-Google-Smtp-Source: AGHT+IFW/BLYxcm27YoFLdxNsrAZiy/t9OXPfZRg22Xfepty1UtE6fjh27SK8kn9i9L/O6GYWvG4GQ== X-Received: by 2002:a17:902:cf0b:b0:216:2af7:a2a3 with SMTP id d9443c01a7336-21c3560726cmr494020895ad.53.1737709147994; Fri, 24 Jan 2025 00:59:07 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21da3d9c55dsm11824845ad.10.2025.01.24.00.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:59:07 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Sudeep Holla , Cristian Marussi , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Lifeng Zheng , arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/15] cpufreq: scmi: Set .set_boost directly Date: Fri, 24 Jan 2025 14:28:15 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The boost feature can be controlled at two levels currently, driver level (applies to all policies) and per-policy. Currently the driver enables driver level boost support from the per-policy ->init() callback, which isn't really efficient as that gets called for each policy and then there is online/offline path too where this gets done unnecessarily. Instead set the .set_boost field directly and always enable the boost support. If a policy doesn't support boost feature, the core will not enable it for that policy. Keep the initial state of driver level boost to disabled and let the user enable it if required as ideally the boost frequencies must be used only when really required. Signed-off-by: Viresh Kumar --- drivers/cpufreq/scmi-cpufreq.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index 4a3ee59cb771..ff2897789797 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -297,16 +297,6 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy) policy->transition_delay_us = scmi_get_rate_limit(domain, policy->fast_switch_possible); - if (policy_has_boost_freq(policy)) { - ret = cpufreq_enable_boost_support(); - if (ret) { - dev_warn(cpu_dev, "failed to enable boost: %d\n", ret); - goto out_free_table; - } else { - scmi_cpufreq_driver.boost_enabled = true; - } - } - ret = freq_qos_add_request(&policy->constraints, &priv->limits_freq_req, FREQ_QOS_MAX, FREQ_QOS_MAX_DEFAULT_VALUE); if (ret < 0) { @@ -394,6 +384,7 @@ static struct cpufreq_driver scmi_cpufreq_driver = { .init = scmi_cpufreq_init, .exit = scmi_cpufreq_exit, .register_em = scmi_cpufreq_register_em, + .set_boost = cpufreq_boost_set_sw, }; static int scmi_cpufreq_probe(struct scmi_device *sdev) From patchwork Fri Jan 24 08:58:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 859942 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (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 2EC0121CFFD for ; Fri, 24 Jan 2025 08:59:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709157; cv=none; b=pn6KILGMRrcfsI/kVc9XWLlyQbiRkogA5O4GVRTCZjASnDO5N9vUfVCKNbjiKGHmdKv9G9Z9OSe8sQccwAemYcndm9PSbliJKTb9sIUCl6vUyg+ycZyGxFLORRMnOHt/5bKsDt4wCo8jdLHa/qeAf0/2C8aq3KHKmxleIrcf0aY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709157; c=relaxed/simple; bh=Gx5tAkuM3tQafFNc5Mhe6PmrPMAavPP6iPSppEjU5/8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ryxmErbkjbMb8rF1PD/wKREXUoFyxCn3LuM7NOMNMEr+AsO1CzFeUoSPzDEi1kVq3gfTYFINc+CbPlnc/xpgG/GZTk4Ylkr9eMMwuXmB5lwm4FrvIJ15pXsHF4+m/GW6IGAabF/eNLlmsrvWK2TSxiONbb4g0lAe6/Izn3h/61Q= 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=qFutLe9o; arc=none smtp.client-ip=209.85.216.46 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="qFutLe9o" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2f43da61ba9so2663009a91.2 for ; Fri, 24 Jan 2025 00:59:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709155; x=1738313955; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s94rBGytqIBo4tekti3AaboReTxXzjmT35D71HaGAY0=; b=qFutLe9oOhB3lpPmToxh/n6n6lHObAtWO+of6rVF1ON1/nxpLisgqaWc457GEgeoFr DWerTDRNEXWe5PbKGbgOfStRMaEG8kf6UbB1dZCGKLlQG01KTsG58fjqELWFgbhnkW+7 PoZUO0doDyf4PN/11pwA3RbzVUOLMMAEO5aa3UGCDwGLH714hVy6RsiGMlG5DQiWLAzv HuVQrNE4eUamLKyEm4OLbXcFnQh+jZrGZhXFV6+UXUQ3kJ4Sd+XAUXoY+kb4oxru1kK2 KX0/wSdgCgBoNICgLEgaZWGC9U2TxpSqAV6LnWvv882GQNIXPaqJWN8Di4rGq4WGTO7p 5VEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709155; x=1738313955; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s94rBGytqIBo4tekti3AaboReTxXzjmT35D71HaGAY0=; b=SThcnnYdxooHpzaO0JgIXqbsSuID3h0yeiMpIrBU9ETwcYjQPKSChqyXAGcdcxrZaq I+0dElXoxmMrQ91VzSJWPpnjrBWnLNZ1aOl8nlb72YGPyw05DvCTRlgbbzfiqs8coJXD bZLf6inCtjRG7h10QB4zSIchhYRvY76IqfV6R+lE2z+OW0qwUz7IUtt77zGObQZYOZHs UZu90c2j2M+Qlf7KwItZoPsGzb4PHG+4A15m0DmzTOKwUBV4IZ2MVn5U59rrmCLfW8/k +AsGQmKO66AYoR3gNO08w8dpgs6LDdO20ZW6Vcx2cJd2EzR98mbvlL5oCMW5XVKOstER X45g== X-Gm-Message-State: AOJu0Yx+eW151cmWvDXM9Xic5Bu7eBpXa79T6aN3JPrmS/0C+hSJ4clc t4XH6Gi6FIADYdh82NKKA2k9kGvwQwvtbRV6AUY1ZYUQvsYntjpaNJzDfZJO3WQ= X-Gm-Gg: ASbGncv2Ulc2V+KJjc6Up7xG5oYnlIKOR664ODsBt0f2c+hvxB9ureDW4X68yt+6U7w 7dd0Men1jYneByuWMIdmGPPfaV74UrN/MRIW/LgtlozXKF7qdsxu16MxzQA7B45YNgvBll9doEW QRRgBoaqNyRlQ+A9x0voJWrgbsphUQmghMR2igZUpLc8VSbZSSBhpJD4Q1tLTotOBDU1RxANqKv Mil4iu/SqWWGRv4uPoKKut6C6UrJU6VCPG+sVzn5s423KzP1qvTYwfbPVjbsyoqz6tyAd3zwLSZ s0crr9ngUjZJJvguhw== X-Google-Smtp-Source: AGHT+IGd324gk3vUxN6Dj/7u4RkiZpPJbthb1QKDynr38KHf328GZ4u/AOfJCn10b0DpZhUS9hZTMg== X-Received: by 2002:a05:6a00:1412:b0:71e:4930:162c with SMTP id d2e1a72fcca58-72daf94f6a5mr41280675b3a.6.1737709155304; Fri, 24 Jan 2025 00:59:15 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72f8a78e3e5sm1358044b3a.172.2025.01.24.00.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:59:14 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Lifeng Zheng , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/15] cpufreq: qcom: Set .set_boost directly Date: Fri, 24 Jan 2025 14:28:17 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The boost feature can be controlled at two levels currently, driver level (applies to all policies) and per-policy. Currently the driver enables driver level boost support from the per-policy ->init() callback, which isn't really efficient as that gets called for each policy and then there is online/offline path too where this gets done unnecessarily. Instead set the .set_boost field directly and always enable the boost support. If a policy doesn't support boost feature, the core will not enable it for that policy. Keep the initial state of driver level boost to disabled and let the user enable it if required as ideally the boost frequencies must be used only when really required. Signed-off-by: Viresh Kumar --- drivers/cpufreq/qcom-cpufreq-hw.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index 7d83d7d2ccc8..4b3b3dbc7d38 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -566,12 +566,6 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) return -ENODEV; } - if (policy_has_boost_freq(policy)) { - ret = cpufreq_enable_boost_support(); - if (ret) - dev_warn(cpu_dev, "failed to enable boost: %d\n", ret); - } - return qcom_cpufreq_hw_lmh_init(policy, index); } @@ -610,6 +604,7 @@ static struct cpufreq_driver cpufreq_qcom_hw_driver = { .fast_switch = qcom_cpufreq_hw_fast_switch, .name = "qcom-cpufreq-hw", .ready = qcom_cpufreq_ready, + .set_boost = cpufreq_boost_set_sw, }; static unsigned long qcom_cpufreq_hw_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) From patchwork Fri Jan 24 08:58:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 859941 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 B2E6921CFEC for ; Fri, 24 Jan 2025 08:59:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709164; cv=none; b=fzp/jWfSqamupUMtL0w/crTQXmylfHxheqAVtV28tzC/c2NY07hSsAEvNZy9WbY/c1WRrJ5WxHEp1QEwtSeksD+lMdRnIxwA6NIt4XDdM72tCWaCFgAzqsUwAotkLYmLw3Zj5IZOanj6rM4wTdDY7yFyloEo5zqkLt5G0soYpGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709164; c=relaxed/simple; bh=ULjGKJsjTMG+mV2ZHVBBRQHfJU3m/qH7+3cmB5CXtFw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cUUhsAjNBVzvOND+4vfeSv2zbajuXt3WYMm+QawIvlx+grtxUSm4vmBAz/a3ONJ6v+1X5mrW0j0Fo80lf/dhFUXihPMuoBcirg8hgcA2unCQYMuC1wSzMzpxiTomISRv+cujOJ8P10i4d9bp7qnb6d2P73AqOSJ6nePagSRWIho= 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=ivK3KX8h; arc=none smtp.client-ip=209.85.214.171 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="ivK3KX8h" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-21a7ed0155cso31504555ad.3 for ; Fri, 24 Jan 2025 00:59:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709162; x=1738313962; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JFxnMHbxvTTBmLKPzYlOGeC6vsDfeppBbE2mTHF/Sos=; b=ivK3KX8hSf+M2FepoE+W8xHNaKhiG/NGCiKxovz4zf7OVDjCyLQHWhwzYfx2+LSKrl e1EY4Eaakxm17zFulnOr9UHT2Z+Z00p7X3c8ccIP7yPt/we7gfpA1Tcxl4K72S4dfUNQ v5FPVrbhoSWmfLM/vMVHfS6JHjn6z/qq7A4xceMIWQQPBjzaF8vgYYXHf3Jc04PiyKUu +wT6kEp43V+6uPIUPePW5xaF2waHOTuphzioeMf7TUS8++oDw1cLdEiRtYta/+AB4bQF plsHXpDbSXlGgJGUuauG7be2/wKEuMXCa/Fferfxly84/W1cfRqPNmId2hYoR4U3/1JL Rm9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709162; x=1738313962; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JFxnMHbxvTTBmLKPzYlOGeC6vsDfeppBbE2mTHF/Sos=; b=ucrLQOLkUaChqUPsO6HSk0+f120JSfkvVuexdZepMzHZEEJXsJN0lxGT8vbpcTfe++ ImiU0Ggyjj2exKAkwPtxLAw6VyVelOSsqe8TlNlDr7xIkXp2q810jHxFfehJilVdld3l Jc7DxFYQzxjI3GzDLZq0dOWLdoMCoaDcu6XNBAHI05Qr/lzlcylB6oqEWGALDWu9wxmT O1HZ4hc86moYElWTtRj2uXyPXy1hCV4qiWBGWuc7XcTmHGOE2RIlcoc1HucuHZ3Ud3AQ YdITKxSFrTPYcIjzYPzDz//5EBq2F5N1tP1pQ9BhRsCvn1Aa8P52qE7YhC0ygNvP/xCX LT6w== X-Gm-Message-State: AOJu0Yy4TJjeTgqKlJpA3RgPfwffPLOqn9eyTB/l0+4TkhgBxV17YaLs AdlMoiCqdUnt3YfUpj8wyLeZ20ip3GEUPXtzIYxxcnO89+7adCHca3e75nKz0C0= X-Gm-Gg: ASbGncuwLfk/ZRgOUc8dYXtAWZm4YT7DKLLlLzVzu9oujZd+y4ssi7COoNVfcZ+E3sW O6EwNbjS4ySmoTuqF0+wsoGNiv36UjAu5M8vpSP5fpyANXnexsCXUW00h8JopLYua+0vUza4CgH 9qfenwbSoBpQg+wXFSe9eefmE71INqjSSOOj+Iwz/+vx517dXLg3xiSqDWBsk/SN4KJ1RQiCQhj xuZPB2vLEA+GvCPKrm0t1Y+SW5dIqu98A/UX7C0pucqF3/G7MeG3Y47kBfU/Bmj1v8ND/3tKpYs iptkWno= X-Google-Smtp-Source: AGHT+IGA4U5PKUSB/Fl/ucI3iPDUmdY7tysT41SGfU4UDpVf+D8dWvWjPH6QK7CS/STrOa6a+1M9Kw== X-Received: by 2002:a17:903:186:b0:216:1ad4:d8fd with SMTP id d9443c01a7336-21c352de48cmr370279565ad.8.1737709162069; Fri, 24 Jan 2025 00:59:22 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21da4141c43sm11593165ad.122.2025.01.24.00.59.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:59:21 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Lifeng Zheng , linux-kernel@vger.kernel.org Subject: [PATCH 15/15] cpufreq: Remove cpufreq_enable_boost_support() Date: Fri, 24 Jan 2025 14:28:19 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Remove the now unused helper, cpufreq_enable_boost_support(). Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 15 --------------- include/linux/cpufreq.h | 6 ------ 2 files changed, 21 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 1e6ab42b405f..00d86dd7945a 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2876,21 +2876,6 @@ static void remove_boost_sysfs_file(void) sysfs_remove_file(cpufreq_global_kobject, &boost.attr); } -int cpufreq_enable_boost_support(void) -{ - if (!cpufreq_driver) - return -EINVAL; - - if (cpufreq_boost_supported()) - return 0; - - cpufreq_driver->set_boost = cpufreq_boost_set_sw; - - /* This will get removed on driver unregister */ - return create_boost_sysfs_file(); -} -EXPORT_SYMBOL_GPL(cpufreq_enable_boost_support); - bool cpufreq_boost_enabled(void) { return cpufreq_driver->boost_enabled; diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 466d186166da..cefd853abfd1 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -782,7 +782,6 @@ ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); #ifdef CONFIG_CPU_FREQ bool cpufreq_boost_enabled(void); -int cpufreq_enable_boost_support(void); int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state); /* Find lowest freq at or above target in a table in ascending order */ @@ -1157,11 +1156,6 @@ static inline bool cpufreq_boost_enabled(void) return false; } -static inline int cpufreq_enable_boost_support(void) -{ - return -EINVAL; -} - static inline int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state) { return -EOPNOTSUPP;