From patchwork Fri Jan 24 08:58:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 13949088 X-Patchwork-Delegate: viresh.linux@gmail.com 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 E4C2C219A91 for ; Fri, 24 Jan 2025 08:58:34 +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=1737709116; cv=none; b=bS2clSi2jMuJMuFfSUzbn9+f6FU6zEV0CJ/WZdV25wuu7j+okp6ONfe7t/ehBytSbPe062ZfGd/L6radWNbBdDYSX9zj7cO3oOWdbg0ATWLXNKiODHptf6RJEPHzXqJtTxQg20+Bucnkxr4Fg1N5RNbPErmJwSHCa1dc668CRnc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709116; c=relaxed/simple; bh=wv5lK1t6q3Up5NAGc8MERFbt25hqrNJiRLpe7fRJRlc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=f8Chvmy802Lyt5UT+rHEbfBLZsa2x0CecWYSDCH2d4Shhdd00KPoXBkRDVZp45S8dM4tq2OII1hBQ5tLv4RgdDH5mMVttNFQgpj2qH6uotx42GV/Z4aB1dtoZyYCWUfdI93ZoJochgXrCFWpDJId7rtoLQZBLlgvP4NT9OyIn6g= 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=DQ+vRevF; 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="DQ+vRevF" Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2f43da61ba9so2662313a91.2 for ; Fri, 24 Jan 2025 00:58:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709114; x=1738313914; 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=PTbVj2JiCj6/pNfOZdRNpD/qIv2cEUDOMfDgqaCF9EA=; b=DQ+vRevFO72QonqFSYgwpFlvFqDyDWLOvLdW3xy0+n6kVmHwXDWWtYS1xZExz4vjGx hyQoRbqXn61KhyqyNbIZr9sv5h0BLKC4BssYN3UuIeTK8qfQM4WUFHO+rjNwz7xMsCAX CzOyrXtDsaxrla5+5Oz9cZk6P36klHBScmbl5xLcEgyu+Hd8folofH5QjLZZLCAESzeH UpVwl/nwPoBUM8Mm1H6JCl81vbHrZkR9V4MZC9PSVS7O3XY7B3RTu0X4ys/2+EOO+cZw bmUooyb0webi/GwawkzYkN3N8VT/f9C1G4htZPNm86NAuH7eFrbCW/UR4WVJAY3OYrjP yXfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709114; x=1738313914; 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=PTbVj2JiCj6/pNfOZdRNpD/qIv2cEUDOMfDgqaCF9EA=; b=RhnGPj2/y8nrCA5uyPpJfrl5V3Hh8srmv7xfEmw4038q+J1psxOJGQ2OwBegAkuWpE TNxYABDWuXsQWSMWdi5qxTFPNZvL77p8T2w6c64oiz83P8BhUp44Gxq7n5jPEOTNu+Ty GQeLibrZedzLenIvyDd6MJ9zxjXag3Ix9i+DVo049GqQQeiI6//tVYQURCKzDQDd1Fhq z/2IdBURHv5YULykRVxob+hgvUKz53x31rp8t2FAI/6GyrjifpkF3yW1PhDBibJbkkEj x0WqirHx2MTtGf5P26IPjfyFrOMjswqoP1xR+BQPSIzUNXK1vQeS/x/q4xs0VuQqAsft 5hQA== X-Gm-Message-State: AOJu0YxhCQ6uoVlzHkCKlOpbIpnep3Cd66nclf7iyMZQvv+KrwYmu7lq JtHUtRnMu1Rs5Xa86uFL5BXTxB06XL8hQc2kxneTUaogxCTkvKIZcnpE9ls1AAE= X-Gm-Gg: ASbGncuOnz6NV0qt+EVouK7h9lOMCa26jhigHg8JL9ADSs8PicGzJMioI8iBtDtRuoy WGoXhlkUgqCKjBvig2lhrrT8Fw868NB9r5Orkf4rDPTp7p6p9EH30DDgz5fk34XvwtoTN5F0dCQ euJU4IHT1Vfr9NZ9zExaVl/i980uUI+w1Vh9tcd8uBIe2po6p13KDs1gONdC+TL79NlPvCS7ksA TGyMHZlydtB1HBq5/+LAyEsAVcrUjU5AGhlBwqEFExdR86uIqkO0brIwEDUYrfLY/aINgIU+7qw Fp/4Pmk= X-Google-Smtp-Source: AGHT+IG4QgMNgRuPdhLzSefYDVkG5uWzW/GyEACYlaytVe9bY03mqBN9ChD/+04NOVeTJUhuQ1Jq+w== X-Received: by 2002:a17:90b:520e:b0:2f5:88bb:118 with SMTP id 98e67ed59e1d1-2f782d4ef17mr35435847a91.22.1737709114299; Fri, 24 Jan 2025 00:58:34 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f7ffa67840sm1259487a91.21.2025.01.24.00.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:58:33 -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 01/15] cpufreq: staticize cpufreq_boost_trigger_state() Date: Fri, 24 Jan 2025 14:28:05 +0530 Message-Id: <751338633b070ee570c3c7da053bd6b9497ee50e.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 cpufreq_boost_trigger_state() is only used by cpufreq core, mark it static. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 3 ++- include/linux/cpufreq.h | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index faca6a143263..0782a6d89df2 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -87,6 +87,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, struct cpufreq_governor *new_gov, unsigned int new_pol); static bool cpufreq_boost_supported(void); +static int cpufreq_boost_trigger_state(int state); /* * Two notifier lists: the "policy" list is involved in the @@ -2805,7 +2806,7 @@ static int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state) return 0; } -int cpufreq_boost_trigger_state(int state) +static int cpufreq_boost_trigger_state(int state) { struct cpufreq_policy *policy; unsigned long flags; diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index d237ef91d1f1..0e708830d30d 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -778,7 +778,6 @@ int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy, ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); #ifdef CONFIG_CPU_FREQ -int cpufreq_boost_trigger_state(int state); bool cpufreq_boost_enabled(void); int cpufreq_enable_boost_support(void); bool policy_has_boost_freq(struct cpufreq_policy *policy); @@ -1150,10 +1149,6 @@ static inline int of_perf_domain_get_sharing_cpumask(int pcpu, const char *list_ return 0; } #else -static inline int cpufreq_boost_trigger_state(int state) -{ - return 0; -} static inline bool cpufreq_boost_enabled(void) { return false; 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: 13949089 X-Patchwork-Delegate: viresh.linux@gmail.com 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: 13949091 X-Patchwork-Delegate: viresh.linux@gmail.com 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:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 13949092 X-Patchwork-Delegate: viresh.linux@gmail.com Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 E886321ADC2 for ; Fri, 24 Jan 2025 08:58:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709126; cv=none; b=rGtboP4YsXOCiwwjf34IPBR8mR2fPylLvhAqMj7ovo29aBLrTPXWtjRQMGtIRmZrDzs2/gNn/dNMFXt+BXp/+bdPRRlCBdta2gLVTwVQyLDQp6r7COUei4751dg0LAgUhz6252jNJaNQzWNZ6oyAh0ro/BKcRAX0XVsAf09H3lE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709126; c=relaxed/simple; bh=ZtKAdPOE/yiUZcNKc6wx5VGP3CgOWIpPQs88KFvxwiA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SIIKfVMf14OfhXQRSIpLPWY7ptPElw1Zc1uG4zTwLs+TLkjk7ar20GyFxtji2Am5tdapKQXMKS+a9Hn2pF2oUXa0C6SAwLi74++/AE0rGcnhwi2bauLSvcoiqC1o5tJ1ELmX2xAPokHRChsDP/zxXcsyDzjSU3ggSw3Pf6nfWyw= 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=qpRtzuNb; arc=none smtp.client-ip=209.85.214.177 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="qpRtzuNb" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2163dc5155fso33173295ad.0 for ; Fri, 24 Jan 2025 00:58:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709124; x=1738313924; 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=yzYc7qVU9Uzxw80p5rHJnVdAt0LlKaG56j4kp6QKVj8=; b=qpRtzuNbB6xkzDmC3bNodkCyQnq+OL+cWU3hlEUj4oSNjNkTzBpCNzE6HsaTICbnWN kUN6YAi4ls/VsR4CSiK2rP62POrDgCF4tUTGo2WGIHwp1ymRAJmI5Ma1FTjyCacOdBOW l+05oIp6yBNvEsDnAMHQPWdUJ1FzcJjBj0VcRAFZ6mn+2IbgeFjZKyMsDGss0Pm/Si4q MEtgPOOzv5xQyBNipz9f3Ax2oxW02lXBkcWHWnLcD1g5pjzctdWVKDX48/83zcCMDY80 wFiQhokuuaR01up5j7Dmfe3tuSj+c7KdPL5fjUQOP8HK6Wd7YdKEJ/lRQev2+/ZTOjRy nUqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709124; x=1738313924; 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=yzYc7qVU9Uzxw80p5rHJnVdAt0LlKaG56j4kp6QKVj8=; b=dTC8/rdbfJpPi6dat35P9dGnJvkcw3hMf1exZOOkw1CgCAp01zCqSG7STFXwbq6X37 yDoa8/pSi2hS1OD0SfkXLe3ki3cp1KIZwdOG+30W+p8Wr5oxSHlnbFwMtLeATLJGVNMO F/IN0N4uRSEEOMoZYQgVzI91iA3wzt3GdIeYmRWWI+s768ly7WVlm9TPghN3n5e8YT9O vNtHd5tMcY8b62H1DhOIOwLh+3uXYgdp4q9tTp6e5xgx+JwcRI6NXAFhY5pEauQWDJJ3 NuRY+dWRpP8kiqyu+ezykPNzywuIZxA5HbNma6oJekAcyY/DYzMuiS8DNixdW83wzSqx 9OBA== X-Gm-Message-State: AOJu0Yx8AAH3SBRX+qD6B9zVLrQMes/rCALsiV6BhXG5UGrHklY6DPeu 79dCl28nYpr1tpKJbYXh2FFY5WqHZvWFvIO9JIlTvqLdfnzms9UCV2vSI1aXi5o= X-Gm-Gg: ASbGncuAB7GsWR3YiFctzRKSzc8TwDhe2/icsei/V7EnnBp3+hEDSoryHg+rMSl8Vmb /Veny8acWAW/vrdMhr9hhdMGTPT4HyPlhvlhsZroiqu0f2BNAC16AnLesy05mekUPgjE2F7DCMh byfk+daKMtA6wNGAhMSGWKC0NHZzStO4/O3JD1pHTcVVfEYB5cnWi0Ats4QnkGvCBADGt75Z7oa YVE1VB9uhrIKQtm00apOg6rw2rDxtUS9ZOZgE8e4vrj8O1uF94txSy8I70aIosq4g1J6/wDxGjK qrgD7iU= X-Google-Smtp-Source: AGHT+IEW2J0hQVKd6sccpBRyw0/ehkHAqNU6doeIgHMGNqOjCEKZ13YCsHpa/owM+wMbKyWGMLNMzg== X-Received: by 2002:a17:903:120b:b0:216:1cfa:2bbf with SMTP id d9443c01a7336-21c355deb5bmr484792275ad.35.1737709124236; Fri, 24 Jan 2025 00:58:44 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21da414da40sm11422255ad.179.2025.01.24.00.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:58:43 -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 04/15] cpufreq: acpi: Set policy->boost_supported Date: Fri, 24 Jan 2025 14:28:08 +0530 Message-Id: <0b4d7f14cd2c17a2abd5f94b67b50d293f5d6bc8.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 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. Signed-off-by: Viresh Kumar --- drivers/cpufreq/acpi-cpufreq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 3b7e63e8cbd4..6f16cc25ab70 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -891,6 +891,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) if (perf->states[0].core_frequency * 1000 != freq_table[0].frequency) pr_warn(FW_WARN "P-state 0 is not max freq\n"); + if (acpi_cpufreq_driver.set_boost) + policy->boost_supported = true; + return result; err_unreg: 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: 13949093 X-Patchwork-Delegate: viresh.linux@gmail.com 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:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 13949094 X-Patchwork-Delegate: viresh.linux@gmail.com Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 520CA21B1B4 for ; Fri, 24 Jan 2025 08:58:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709133; cv=none; b=uFJMTtgZF1qwAHDqEC3GdJDIPmFvAdUsGbAwbgCVqBBz8uKHq5O6w4gm9RYcoMByyfoyxyo1g+Tb77tDCJUubZ5SWkNarEGWin7PpYm4/UkRgwdtw4C1mHI5/vQdj6lJTJQZAR6gIojIb9YTc/4HSYBTYL9X6sgDAX6PCcQy8xQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709133; c=relaxed/simple; bh=bXRFxc8mF6V5TgGKJMgWIksw91YHqbMB+UstyP1aTGA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UKI6j3XK4Cvpe4cvidwe4pvZL0ekgJuNwnjOLDcVDN+n6Ea4u98+2zjTkUyLlLf5VQEJdMPxHJJ76YjrouDLsASqlBEawnKpbfOKzEhuh2ivWR4KHwRgZZshY0ceb3nU4PbMPw5qlmLRWTfWOsJp+nIf7URPQSusmWUalRP+2Co= 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=GxOkKQCm; arc=none smtp.client-ip=209.85.214.170 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="GxOkKQCm" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2166360285dso32994515ad.1 for ; Fri, 24 Jan 2025 00:58:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709132; x=1738313932; 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=fMoNvFkgp1qWLsX17FcDuwLCN8OyZaPo8LJZUOBX12E=; b=GxOkKQCmN64sAQBrURY/UX3/rTlcOpjQu9QkW7ktzBaiNDZsAp5IaXIULOYk00GmFY fqnKhbrMf00/rywIkf5SBBmusZooCqymVaMuTCrYgq33XxPYC72zqvooHCnaYjs1dY2n 29ojGscsaHE6Wlk12Nd4aVX++Ep4TqXjem4sA9ApsaBZd9t7dsR/Ji1VAJQfzL1Hoglt C+JvfJHXOb4fFjQagsloJGCftur8P+vbt1KOaQ8KZ+3Wg4rVUy7gAmMqHKV8DTVA9MR1 eC9dHYa3W/Po/NtLP0q86Y0D9qmbz53aY/ZZYcRmEFzobQ3s4YkVLR5k1vGYatuFiS2X VF/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709132; x=1738313932; 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=fMoNvFkgp1qWLsX17FcDuwLCN8OyZaPo8LJZUOBX12E=; b=fgL/L/l43IcF1fXGqip2T7OcFMIqEjnvQZAdOwtJa/4l/bpJh1wbKu8D9OTdg9SDYL PyFnn8wJtK/zBG4sPvSN1QWUWbEx2r5rD7cCwWedV0sjkFzXVCdwZqfdSERlAHtuSJDh R7gHC2QGB++AV5H3TAh7zRGxCf5hbrYfESXtFBOxy+WWM2v5nuCfzdcVrYCPHiSWyWOz PczdnPFIU19ehoFD9a5O3FM+7jb8NOkMmsqWe++xL11wxfHnazSLc5aD83slwP5pHcNq Kx/fNCEzRh1R5N1aJ8saI1xe1cVqfc/8mci6+fMBQNy2ZskZK10pO43ykud3jC+f9jAQ MYEA== X-Gm-Message-State: AOJu0YwgA8iF44vWqP7ZtuwMu+4Lv5wTmvVkzqBj55sdsuLpcttY0+co kkjAg1T1UzsH2jQMSPWEFwGG1gc4f79UI6l33yIZaGS965RD6Oq/6WhcKApQonI= X-Gm-Gg: ASbGncvPk0DkwQvqrFT6ty8BNfQd5GF09zuvrPS16d00QXBXqy5dU6n8SwIMp8TDvbz Fc/7R2QzcCxoLmWw1ulBKFpGs86RA6+p0UiOXGdgrnVpJCAyDxZSQUh/V9/jFXsYFe65XMrM4NT A3gdK6Y8jqA9uRsEs8Ff8rP7o6f/KDSuSXxdCE+FOIW1vlKDruVewXi06PdXTxUpPmhoYWDxk0G rRkvUYUNwDajy9wh/2wmuE6tluccg8TMMAXr/KhUHLIc4WyrCqZ+CCO9rNCJa686ar4rPqu3SZR WQ7sasA= X-Google-Smtp-Source: AGHT+IF2An5pDAZVb9/MWyUP0DaYrumqgTX24QmkS+YPaDLqPFaLEbPC4ywZvWfU/YeOBmq2oXhZoQ== X-Received: by 2002:a05:6a20:3d86:b0:1e1:b1bb:87a0 with SMTP id adf61e73a8af0-1eb21591728mr52880822637.34.1737709131715; Fri, 24 Jan 2025 00:58:51 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-ac48f897339sm979618a12.19.2025.01.24.00.58.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:58:51 -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 06/15] cpufreq: cppc: Set policy->boost_supported Date: Fri, 24 Jan 2025 14:28:10 +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. With this, the local variable boost_supported isn't required anymore. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cppc_cpufreq.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 7fa89b601d2a..08117fb9c1eb 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -34,8 +34,6 @@ */ static LIST_HEAD(cpu_data_list); -static bool boost_supported; - static struct cpufreq_driver cppc_cpufreq_driver; #ifdef CONFIG_ACPI_CPPC_CPUFREQ_FIE @@ -653,7 +651,7 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy) * is supported. */ if (caps->highest_perf > caps->nominal_perf) - boost_supported = true; + policy->boost_supported = true; /* Set policy->cur to max now. The governors will adjust later. */ policy->cur = cppc_perf_to_khz(caps, caps->highest_perf); @@ -791,11 +789,6 @@ static int cppc_cpufreq_set_boost(struct cpufreq_policy *policy, int state) struct cppc_perf_caps *caps = &cpu_data->perf_caps; int ret; - if (!boost_supported) { - pr_err("BOOST not supported by CPU or firmware\n"); - return -EINVAL; - } - if (state) policy->max = cppc_perf_to_khz(caps, caps->highest_perf); else 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: 13949095 X-Patchwork-Delegate: viresh.linux@gmail.com 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:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 13949096 X-Patchwork-Delegate: viresh.linux@gmail.com Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 DA4D221B8F7 for ; Fri, 24 Jan 2025 08:58:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709140; cv=none; b=I/CoCAf+aiOEn/iYZZr+pUavFvbZRt2YexrwCmG8fzxDxkfGc59moZiqDPwS0F72nJE1QUTKaK8vXsTywydNUdR1L5FC/xoWEvYZKYgJI3N0tXyyG4X8+kB3QfeIIZplFPrXCLdTq8l0zwGr9mZccsQXVdkaxVK/EroAMLMATSk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709140; c=relaxed/simple; bh=5Wt+y1kfE0SNlUgZf8XNj9qMfwaP2g0NAvwYLLYwYqs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HKIMAic9hQS1SAVOZdre0aV9Pc+hGVMGsoetmv8DUTonHYe2+ZOgu46gOUKeRjrTDpIG7qDhJW34ahwQqdu6n6yBBzL69rnM8Ta2ckQrTouEOTGMeSIlhM6Urpk9LewiJU0QzSvujRSkDzivFLV2sO0z8P+2KSp/ECUNhm9A/e0= 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=zBph0jhM; arc=none smtp.client-ip=209.85.216.42 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="zBph0jhM" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2ef72924e53so3369442a91.3 for ; Fri, 24 Jan 2025 00:58:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709138; x=1738313938; 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=eMlqr/+/x/eRJJM9d3zjLn1HVC6jDi6vYxdaFPI1JRA=; b=zBph0jhMLru2QlHOOLTnMuc5zL1Fs+Zzy9OIJ4Z5fGdo9QHjJvSuE4fqaiZh/TmUBI Pd+uPEbE/itsbr1zxuFPbhlaS1/jJImBHDCoenUg89uMnbIQfFDHqcpQiNbV8lGFN1cF eh0dk7suhbeSPx3e2JiVHhnSrz8QInHYvoCGxknrFIC+4dB2gbRUaWor8aRpvbzc0QsM 10eiJfYg90Q6HeijhE6BLQVqQLqCJJzbtFTFJomZSn3GZCYCckV5TBUNm+udF0A+DAD2 gWfZ2qzc+DWuNvCAQ+lqY/zOy59pkvOZqcYe0iPojop0q2SQodH/iZAwk+hMK5T71BPK pMGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709138; x=1738313938; 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=eMlqr/+/x/eRJJM9d3zjLn1HVC6jDi6vYxdaFPI1JRA=; b=gaqacW8byFUsQef6wO7SvxcVbJsiyV9ZSFBxszOvtwEX+J5SPulzwxcLyO7MLeKF5O ayn14y2TPdW9CieWbeHZBB56UKlVdw2Hwn4SVMFqUPflaALp4eO/Dij4Y8XAjeEU2dP7 UiyXgKWJSZrEkhp0uGk/DCklmVmzegSfuzizT7jiD8eNH92IhCBBo+UuGqPxm2L8X4d6 wLUYsKC1pU0vcECqFi//JeiHxN7Xv1mhUZ6iR19hqpapvn02W49jmL5CkQjhtlxQ5UlG pGGqLhk2ua3Bj7ceaKWrowa9WIjobeMkdXYnGOsveucLgt2BFi3/8E/1gIUF1895VtSo s4UA== X-Gm-Message-State: AOJu0YyzM7xk7OvlA2n55KLjuqk1WHIY5QTJdtdq9szekNFYLVrqNtWQ wUlEQJ2jiA/QfzRYs73lffdxsfBsQ68kaMCRmVEeZHQuJBii5OD7k9OTisrOtbA= X-Gm-Gg: ASbGnctHWFxQK64UR3Hx8Mv0nSJ+GMNLOXWZyx+LSu8evJJuKTg9JTOs9PctftT01sV mg7QdYsFPXHeXx1gasIgRSLjt/1FmQhsNtEnk1hrgQHjqUn6XCkwWxyeTyT3SCOTH9LGrVV8Qtg mtq02hGW5YQBFtje5QSBsrY3wa2Z22IP4vS/IjvBEHjn/w6z7YIJmoxXlL/LYQk6eUAcyP3IsTx b/IGXOORs6WralKwB0S4mG0HXFj44IDoQOV0PkYksLvqjvs0DEgEpEAGpgz+f8Yrt4x4xLcPo/7 pVws21E= X-Google-Smtp-Source: AGHT+IFw8pe4tFyZIYNOF9s8Ywp9EEDR1mTMV9kBrefpwpJLLbKS7BB6GQPOd2o0T5Xa7ofgRk6iIw== X-Received: by 2002:a05:6a00:ad8a:b0:72a:bc54:84f7 with SMTP id d2e1a72fcca58-72dafa03117mr40695468b3a.12.1737709138233; Fri, 24 Jan 2025 00:58:58 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72f8a6d234fsm1337263b3a.77.2025.01.24.00.58.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:58:57 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Hector Martin , Sven Peter , Alyssa Rosenzweig , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , Lifeng Zheng , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/15] cpufreq: apple: Set .set_boost directly Date: Fri, 24 Jan 2025 14:28:12 +0530 Message-Id: <417fcceae52d5173cc2606dcaafe9886fd4cfeb3.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/apple-soc-cpufreq.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/cpufreq/apple-soc-cpufreq.c b/drivers/cpufreq/apple-soc-cpufreq.c index 6ff604a0fe79..4994c86feb57 100644 --- a/drivers/cpufreq/apple-soc-cpufreq.c +++ b/drivers/cpufreq/apple-soc-cpufreq.c @@ -310,15 +310,6 @@ static int apple_soc_cpufreq_init(struct cpufreq_policy *policy) policy->fast_switch_possible = true; policy->suspend_freq = freq_table[0].frequency; - if (policy_has_boost_freq(policy)) { - ret = cpufreq_enable_boost_support(); - if (ret) { - dev_warn(cpu_dev, "failed to enable boost: %d\n", ret); - } else { - apple_soc_cpufreq_driver.boost_enabled = true; - } - } - return 0; out_free_cpufreq_table: @@ -353,6 +344,7 @@ static struct cpufreq_driver apple_soc_cpufreq_driver = { .target_index = apple_soc_cpufreq_set_target, .fast_switch = apple_soc_cpufreq_fast_switch, .register_em = cpufreq_register_em_with_opp, + .set_boost = cpufreq_boost_set_sw, .suspend = cpufreq_generic_suspend, }; 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: 13949097 X-Patchwork-Delegate: viresh.linux@gmail.com 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:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 13949098 X-Patchwork-Delegate: viresh.linux@gmail.com Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (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 6D1E621C19E for ; Fri, 24 Jan 2025 08:59:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709147; cv=none; b=ATc178V1NN97jAew44pqzEX5/2+2ZYIAN7l6X9qDNgSfIsuGYvN9+8lwYsgjcphG3fDNzQHskLsfvrFOydQEDTaQIoF7HVvrC0/4fqmzf/7qF5NmTT0CgN3cgNI9nBXZsIhn9Ci6AP7FrhDkeMMje5bq3iWW6p83YJJycJbUXAg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709147; c=relaxed/simple; bh=3/ztBZ/HEPa/0k8R9f3RWIpWad4EPbBsiTzjR0GmEsc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aMgO4ahUSm8c5tGgt6+53kLc6zT6W7jGRhqotslgxE34dRv5JrL7e8Iegg4hPQo6r7AJFHnCpbkR5HJ/LFt/CFDJDEVN2w44lii7Cu6LnMdp5zgFYz9JmSoDZc3zi6Q/VcVlfzYxU7nG7IWz2d0YRiW5ZASsp7x2m67CwjlDdjc= 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=dCqrEGVm; arc=none smtp.client-ip=209.85.216.49 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="dCqrEGVm" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2f43da61ba9so2662721a91.2 for ; Fri, 24 Jan 2025 00:59:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709145; x=1738313945; 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=XHvPLEImTEWfALntTBCPd9TKW0+oiHv2uyr8XB4xyIc=; b=dCqrEGVmN+SlrNYH2QodDIHZOAalwer66LQDEbpuOG9nE+XQwJ7LyJX6yaeOD8R3fg tO2LgPMFfSXNLcVB1GKO+P3NusZmqfwE21yiEwhuBWQqoeWXVYWvLMe7hv/TinyBiDZR IajaY1abD/+q2n4g0WBYPWWXKVB0kx/GpIfgf+/1hrEt5NFlTqcB+N9orZlip9ZW4gRO m8kKSDhYDycm41hhQkw4ylpHRpp6lCu7bM/9p4zemo9oF6hKUY5QER9ZcHA50zM3YVFp c+kMm1A/GG/YfUnNhS3JGbUalUVVeMGFxQR/oRjggYQG4GHV38AoprHBdGf1wym7uVAb V9hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709145; x=1738313945; 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=XHvPLEImTEWfALntTBCPd9TKW0+oiHv2uyr8XB4xyIc=; b=kAUzVlkC6KqdXtY1qmyG3wl6W9YHdju8SwoZe0osVXRJ+krTIk43IvGGboNKii1jBw ntaxcyV8Si8QdDhvQosRMgl8tLdO8uZ5FgA+1LxM8Z1CD0SqsMs1FFQUr1jzL/Ct4AhV 9jyk5yMtJpFCJnYLxwgcesA4ydkXneglrAPUeIlS2Zkr751BSYU0Fkbj5/s8FYLzlTso hOj32/dKInghvEnuHnFiYwc09FV0xKWIN/JfxgbSuLzn9a447aVxaxUUSrv+aC8uET2i wW5k/k3ictknRSM08pJjZ4SNAoJoluaGeXFBPKGUJNz8LFqpK+h8UIBlv1xAnLuxsw2z 1XDQ== X-Gm-Message-State: AOJu0YwoJCVx8yuCvNIHRjmwxZCNJq+q8ekhy6LOcUqfcAOy0QzaaW7i cnZ69EPLa3cv8ET82mVdU49MjTATArQMGiyP9uxHVeEJponkmyofngQsOTMKPUw= X-Gm-Gg: ASbGncu0+qAf6jV7rE2O5JzNG/TvKjPVmJb/mKUriWamYlLUWcUrMIRJLHNsU1uXWAb RE+srtM1L1i9AgRkauHNb199wvW/V7F0UukcbrwgiIjuCl/Qauo3jOkGvZNHycr+/DqdHis00Hb Eqn/D5C6VvQyjM9uzk8Wyg4HeqRuolyTR/kvIoE3ErxFHdPKj/ymUA1DH1Ou18T+QOe5dTFSeZy L+7m6Jek2qnm7BIp0gVJelSI7H2mq/wk3u8ovhM/eMViZbmWWCyqixNFxpa3klgjR4C76MvFzJK DKGxmUY= X-Google-Smtp-Source: AGHT+IFlPf6Y5ApV2vEgtwBRH/T2hTrMCJRbAhXXb7JfHHFFf33S6aG5dH1A+wfV/EhE0fz4W4IA+g== X-Received: by 2002:a17:90b:1f92:b0:2ee:db8a:29d0 with SMTP id 98e67ed59e1d1-2f782d4f3edmr36840886a91.26.1737709144725; Fri, 24 Jan 2025 00:59:04 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f7ffa6a725sm1258715a91.21.2025.01.24.00.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:59:04 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Madhavan Srinivasan Cc: linux-pm@vger.kernel.org, Vincent Guittot , Lifeng Zheng , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/15] cpufreq: powernv: Set .set_boost directly Date: Fri, 24 Jan 2025 14:28:14 +0530 Message-Id: <9b4af20d5b415f41e866ddd8bde9cf6441c463b8.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/powernv-cpufreq.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index 0c3e907c58bc..4d3e891ff508 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -1125,7 +1125,7 @@ static int __init powernv_cpufreq_init(void) goto out; if (powernv_pstate_info.wof_enabled) - powernv_cpufreq_driver.boost_enabled = true; + powernv_cpufreq_driver.set_boost = cpufreq_boost_set_sw; else powernv_cpu_freq_attr[SCALING_BOOST_FREQS_ATTR_INDEX] = NULL; @@ -1135,9 +1135,6 @@ static int __init powernv_cpufreq_init(void) goto cleanup; } - if (powernv_pstate_info.wof_enabled) - cpufreq_enable_boost_support(); - register_reboot_notifier(&powernv_cpufreq_reboot_nb); opal_message_notifier_register(OPAL_MSG_OCC, &powernv_cpufreq_opal_nb); 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: 13949099 X-Patchwork-Delegate: viresh.linux@gmail.com 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 Acked-by: Sudeep Holla --- 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:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 13949100 X-Patchwork-Delegate: viresh.linux@gmail.com Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 D6D2C21CA12 for ; Fri, 24 Jan 2025 08:59:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709153; cv=none; b=pMSROrwgDfynAFURlDHlcYmhfqYA5XvjpLXdlTpYULaXtD6pQnIzvmA98GzgzLYD6VJAFcWBLccyJAF1NI0oFL+LIC7l4T3aAs4UsHZZKt4LPctj4JW3TOeBqAphSCqij9XeeBXvVYTso2yCeotGd6yAgPJgiFdQXmQLGn7SiWU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709153; c=relaxed/simple; bh=vHiYt7vyvuTJG+6H+4GLHJZ9r0KvgIZnQowmLqEx3JQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AbExSrrXHrakyxcNanZybfo9xK8uur6t3aPjrJ9X9/kk9pIEIEVCEuOv7/FYbAF+1SUVp5Hh3j3jP1LZZu02JyPiCR0biEThWy+PdvbDPA5VriieVPBmwdWxW0veDbpxpJM9Gi3M0uWvi/bsvCJyziCcEIqUeNB6LlXN4WX7qJY= 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=vMXJxbCw; arc=none smtp.client-ip=209.85.214.177 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="vMXJxbCw" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2166022c5caso29276735ad.2 for ; Fri, 24 Jan 2025 00:59:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709151; x=1738313951; 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=p945ECaq9P80WMODWEJG85jptgTxpTyGy7Go/5N1kDQ=; b=vMXJxbCwpdu0D4J7HFbHuTsGyOEuW/jHwOqAFg58kT5KLWBVRlfr36X0LgpcOq21UE eKVODHRbBC7G8mRuJOwS0dHI2qksLilfmpzjzKwOOcrOmmgt3PJpu+tGLIowVVkZix2M BERiEbIHZLawOEIHZeYHh1RKlVc6ng2qqhqkNdIAHbPmmvrv7s+caBKqWP7h1de/YQWm P7boG/Z1K/bThOT5hnrRJu3Xqmd+dxobrbgy680FE7+6kuap6QiSOUEvvYBOorO/31ON pRvdajIqg2CklrLASOFsXliT28U5Cc/BiV4ftOvTz5NvPSTjExpOWFktvo/CXDkVRFQR FcZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709151; x=1738313951; 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=p945ECaq9P80WMODWEJG85jptgTxpTyGy7Go/5N1kDQ=; b=gJ6HqmZGmlFljizpcEPERMz2nhqYkEVPL8YW28rJoHVmXIRPC9qOM8IvWTofdOSe7Q oXKHMB3GClfnVcGYJvLx/dB61mPRspF/HwcPvEblHkdT8Fd/Oaw4RHaH7ZP+IeudV4Hu okXtD40H7xkRKH9z/TUlKMa5Crgz/aRYCKPc27BYlsUlhcDA9bxypxji9Z60ehsnBNtW toAR5BSr/Af4MRLPbj5fhu0DiD2hD5Z15BZgDzHNOC7VBe897+ra15cks0hgiI9b93PT PpjjiaIfasMG1oh+PcpnmCAVqt4xN/m9DMMYXeinQT7Q8LbGF2tyLeC3zx+7Q/rOo7fv lRWA== X-Gm-Message-State: AOJu0YySJD5spltSz4J4lDkVujN4oI2LJcZeaFbhYJ9dte6L6rurgw2p 6TkuWwarsY3upHRN3WUHZSjznWdxGHx0x6Y59tU6A4Uy8M6dpCMT41XR3hVexnC6EVsmtr4XjYI W X-Gm-Gg: ASbGncuPMoF5yKnjdEphNmWDHFklEY6Y/kWbZ3b4iDawr5fBBPBocaDnkp4KCzR+SBO kmLgjckcIHFgajHiPXPUbgo8g+rVOXRv9DxEOiJjzWfCrlGtcp0jJoEUHTfBkBfp1eATQ5nvZAl 8bZ/EbMaXf/oF5M8D4wBkS5RW+9UdDGObzUgp5WZA3KghZ9WrqjmIdx/H/vgOchOHX4rLPoApOg 3QniB8CjmeenQBv5XOQxFAm7aRdt/SLBahVvX3sJc+H+fBUdA6S5Yoxd2QB1EAj+epFJIAY+k4h nOPOxeQ= X-Google-Smtp-Source: AGHT+IHmp/m1FnjKUe6ha9HUOGa0p8k+59e/B1rJ5ftyPx/opbLtw59hiYoa4G65siJHRA37syBgsw== X-Received: by 2002:a17:902:d58b:b0:216:3e9a:89e with SMTP id d9443c01a7336-21c355b70ccmr503518985ad.35.1737709151226; Fri, 24 Jan 2025 00:59:11 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21da3ea3adesm11668875ad.74.2025.01.24.00.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:59:10 -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 12/15] cpufreq: dt: Set .set_boost directly Date: Fri, 24 Jan 2025 14:28:16 +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/cpufreq-dt.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 072ccf0c2e41..778916f89a51 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -114,20 +114,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = transition_latency; policy->dvfs_possible_from_any_cpu = true; - /* Support turbo/boost mode */ - if (policy_has_boost_freq(policy)) { - /* This gets disabled by core on driver unregister */ - ret = cpufreq_enable_boost_support(); - if (ret) - goto out_clk_put; - } - return 0; - -out_clk_put: - clk_put(cpu_clk); - - return ret; } static int cpufreq_online(struct cpufreq_policy *policy) @@ -162,6 +149,7 @@ static struct cpufreq_driver dt_cpufreq_driver = { .offline = cpufreq_offline, .register_em = cpufreq_register_em_with_opp, .name = "cpufreq-dt", + .set_boost = cpufreq_boost_set_sw, .suspend = cpufreq_generic_suspend, }; 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: 13949148 X-Patchwork-Delegate: viresh.linux@gmail.com 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:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 13949149 X-Patchwork-Delegate: viresh.linux@gmail.com 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 6807721ADA7 for ; Fri, 24 Jan 2025 08:59:19 +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=1737709160; cv=none; b=Sc0wVZsb6pUpstg1XXRGSdDOzKPpikOeGkM9ojBoCQQQrH6Likyw0ryOYefEdQrWgdXzPEmYzw4SBjuaV1IARYse4tjjOtOKdEq0hz7Kjw2VRxcSv7+Kz4Yt08Tat2NhZzvUVhfnZOnsmUciTUkr6JH6xQJNiUpw3qt5XySZqZ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709160; c=relaxed/simple; bh=/D0wEY8VdyUkeWsPm6hW6l3uuIlRBiW1w21cWrdjAPo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pC8/h8jWFxgQR8UhPE2pw6MMhE9GRbE6WC97S74sTur6sy6LT3VK+Nok5/s6dfAr/MW8yeitZKQfB4M9BEt0T/9hYdTBjfZacNDAvOZrOxzqFUqc3JUxJZGgl5xSQSIa4BJLP/dV0awQAjO6xFv5xBV0CM8stVWSqt/fWfSym6s= 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=xowX1gjQ; 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="xowX1gjQ" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2ee989553c1so3315854a91.3 for ; Fri, 24 Jan 2025 00:59:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737709158; x=1738313958; 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=VdfuIG9tkRoWMs45pN6MvWj7AvWDsc8epda9DxPI0Fs=; b=xowX1gjQC2USzCqyC9sXHS2mIvS1iUqz3q2G71awSOmHMTlNF7A2kX1xko/bLqbkVq JIWgoPGFV/9I6TiorK7+bSZmXCf2oCNTZ1ocAEPE8hCcu2TdUM8GJCGsAQtxVh5jt1Z2 nqSoyEouc7xZWYM8jBO5KOXdmYuyMb4In6C4YZx5LmZhEG0k+4gGin4GZsrsQS5pr3li sqato9av/vL5Cvfo5Cx6DZD0Tq42XqhByIvXds+SJVgZw76azpX8QDCsthWoPvl1SpUn on/K9xttlvyLHUiWGnn7qggwHadX4NpuGT//mLL3Dwjf2cTBscmufVdaWDLmkl/q0mVo EOcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737709159; x=1738313959; 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=VdfuIG9tkRoWMs45pN6MvWj7AvWDsc8epda9DxPI0Fs=; b=sJqDOBZXRmRh8dD3coBBe8AYJmrWP6vq5W3FE5QRcLeHHsjZib/FYGeCzr5Q2CXYxr 0958TdMS7KGvEGUtY6rrliAcKMSELPEWG/ksZAS4Gh4IysYMlu75kFT+P+Ti9EHEb/X4 St8B2JZCdWaOnBqQ/ThJuhOyz33y1142x4Ykn3Tx1MAkHy4J2qTTJJy7/+Ap7eS2cZEr 2RGcEq+vwrdh4MX9uw9QeM7sSWQHctSF31AduXGwcFBZns0na4ZcAbemiIaEYvvisFzj M+XHbYRvXGWxiekvWrIcmjUfYnebCFuoPN6hEqLkT/3CuWYLZerQJtbXyhO2TXKVz+XX YogA== X-Gm-Message-State: AOJu0YzEZ3qRZXCi+tNPbjIWbZBqbxNB2+tnEBXrh0B9pxFfIoh38Lgf TkYIE5K3PP+jtofjvCQwU38gg6mBFiTdZ6bOIQMRyE+QUFee7kazDS0nRPQmzy8= X-Gm-Gg: ASbGnctXOuqW5t57NzdE2hyASmRC2Z7NquHusD741ruI43mfle5o4tVakdMh/mm862m 8rzZDBIwOgzDc9Ok42be6F5uLHpE2I+Uwj/HVAanifODQIrRVPIG0VkkWJAgY5P8XazNFVoSUeA d7wy0CZRv78TWCnViBxXq1Wthym2dN94pbeOGFyBZubqct7QStwdC3TrcbhPTYYKeoK7ed4aeXq Q92+EH3Y7hkU0spWlY5gTLUE3sTATq2ARf5EIKL/jqhShMT5XaeK7na+c6QtvFQx4plZk4P3vRP eID/kGA= X-Google-Smtp-Source: AGHT+IFyETTLRpIP2DcDtY8Wno03W5rknQHs2W31kpnLpgPIWSJmax8BGf/jcQf027eMdfYyAmkCiw== X-Received: by 2002:a17:90b:4c06:b0:2ee:7862:1b10 with SMTP id 98e67ed59e1d1-2f782c701f7mr44177780a91.11.1737709158729; Fri, 24 Jan 2025 00:59:18 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f7ffaf80d1sm1246694a91.35.2025.01.24.00.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 00:59:18 -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 14/15] cpufreq: staticize policy_has_boost_freq() Date: Fri, 24 Jan 2025 14:28:18 +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 policy_has_boost_freq() isn't used outside of freq_table.c now, mark it static. Signed-off-by: Viresh Kumar --- drivers/cpufreq/freq_table.c | 3 +-- include/linux/cpufreq.h | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c index 185070052b41..c03a91502f84 100644 --- a/drivers/cpufreq/freq_table.c +++ b/drivers/cpufreq/freq_table.c @@ -14,7 +14,7 @@ * FREQUENCY TABLE HELPERS * *********************************************************************/ -bool policy_has_boost_freq(struct cpufreq_policy *policy) +static bool policy_has_boost_freq(struct cpufreq_policy *policy) { struct cpufreq_frequency_table *pos, *table = policy->freq_table; @@ -27,7 +27,6 @@ bool policy_has_boost_freq(struct cpufreq_policy *policy) return false; } -EXPORT_SYMBOL_GPL(policy_has_boost_freq); int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy, struct cpufreq_frequency_table *table) diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index b017af4398b9..466d186166da 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -783,7 +783,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); -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 */ @@ -1163,11 +1162,6 @@ static inline int cpufreq_enable_boost_support(void) return -EINVAL; } -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; 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: 13949150 X-Patchwork-Delegate: viresh.linux@gmail.com 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;