From nobody Sat May 9 09:14:53 2026 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 0D016219A94 for ; Fri, 24 Jan 2025 08:58:34 +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=1737709116; cv=none; b=SKg3NRpbn/x+l0YfXqefkeLd4zEANGfR5L2OJhaCjfzuDg7syH4yKoJYFY1brxMgap04uIkbzI/qRbp71oNTwrISos6vA762m+5PgpXPj3VzjlsGG9RMqQEItnB7HhJOV0jjgEcVvDH+x5Ixit2uCdDmE0tQ2UzDd5l/3tFU9h0= 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.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="DQ+vRevF" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2f441791e40so2659172a91.3 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=GIBxZZPD6OmN14r4hkvMQn2YM3HkEzv8DLZs4v5gMIAd/dO8mV+KwVC3xXVoaBlpQT T97OmEEzuw5MohCvi0Qb5Z6zUOjIFjuMY8CjQ1tTk9xBH9eBjFpIjntHzYmNSamsBKHg L78+32R/hz9Ll/WwiX8EpGXEjnk+8VAlVBRXFkXBpSMI1WbBehAcH1v5okJ5nswUV4hf NP1VFNTfVv7pL38Rir0mi4pjNbLPyPr0v+eYsook8wVQU3PjXZAhWyuPmLvVHUa17Nqq 8DfZiEFkTdKE/DCZm3pDD6WwFXGptvME1y23Lsn+7m+flRK02wvbZgd4Gs1ACCUxw/6f ndyQ== X-Forwarded-Encrypted: i=1; AJvYcCXE2gxTTQNrWNJ4s0I7ANscYuHefalqbdF0CTWKTJstzdg9NZfi8eLWaU1newrTTfKoikfoEO62XQSSbeI=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7thz+lP6/+hwAirH+HJfbzt3tLwn0ZqY6IwSnCG9c4y9ezjBy u0AGUTyY0jPGO7XCDmFBZw4OuhsZk9/WDaqekhfOTu9T2W9cFnJmSs/4aK4ljy0= X-Gm-Gg: ASbGnct0G7XcgwQqQB5fAuxGU+y9L+Nc4VjTEXjG/uQ2PRj9Eaeyl2SsCKrgjqaEC9J 1qbG0APPd9/6ZWlU9G1nFHkzn4faZ80P37FII23LPtY+2WWjqX8Nw0IEutk5yZ36g+cxpT9qMyv 2t82jT4TnEfHwZbniAw+BkLa1OIr1g4zqkc7rfVThLWAGl95R+IB8XgBZRO9N2YjZPfgA+w9tFw IvzVpbQK43dzjH3/gW9V/gGj95tXkkYthd4AejvsCghMyvgVjKCje+eZxhf6PxDeYIzT2aQescm bG6S1TU= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 *poli= cy, struct cpufreq_governor *new_gov, unsigned int new_pol); static bool cpufreq_boost_supported(void); +static int cpufreq_boost_trigger_state(int state); =20 /* * 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; } =20 -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_po= licy *policy, ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); =20 #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; --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 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 486ED21A427 for ; Fri, 24 Jan 2025 08:58:38 +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=1737709119; cv=none; b=G0SbrtfehgdLWuWc0QNzlruvRRky6PvY3JSbT12R6qLCYv+AUkf+oCrEyHQXXB8oz5iGjHxqQKrPCc4FbnbaMb7ptfYFV5AtmWIGiaaSpp+ReStJ0rbul1oyNTS0riB2kqhOXJrTnjY/e7mm5ljmk2mykIPs/zOkx2lxC1UYIpo= 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.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="Taddr+L4" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2167141dfa1so34201025ad.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=f9PJMT7OK5xih1NGCIXcRxMx2paFGw6lAkPQgB9B4Y6CwfAe7P29FoohScZ1hjOWIS LkWePPAifAmtiyKED5ycd5xICfYlZjRqvV1uWIvOQIwEzw0nACMsrOKzcBqx88aPux/n DeOtVJDhb9sp4QjdQKICtfZIWhCb2zM3B4+0rVe6s88DANYwT1nncmGeXsSZaajqct69 m0441/GqTjAIoeFKBpT8wxAqKd4MxjiV5gN9LsH8AnXS0rr2flAqNZbOhbVJBgbixdl4 8ibFweOhE0Xdu0I6OuwsFK71N62MHN1DakT4ZnEIEyiI4ntbYtuqMOH0Frbhzcua64AB OsVA== X-Forwarded-Encrypted: i=1; AJvYcCUF+cAJpkW5FbMPCanXCbjhlWPtNIhJpcQYfVY3JyObjVlK7dpbxgljK4QGxtUaPHxmR6GnUMLEzvBm+HM=@vger.kernel.org X-Gm-Message-State: AOJu0YxBTD/beXePolzIWR2Q4KYDyvrVGYdEEbvN5eP0W0sIvGeJjMN5 l7eExr+/4X2TUX/rDN5Z/3STUHcuJcQBN0Qoz65OnnUhqKfTh4xZKYkbg/Uz6is= X-Gm-Gg: ASbGncsqMgb8B/Nr14SYkohvoBPnnAVI9XwcS5txCNLTu4GieldDJfzhpyhr2dJrXal /wgzBizv6VLLBd8DcUPBQRojqoocSzcreB0QikDtwIMldhC9GyaqKxWa1lkKCVvqdPUBz6/JzyW bNnlkFNekEKfXnqfkUgEHO9A9x2vq3uNN/rP3BHljrbICTChzThU5MO6zUA63uaWZpdPdn56ury Mb+ZRi52XJ2nGErSEYuoR8tHkrEkUPxvqhGQCAGWdIum3NTiMD0I6DuFivyO1L5mT0tfgaB9S0G p1eXdjs= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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; =20 @@ -2805,6 +2805,7 @@ static int cpufreq_boost_set_sw(struct cpufreq_policy= *policy, int state) =20 return 0; } +EXPORT_SYMBOL_GPL(cpufreq_boost_set_sw); =20 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, c= har *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); =20 /* Find lowest freq at or above target in a table in ascending order */ static inline int cpufreq_table_find_index_al(struct cpufreq_policy *polic= y, @@ -1164,6 +1165,11 @@ static inline bool policy_has_boost_freq(struct cpuf= req_policy *policy) return false; } =20 +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) --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 B149E21A45B for ; Fri, 24 Jan 2025 08:58:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709123; cv=none; b=IUeywj3SmwwQhaRMid31LzIpLsqRNwvodkES2tXRivJM4RhpLzapQGjbnBz14Vkb2QoFKS6LeJASmgwpMevAUByBhpz9YzUcgMnvhvqHe7fzq2k7cIbK+NrDyLFWSeoVUZg9li1yT4lN8Utj/QV9/FYOmhp1y3E9ssJ9bUTdWgU= 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.180 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-f180.google.com with SMTP id d9443c01a7336-21644aca3a0so41391865ad.3 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=W9jfbJAJnNfqBEnR9WPbcnEK+rINaZ5B12WmtrpkPLRB2to0VqjBjUIl5xUUHJgmzn g7q011DvgM/mqA4MMILdjopAG2DKh6b7/BmH22ICpqyuBDNP9N7NfDloYHOem2jOBOdy ndkbH2gT6ryjD29+P7H6C+4RYZdyWPH3wgkW2P+hXJzC0VGJXZQI/YukD7FD9adDxToi AluhTiITMhxckGBhXzI4mSWRXCz+EwULppotkItTNxLWWxiUPBE9DcqM6/wnMq4mCxyH c2PxAOWw2HhgpM65/IH9dzMptU8lF5uCxIk1CfbC9VD6GDG6IpKlsv/rZwz2fiHXMgum AD3Q== X-Forwarded-Encrypted: i=1; AJvYcCXfTHLlswVYKwjoWQQTm6nZRmLzDiO1tgxSjxXEkGu0RbfRID9BySmIVjd462noHuCJ2x49YMPhKEBKb2A=@vger.kernel.org X-Gm-Message-State: AOJu0YxXLDkEtjAZljTOGVcyRrq3YPsCplc5FfIljcLqXLOye7UVteel q4K/bg72BQWyZWrHRHdDzdTE+dT7BX1DxqPHEwHUqVFjD3UDQ/TTteMUlpqmA6s= X-Gm-Gg: ASbGncvpxEKKKn+6BD9la+DoMc8dlDVbHP9LOduF1g78tSUf9mHx9rEsnN20q6Wzte0 pL22ibQV6/ycULk3U9uHaAuwTB3pyLi1fObBpVxQ4CvQYRC1m2lS14dCGaIPSdY1S/0bkzkL8e+ vLRUA9XRvXUpFuEKUrZ8qAnj4TGqo0CeJKMaqUKaZVptG4I4B6JpoBVIf2kPQZqwU4PX1jQQqZj pId1SqHd3U2HHfo1dC4Q6Y7aQIPUzedG0y0bOCHTwrJS4vbfgjN0E46FgmifSOkbky3r6GdrF/U Bj47Xzk= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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_pol= icy *policy) if (ret) return ret; =20 + /* Driver's may have set this field already */ + if (policy_has_boost_freq(policy)) + policy->boost_supported =3D true; + return set_freq_table_sorted(policy); } =20 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; =20 + /* 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; --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 CA3F121ADBC for ; Fri, 24 Jan 2025 08:58:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709126; cv=none; b=pDAzvJDpqUS0p4OUniMbM4jglzRZW853BXtqvmO8GQMHoMgI4tzM5qcsuhVFnEwQ9e8OodlZbVuyhQgLvSprJblmGaESOtERp7czonHrzDefn3zztVYOL+CKqcZYpl5FGL9swjWzGeTHGufPArrwkTTpOwxJaf8jSzW5LKhERF8= 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.169 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-f169.google.com with SMTP id d9443c01a7336-2164b1f05caso31541515ad.3 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=o5glXW4vgVwIpTc5usg7eOcYcS7IKOlmuUlPqcyw4eFM/vVtknkQrV2B5HoxrMytdq ax+m1puKtVJ2OIBUuue1nBRE9T8AtkGqSBdi9ZlGMFOuaAPRY+2vP8ev++Trw5LpsSi4 DPuouI+/J4Pz+F3wosNN73Y8n3tHpofhCMciZCUPZRYiLLgwYzUgWRVzDlrgrgWnCNbv pslXAKUpF7aBZmt8F42yXmDg75OscMSngQpIFJzfQito59xyBbZHRDfb9ASut/EGIItA RoomBc7EAW3ctWuuymv0rnBfg8ewyjTCERpGj7wNpPToAfBOUT8tju/hRZgwCl/BlTYz peCw== X-Forwarded-Encrypted: i=1; AJvYcCW3F8gceGriZ/rD8DNxsDlbfShwDokCEwJaJXT2QLoAYmIrtdI0vslg+EffL254Z5zyaHdedzyiwBWWnig=@vger.kernel.org X-Gm-Message-State: AOJu0YwAR76iSRlhUJOhIkRvaGV/C+QhImQgDaYo2xHaTAtiHnSPuzdV 5mRVgIhYsBGW2U02vBzTulnyerwaPbJLw/8irZlydBbv/q4cKG7+7ir/K1Sli0U= X-Gm-Gg: ASbGncvc89lyHOG7Dz1D5xPHcT4R5kMqY+ppoVc8FqLGWzioijdRpZjq1wmMBbg/qZt XS7qGiFunWkqU1RjIwWxWhvgOcw9aUDbrCj8tgsgh6UQQPNcS4JDmj6oFDkK+MH+6uCRF4Mab5H KOwPw9IUa5BntqoRiFuANRhb23P2Ezuvgxsm6fjdBTcTLt4mx2cXphp5CSb2AFZCno9Tuo5BmxX SAh1aYGrjpgfP6BV19vD1e3Rr4cbvAj5jxoF0SGPRZoIRKKTg3km25RjfIJ/cw13bnnr6raW0g1 EEfpqG8= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 !=3D freq_table[0].frequency) pr_warn(FW_WARN "P-state 0 is not max freq\n"); =20 + if (acpi_cpufreq_driver.set_boost) + policy->boost_supported =3D true; + return result; =20 err_unreg: --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 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 CFB4A21B196 for ; Fri, 24 Jan 2025 08:58:48 +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=1737709130; cv=none; b=aACbrnZV/XYs1Yy88YY9kK2tePfUvJtVoYDGElENGWXszoWozcLgkv9vmdsyfw8o8OrdfvLkJoMbp1kVed4rr+8I5D66e1/pvjojHxYZdcsc+MHzpwxogtcf/KnQRZBxb8OkdDZPhE7J6yuTYFARA7BV0+39cgwN1VfRMewZnrY= 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.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="WdFB/YXQ" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2ee46851b5eso2633431a91.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=Twrmn5FdIizD90un/AcMYQTi42C+1KwfhVTqF9G3qJW5JFlOskJFMzksYHZosFJzf7 I43HICLFc860GVicnhYEe16+Ts4X9K4XvzCgYXdANwNPJtDURCC6+0w7mEWNlevBHp/+ NOeHu/tawMJc9o4lH62u/DVurMPT/JxSvU/9luxVSaHGrmZmAlw1XDHiKwXW6ptcdkUV htmK3FyMuZJHpMVkb/c3/cB3+KU4UjdqOWxRd7aYIqCSiaqkCCzeQqbqqz9A4mVj/l4g qlwGUVQaCUJXH8oVkBm1riZqFIoHpl8y64pmX+HVoQ/Ww0yoGjjGPB+niQVLL5Xmw7mi R9PQ== X-Forwarded-Encrypted: i=1; AJvYcCUHhnS0nUv1Vj3WmBt9Bs6ZsyIzMjCGgX1T3mH9TjnjYlHgo5TbvOM8k646amtqcGMRBEivQMLr/HS427E=@vger.kernel.org X-Gm-Message-State: AOJu0YwRV9VV/EBqK+VQTp/ojfP+GIOBHGV+0wgprttLairKN6K0v3Yw z1MdnS4vGhaasaV7zKIO3JBd7Q3ytTXsgRua4l1UweM3MQEC3eH2uU2FFkaz4Ss= X-Gm-Gg: ASbGncs+4TnKY6JWToLn2J9bovRvxAvFi5vmsZXvqOOUQHHy2NWIP3jFJ7EzKFwWPBP t3oq+06C+joAX8bniXULhxiEtXlREDV2a8y7g1bwRl4dI0PeiP/vwc2vgeETk7WjuX1Ws3W/NyM lJPAaD+NaYayKXeAvPdyP5e0BAzRBDKwagHIiwvtBwei1QT3+TfgRsPFzKmT52iXDxs+SUG7MH+ lX0OifEUaWvasrIXp3i3trUF1duzAcIx1oxme1m9/rxjgjVZiRq4DPenbBn9VvrD2JnzTy+ZajX Rui/LRg= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 *p= olicy) policy->cpuinfo.min_freq =3D min_freq; policy->cpuinfo.max_freq =3D max_freq; =20 - policy->boost_enabled =3D READ_ONCE(cpudata->boost_supported); + policy->boost_supported =3D READ_ONCE(cpudata->boost_supported); =20 /* It will be updated by governor */ policy->cur =3D policy->cpuinfo.min_freq; @@ -1480,7 +1480,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_pol= icy *policy) policy->min =3D policy->cpuinfo.min_freq; policy->max =3D policy->cpuinfo.max_freq; =20 - policy->boost_enabled =3D READ_ONCE(cpudata->boost_supported); + policy->boost_supported =3D READ_ONCE(cpudata->boost_supported); =20 /* * Set the policy to provide a valid fallback value in case --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 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 7B68121B1BC for ; Fri, 24 Jan 2025 08:58:52 +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=1737709134; cv=none; b=k+H11ziDD3NKPaWW+Qbj/omqH1jUWOM0Jww3VbqtOBYnWoGbQTpyE5lxB7Cpp6X734sTqJpG6SSbQCwFdWd3UlZVLeRTWY0nKdg/Klr6hMK4dNutbMY+ycLjmIYW+VdpnywcCwBZsgiVuX+nf75i5D13T/uTXe7WDTXGavIDhsI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709134; c=relaxed/simple; bh=bXRFxc8mF6V5TgGKJMgWIksw91YHqbMB+UstyP1aTGA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Q8wjT+Dp6+J6sw0LkovWJHunVFWzLmzLqdxghh7OWii06YuCwNjvObJXNPrOUUdv/3ATiP8/TBWOqBrTyTf6Q+xQwoQdseOItb3ahwKHn1sgB3BjH63S29EX+ZuS52E4qHVfjQvYWIvGF5a/FPNF5RZeORe+Swff1CzofgCX/78= 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.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="GxOkKQCm" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-21628b3fe7dso31758075ad.3 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=Zjvu30QZm20U4wyJcfY+VpRTIN32VUuUqzxCIX/guoy22pRKryaA0otgmKFsKHf7ra Ywt0vBwPtpjeSr1tMJrURNtZ1h6T6/4VWHG1JI4Cbs1whEBytGpXQ/C5Yfj8mhUqwxjk hNu35np8FVmX2Saz1NJz6/LuveCzEP00Cc2J805UFhyby8q/2a8Eawo/pxBFSA05Km8r SuYzTUogirha/cmJKuyXGcEKAqiCuLrFRcTIkebZQEBj3BpoIErxvQYjvU88811qlcGE JQBm78PXFoe/t1EYi4Zv1JiuUcpHvdql5za3i3Vh6E356RL5qnb1+at2ecs2RBGnLWBA zDWQ== X-Forwarded-Encrypted: i=1; AJvYcCWUJ6J/ScihL2tw4OobzriqTK9FtkgSjUZl702GQD9veuEZl4+UPiX8R0ArPrDthpcU/fOmdWoHTHV6HYY=@vger.kernel.org X-Gm-Message-State: AOJu0Ywqkxhai2mid6JN0y2/4rHBDK0J/Y+Ex5G+CyPMH2QLQ685gnJf 9IbSozM3QmlMfUU0o/QI7POBwfM0DJ7YvbdEKq60k4eTQ3KLGjQiKUXOY2A/TZ0= X-Gm-Gg: ASbGncsUDr6v5FBLL0wfq+1TBd49T1DUa/essqiVSdzjlA76ynRkhjow1ZTuITkb0aC Y6vTrPyPPog8gPrJ/oyBvC80HVjJEAo0XsxCCm2c2zfroLCdURXCgnC1lJaNJph9itymqPykg/M PImIMyjPEYcW7XJTe+ncx8iu89TXDnMEa+Iq0ZD2CbhjoP9Tq5em2AXgAXU5DizSFUXZPHweTjt ems6hIvfcs+S01yt3dMH2ndCcSYci6gGJDAv/E9klAZm19LoLxR2L815AyLYbb5PAoXko/CQd1p mwr15fY= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Lifeng Zheng --- 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); =20 -static bool boost_supported; - static struct cpufreq_driver cppc_cpufreq_driver; =20 #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 =3D true; + policy->boost_supported =3D true; =20 /* Set policy->cur to max now. The governors will adjust later. */ policy->cur =3D cppc_perf_to_khz(caps, caps->highest_perf); @@ -791,11 +789,6 @@ static int cppc_cpufreq_set_boost(struct cpufreq_polic= y *policy, int state) struct cppc_perf_caps *caps =3D &cpu_data->perf_caps; int ret; =20 - if (!boost_supported) { - pr_err("BOOST not supported by CPU or firmware\n"); - return -EINVAL; - } - if (state) policy->max =3D cppc_perf_to_khz(caps, caps->highest_perf); else --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 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 9E55621A421 for ; Fri, 24 Jan 2025 08:58:55 +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=1737709137; cv=none; b=aw0SzkPeU8UHKRFX4ljjrEvRAZQdhbLAe0bD3u/YdNycjYWhyOSJnxo1PduU4NX2Sa8XneW2AkimcEp4BqEtAL7246Z8GTC4Aa5BfQiTTFCtJMDGLPiLLxhnW+wwV0YLBAy5NHHTxeSQD8NKXtqm9DtdG1TLUKG9o/o81qvKSec= 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.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="QI0CqMVg" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-21649a7bcdcso31998595ad.1 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=YPHY0jQu0NrRl72QOhxEIA85qvL+ksR8MNqC5bHQLwaWCAjOZyvYcDkq/pT0Sffw24 eTxP5MsjgbQq1oiGacVez48pQ80wOadne5NH6IgS37QPQY+oEUmFFU/4aZG5628oj0lg yeb6Mj/9uA1sqrpaymh7pIgVcHaXvFq/HEuRoiz/99/UpvALmdvs6wRx2/gEB/vYw/Hy 8945sT/fNsyrAXaqPCUmAoqogXStS26fZHe6pkBbAAjgrtgug4d/YinycmHmEuxG0464 zR/bMT0stTNdA6k6DltKvu2vn8cOVMavH1I3w2Xi3ZryKxUZWXpzOcTLQr7QlF6N/Thb VHrw== X-Forwarded-Encrypted: i=1; AJvYcCVV9Ekgc/qo7N8+uW7CMqviHsdABKFM0vp8xs7K3Ci0dLErUKwwBuhsni5pB469fAwdemSdEiOpbcdglVE=@vger.kernel.org X-Gm-Message-State: AOJu0YxZcVRbbAJ8FjJtvBrp/fSgDNwXSYD30K3gJCZLiJ5YCfjKUU+H WuOUD9s21e/reraKk2D4XFULgmxjopVFDx41VX9g57T7k4yT2BSDlxLZwzoyHuc= X-Gm-Gg: ASbGncvBwDh45uZAAyRK+n/09hE7ikRDrC0nM3mLNu1hPADiRCUpvuUKDw9V4pnlDBX 38Sy5NB8NBH4MBkmJizftBtOlooovf9WhZ+R1gAqjzKqdcUA5gyxy83jDkxuEzJoIsnmRxKl53K sAb+Tl8q3hHfgavWOGTEVFuGQY5uel09UFnKbnURLbyR27H0ShwS64LwT7tMpY0/U7fUFriDwjE jJeAbqnMSrG/pK0m3ahdQ484ZqVxKvIAnDLVGgN5rxgy3jieeFRkiddzDR9WTWgrmTQ1z5HyuCr 2zIdEAA= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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; =20 + if (!policy->boost_supported) + return -EINVAL; + if (policy->boost_enabled =3D=3D enable) return count; =20 @@ -1586,7 +1589,8 @@ static int cpufreq_online(unsigned int cpu) policy->cdev =3D of_cpufreq_cooling_register(policy); =20 /* Let the per-policy boost flag mirror the cpufreq_driver boost during i= nit */ - if (policy->boost_enabled !=3D cpufreq_boost_enabled()) { + if (policy->boost_supported && + policy->boost_enabled !=3D cpufreq_boost_enabled()) { policy->boost_enabled =3D cpufreq_boost_enabled(); ret =3D cpufreq_driver->set_boost(policy, policy->boost_enabled); if (ret) { @@ -2822,6 +2826,9 @@ static int cpufreq_boost_trigger_state(int state) =20 cpus_read_lock(); for_each_active_policy(policy) { + if (!policy->boost_supported) + continue; + policy->boost_enabled =3D state; ret =3D cpufreq_driver->set_boost(policy, state); if (ret) { --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0742C21C174 for ; Fri, 24 Jan 2025 08:58:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709140; cv=none; b=I5OfXjJc9776mJyAqV03jnaLWdkl5rxK7x6nauFXnJn4RztCMK52030dvRA2E/FjMM1lCqRN8AMWh1LdEA4zpljH+ti8Mg4WqjBPtCLWTVyUG3eSgVLbdM+MHaj3jSpjGvZmt1hoOnqjwLx7sCBKzqBh1gBovBGD+uTB0H5UxtY= 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.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zBph0jhM" Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-2ee76befe58so3372522a91.2 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=qjDmkDWvNC6EXNQ2d7JeK8pWuSIfzhz44EHZk1xZoj0LbujNT842ZNtifvSPVPN3nM AaS4dTHTFBnnQlljZp9pq/qqNQvk0v3F/PLT717Xb4V3LSyV/nPyA2Ct9/hdGFxJ/48Q 28DMy4b4f49rLeCSRbGtReShbt2KSshQ+l/524KZRZiHixpodv3D0ZjnmaBsj72KVMzG cQ8NbXZ8+k9wANkcK3itSki/N80LoOPoRcNnwZOtNtZckwCOgcV1W3W5rzq89L5Qnc0d Z1vaZc4bP+c9ggA9cOomzmHQ7LOvsWFdlynR9mq52GmLHSWFryUFPxTyEyyzs//rI2bc e43A== X-Forwarded-Encrypted: i=1; AJvYcCWpLDaWILJkZ8Oq1hUkZJCVTMCL93HmAgyIJhFsqKqH9b4clWKPeXYZ3C0zvP6sG/RdA2iUM27Hd2kOimM=@vger.kernel.org X-Gm-Message-State: AOJu0YxrhQeRrLH45+h7OTBiI8zY4F4kRA/8vwxjMuEJycqL8D59ufrV e+YW+ZF0M3r9+bShk2TJ56YFxQYuMN6vNvz0FD7whVuaOs2/u5EsYqBTfrCSZkw= X-Gm-Gg: ASbGncv+q6B9kB58jVKFaN5U+zwf1Mu24o0DprP740okWvxpxaLTYLCCxS5kSeJrtWz aJ9x0Fcx83jIvZiU5aqhkWoSjhA4waW+XRnKql++wYxQXhHyfTl13MtdZcRcH/kOhg0e9aAJuym BZgzbc+jjHYruQ1xoZ27GlF5O4LLVFTpfjDZ11PxBzpl+cdzNUKVnJHdMNfRCH416P2U68N5Qlt fSo3XCpmwotO7mAtXbuz9Z5vjIkn2Z966WujoPqbHsS+QdBiFHg2jv0QF9cqvMx1+OygkB2MxUd 4ySHnhI= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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-so= c-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_polic= y *policy) policy->fast_switch_possible =3D true; policy->suspend_freq =3D freq_table[0].frequency; =20 - if (policy_has_boost_freq(policy)) { - ret =3D cpufreq_enable_boost_support(); - if (ret) { - dev_warn(cpu_dev, "failed to enable boost: %d\n", ret); - } else { - apple_soc_cpufreq_driver.boost_enabled =3D true; - } - } - return 0; =20 out_free_cpufreq_table: @@ -353,6 +344,7 @@ static struct cpufreq_driver apple_soc_cpufreq_driver = =3D { .target_index =3D apple_soc_cpufreq_set_target, .fast_switch =3D apple_soc_cpufreq_fast_switch, .register_em =3D cpufreq_register_em_with_opp, + .set_boost =3D cpufreq_boost_set_sw, .suspend =3D cpufreq_generic_suspend, }; =20 --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 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 A8BD721C197 for ; Fri, 24 Jan 2025 08:59:03 +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=1737709145; cv=none; b=WBei8S4v9S4Z/0+10cWWpNvfjaekRDG5fy/XxjwawMVKQ2gcI12orlpO9kkzK9eGHIY6wEl7pwDFpDwnfv+pcnTEQlSZ5ILtDbrXAsb30W6hduaYwZM5GiekyGJCCDjOPqHkre29O3V4skDAn8Ttk00wnzFOq5qwEwQXqIH70r0= 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.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="xGlxnFQS" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-21628b3fe7dso31760995ad.3 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=TMYo2nVgZQPo5Heb0/56QQPK6gZC0rT1vQIUWFjfbC5qOeWuxv4q4+awtRrG+dYxLd n7u9XOX/Q/fwdMmRXeXod+x8WxIs9t8wAo2n/xeBOjLxqMRRrUSObsjQALq5WW0IkKLw O1VNe8M5GacxRCsf+VLgnZBTSNyPCFpOn9+oxJrUAZ9UkdEWF1zJu+7aRViASGeOUNoX 5WRRZqxdi9tYKV3Hx/RvDuas6jTbsPnFU3yvRThS0Bdp6j5LCGQ177VP67WkBkrryDHf mMI/QxhVj1xSvHcbqxXWyvW457AXgbPwhlbzrdIjxv0okw3kIAypnCKCSYXkN5+35+nH 02Vg== X-Forwarded-Encrypted: i=1; AJvYcCWGOZn4N2vbtClnFOtksaK9pNqwx91bzhb7Lc+RZ88rslNUIdxwYuOWh6lL8V2xDmkEAIJJ9fxSRqWhlXE=@vger.kernel.org X-Gm-Message-State: AOJu0YxWv7BaNJDs935WxOlqYH9zzZ8K1hDDBq2ctV8iC1AJaP5jOtAM SJ01nO3akxrkxNzV2rv6XLiSPOUpQ2i+BYST+JnX722enM96kVbAobVQJlJh0qw= X-Gm-Gg: ASbGncuxJ1XTDN2PPT70l1HglRU4p08mo1tIDgKfp0eXFBxl0RCYGKOY9xdF9jJZQvV zN3YdL/mK6oSDfwrJxuZCrOPlDH1X/HBHFMuD6IORVQtB+pio+3e1H8Blgwwj1tIjPz/RpH9UEt 59xgSaKOHioI1RRqWYz1e3G6y+LuF3R+KzVU0Q5PDGflC3n0I20cD0YjGMz1b7EZbKn/vLtrz0Z o7gCErjoBxHAg3tYsaT6yKiPbXLP7h3dsJkqq56owRWsJ4DJxW2zJYDbMHwwDsTB33HKGpUUM5H zajttr8= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/loongson= 3_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_p= olicy *policy) per_cpu(freq_data, i) =3D per_cpu(freq_data, cpu); } =20 - if (policy_has_boost_freq(policy)) { - ret =3D cpufreq_enable_boost_support(); - if (ret < 0) { - pr_warn("cpufreq: Failed to enable boost: %d\n", ret); - return ret; - } - loongson3_cpufreq_driver.boost_enabled =3D true; - } - return 0; } =20 @@ -338,6 +329,7 @@ static struct cpufreq_driver loongson3_cpufreq_driver = =3D { .get =3D loongson3_cpufreq_get, .target_index =3D loongson3_cpufreq_target, .verify =3D cpufreq_generic_frequency_table_verify, + .set_boost =3D cpufreq_boost_set_sw, .suspend =3D cpufreq_generic_suspend, }; =20 --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 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 7483621A44B for ; Fri, 24 Jan 2025 08:59:05 +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=1737709146; cv=none; b=sUGsV8hlmJTQjScSUwR0Y5shNP4HtGOSEcWWyISJmJWdyBVzNe8Wu9ojn+Mfyw+AuDLcRa0Qr7DMOFWT/MfpcHWlLyUDGoPjElmQsFIJHWi7c5H021Wiut4WzL8EVaPEVA+B1zsSJAdPf/UwDVDRXWGGh0xa/KK9Ulhsjc6mDjw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709146; c=relaxed/simple; bh=3/ztBZ/HEPa/0k8R9f3RWIpWad4EPbBsiTzjR0GmEsc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nAGH/SFu9fVApdqN25KAkz67XEF6NswK4/JRd1Vmtnc77pjNYTcAMWAwaOGAzh7Bc/+MjHpZlJzwIHjBwhFfKHJLgwq+1W5WtghZ1Fwh0NKUwUBu/S4NZ2ilh9cm7roKMBV9mP+iKsuEKTjlrC36qFwJL+jiTziECWnwII53LmQ= 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.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="dCqrEGVm" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2f441791e40so2659591a91.3 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=lOYSTTzlvafCIFhzmicrOeXjtmyaLXf37HKE3eVL7Sy/nz8EPCIrfet4d3QFJuOxa+ PDsIft5lJ/2J3swqOIEU4DHChV7xPrg2VoJ6QurqJofvpESvts0OytbpW21b41WsUNm9 +Lt/ZqmPfEI72v2tqQv7xtxS5FAGXdQcJQ4eqGx9UQCgPjii8TgTocRWk4fWxCBOtPyU 92DwFeoDLyGl6LtVxuBsZmEUMxbSA2NslYFr3Uh19bjG51taag/cZtL/FRzAoIUBr5Lf +tVQpzBa7xBwBSIk6r3LivPF27yq7j/3KkTA3QVXW9KQH4waJbudHzy5N+/wjDcn7A4J ZZyA== X-Forwarded-Encrypted: i=1; AJvYcCW7PaF3/G7dsS/bVcLxadKT+cTa9yUUzOmy+5/irYD4vaLl40ZBF5CEtyoz+cHfIYHQsDG8XIObh3Yjsdk=@vger.kernel.org X-Gm-Message-State: AOJu0Yy84tyJUClsvJAMRBC5QuQQa/OGQisMlVQiq/o0RP+bKMglprME 6vXCtaC5Eb+rDN1mHC1RsTbbXZbNBvHlumzalHNRj1/6lxbaqHKq0U+ZUvudTY4= X-Gm-Gg: ASbGncsOOPo/8XkGlzzC5zAdrGl9wquXf2/ZavHpmSCH8ZXxFtuwOhtYD1fYZvrT5DO zhclYboDrSiJymXEVwZCHLO+7UmBt7nkWnD9Nd6kWX9uC5zyYeQ4Kb+eOwW7bOThPRO25D64jjy j984WOLSeQatPHRgQxiwXsOaxQMaf5d1OO7W7jkK6pXaE/f2Mk7+WzvbF25/NkceDuxDiOWblM/ jETlPNXfx20b8glrb5/6tSR8e/Fka37h9Q9fieto/4SE6WyNDkYwIVFkaB66xQZFfFmQbXP/q5D 1L54L3o= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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-cp= ufreq.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; =20 if (powernv_pstate_info.wof_enabled) - powernv_cpufreq_driver.boost_enabled =3D true; + powernv_cpufreq_driver.set_boost =3D cpufreq_boost_set_sw; else powernv_cpu_freq_attr[SCALING_BOOST_FREQS_ATTR_INDEX] =3D NULL; =20 @@ -1135,9 +1135,6 @@ static int __init powernv_cpufreq_init(void) goto cleanup; } =20 - 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); =20 --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 B99C121C9FD for ; Fri, 24 Jan 2025 08:59:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709150; cv=none; b=W/CTH6QN6DudsgAs4XU7Zq9tZuUyHa152M10LvHntEcWvE/8t55bARr9Lxj9UNjxjuql1zdKMh0//OJkOSd5fqrh7dlY6RwsI/Lynr4cPgk+9sJckahYNzbvgKIxWNkQiuZ423FHkGQEOqdKjNUVrSTjAX4CdU9ChzsckzEh9dk= 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.174 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-f174.google.com with SMTP id d9443c01a7336-2164b662090so35958515ad.1 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=NhQlSay/0Bwxx4sU444c4b/cCQDPeuvIedVDspElwbfqbKfNGuWwZSp2db3QYhApRY iFUD1jjVnghXljTaOqdqu4OXQ+obLe79gO5WHkpRKaO5fqHKyO+NROyMquzo8s+Q0bYY u4pyCi44E6TJ8yHPwuBYvizY7r+Kiz2OOyanBNqKixt3AP35oos3Sk10OZRDZ0gRIkDb JyISUrVJJHIObwK6Uc/hy8Klrnv5Kw0rHjTPtwHDIOpEhPtcbH2r54JWIvyWOIGYC/vN /uZLvDinOp5hHUjabN5nPEn0IEcWUJC/uAtEiVgWJORS9Jjsnn7pQbv3u9NPqP8dtD7L 8SNg== X-Forwarded-Encrypted: i=1; AJvYcCVLzzLlWxcvoRNNCf6qFKm9NXU+zppKOxtQhvrebgGj3a65EuFyq0orokozxlP+5dj5c17t3FqRq2hRh6E=@vger.kernel.org X-Gm-Message-State: AOJu0YwglJdj1X4pSytD9wh0S5/CGqKGaIf8Rau9Wu6MUhVkf4fYRGZN /NRoF8GurrYbVbaJGQzGBtaYSaUdl7byq8k5U3139Hrhp2NSJcGagM8E7MkehxQ= X-Gm-Gg: ASbGncuU5oDdLTTLuDqu35PZ3vITmWBi03h18QQR0y1mr3uZkhY//NxFVOAQ5fUm7kt +qN5QQdmeVn99qCgwzcXVkOVOH3kMBRS0KZ69XKeRgTqwoGUb9d+FNfDm42AAqUu5YMhW/uXX7M MEQRKYH39ZE9nfRMpYvnvI2b7Tb3klD9pvFuIYyOCazxtHG4BjrgWVc2jLnOVQclMZIh3Im95LS 8RbF4x/8yCTveTCxSSOLLxvQbdoZRRIDSJ/O33zjNpWof97SVKXV0NO8hqLiqzF5/oLzfUtexNx EbMlK6c= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 *po= licy) policy->transition_delay_us =3D scmi_get_rate_limit(domain, policy->fast_switch_possible); =20 - if (policy_has_boost_freq(policy)) { - ret =3D 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 =3D true; - } - } - ret =3D 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 =3D { .init =3D scmi_cpufreq_init, .exit =3D scmi_cpufreq_exit, .register_em =3D scmi_cpufreq_register_em, + .set_boost =3D cpufreq_boost_set_sw, }; =20 static int scmi_cpufreq_probe(struct scmi_device *sdev) --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 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 EE24C219A73 for ; Fri, 24 Jan 2025 08:59:11 +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=1737709153; cv=none; b=K+4IAUXzeEggLhqMyaKWC7+z9MGNLthyqjo5wuNudBX08aIdMZbP/datpAuUuCw86c3YpvJZydHoYSTmniOGuM0WeFP6dedFXelu6i0MecF1czWB7KcW9OfN2kvd0+LrrQu1kCJdp11sDV6VT7dPt2kr56lxwhb3fUohDbNjZx8= 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.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="vMXJxbCw" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-21654fdd5daso31437485ad.1 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=kboqMUGzFClqWklyp6FshcuQcnayPjgxFeoljPQCObvnllOBOcdRazStJK1obvFR2Q QzrCY6LrLrhTXObHC7OEb2POUWnpTRWWhZBLsof2jqiN4bUvLlzJ4uXFmyeD7Y/HXCht cffQNtmXSE9dLCI0Ty7lFsdAbFeDLdNTBUveo/HVYxatTQ9c2ePt7H9ywgCsmlF85Kbh lSfvzwjm+ximtJCelk7YUwUU65fdWgynXcq4lLELQEZlhNHzEWkRMiiKTrqusANPTvOD jPyJloNUUgVF/sa1aD19oFJtCcISCRoJqjhecsjvPkBTLg7F+dQXYogarkjhCHyiC8WF enjQ== X-Forwarded-Encrypted: i=1; AJvYcCWUrkSbTkeotIdGvn6dfTPbcF7a0EjPNmg3QAFwVKw3ceA80T8RbY7S69pgOpC1CyBJZ0TnaYQ37gbI6vY=@vger.kernel.org X-Gm-Message-State: AOJu0YxkW4g+HCVT/Cnu2kDbSYEp6J3LIpgRUv2PQhgpe/Tp3EVeXdJW gv4OZMcQI4QJ/Me7VVLq8iyOjfmutz7h6KIVPtn2gn9Te+dxrqkGPMWqQBv3Qio= X-Gm-Gg: ASbGncuNSCtAoynV1M7CBMmGr3KRsyhKaQYxuOUz3MIkF4qgd91yzHMCwz2elkkkPVQ B4xrM3SwBowlRdmYisXgOgq5HdH8SrQa/Sm8E4Grj4HkGPsv3Jo2Mhw1HAYJrw8ejdJLFBdkQcq 6o5yhSdlpKaNwpdWiWcRmFw78b7s7bC8K0CTdRY74Ao/7lKopglvlcDffOG7KIByoNMnD5zNmqS daFV7bhZrikeGcwKcQIOr+GkWEQcqiIi3vyJDW8esW2+YSYB4L659ceRPV5RYhlC9Oi33DIrzG3 QVBLYlc= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D transition_latency; policy->dvfs_possible_from_any_cpu =3D true; =20 - /* Support turbo/boost mode */ - if (policy_has_boost_freq(policy)) { - /* This gets disabled by core on driver unregister */ - ret =3D cpufreq_enable_boost_support(); - if (ret) - goto out_clk_put; - } - return 0; - -out_clk_put: - clk_put(cpu_clk); - - return ret; } =20 static int cpufreq_online(struct cpufreq_policy *policy) @@ -162,6 +149,7 @@ static struct cpufreq_driver dt_cpufreq_driver =3D { .offline =3D cpufreq_offline, .register_em =3D cpufreq_register_em_with_opp, .name =3D "cpufreq-dt", + .set_boost =3D cpufreq_boost_set_sw, .suspend =3D cpufreq_generic_suspend, }; =20 --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 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 0C07221CFFB for ; Fri, 24 Jan 2025 08:59:15 +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=1737709157; cv=none; b=ZtRwUiWUeedZtZuhbteN8ISrIyeTj+MFO3OuMcaGrZgBK7LAYP3sE34NFeRwBa2BpKSqWfx1kU1kBhkFsu7WjEdRLn8ZQmpPA2CfEue7NdOk/rL7GRKdQA8Y3wiTSAl4TDZwdNVnaeHxxc/XItDkk7CrD5j2VpeId9+c8KWnsX4= 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.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="qFutLe9o" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-21a7ed0155cso31503385ad.3 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=G7euZEd8akhCVjPZP2oioyV1wz373usgai8vXCw0iDmW7cXMqnbw/8NwYTrg/FErpj W5rhSGycKJx7krrj347cVaDn9UtVXbAvYI39BAYISXtDbHmxhRI88YcsQ4+c1qwiEB6Q t2BBLYuOTC/nuRpW2IbV0B0HgK539R7bM+2w2qzJd5MU1KIcfEmjxaVH7gvJSSaSUXIR YOgtb02LASq2N4fKbO50uY3HlcYgAEwV++PlQXVfWmFJzEV/sWprfNq9HqzfPwbqW7xE NgiKefBzlSk8F9H93QG9Zdq9IO9oEm5SwXPWplqJx7Y+iP21rcjhS3SuTZ4RwbzyG1Pv ctJg== X-Forwarded-Encrypted: i=1; AJvYcCUkWYhQ1J+80QIfemBcE7H4foPgAVwK3eyE2A+S5OFSsTZ4HFz7KOZSe8H3dN/08nj+iJu4iHCfcL+RNSU=@vger.kernel.org X-Gm-Message-State: AOJu0YywRfMcCQKDgY0Mcb1X7E+qb+SzymhD58GZHBHvruUyH1mm5e2W ULAdGsa0BfWMp/YuGSEgOmQSHpaEsJMrjqqE3dtZk9HdjstIAxrat2JJzSq6xY8= X-Gm-Gg: ASbGncunJksGCSNKA8GRQPE97LIEborAbAXr/qHUeikYIbmesezjeFish51XdC4W7oZ eiv49/G42JXyrj7TaYIKCizrSmVAJ9ot8f3U3pE9s/K4Y/6ka87cw2WHokTVd1fkXxKcDM1ejCA 2jn1j63fDutmLobBE2kPHMNGH4Z83Ovpvhvjj4E+6DJadTSlEbq7wa7l6VGSK1K018NqYVgQcV5 bXqExnJOb4HLqULSn8NZW2Y/QioA9mF7wvygMzzi5+s9jBQXxRS4/fFWSj6s6JmTrNPhTieBns6 Z6jvCz/eZrYgPMIgiQ== 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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-cpufr= eq-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_pol= icy *policy) return -ENODEV; } =20 - if (policy_has_boost_freq(policy)) { - ret =3D 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); } =20 @@ -610,6 +604,7 @@ static struct cpufreq_driver cpufreq_qcom_hw_driver =3D= { .fast_switch =3D qcom_cpufreq_hw_fast_switch, .name =3D "qcom-cpufreq-hw", .ready =3D qcom_cpufreq_ready, + .set_boost =3D cpufreq_boost_set_sw, }; =20 static unsigned long qcom_cpufreq_hw_recalc_rate(struct clk_hw *hw, unsign= ed long parent_rate) --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 46D77219A73 for ; Fri, 24 Jan 2025 08:59:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709160; cv=none; b=bzEyQ00O5uNl3Q/CmGwyRPMg1WImXWLTlbf3rfL6M9OJvsjXY+xMXgQfsqaiLE4oWKGcMqKSOx97As/4Z7XO0i0O07la2l4gfrCaMudG0hWrEltnZYQaofvEw2CTJ2AK0L5bwWBs6fMIWjh5h+bqx7HO0f8FZavOOB2heoxez/s= 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.53 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-f53.google.com with SMTP id 98e67ed59e1d1-2ef760a1001so3355273a91.0 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=i1ho+uD3t9y/0asITq2KGenwH0W1jaWL0u92siTFgvdhLNP8vQIIwOGCcgtkQxG7u4 kDrKx8bZ9s2+EogVa22Ax5gh159JfYez+ideqQ6C6tUDX6mBr5r7Q8HDlhzX/rMszHs6 kIjS9dSlB4xhaVT64IK/IeeaFRDsaGZTsrlm900JHHAxK7UJU9qCNdAOkKnAx/jWfAdR BFKNZGx7fbztlIqWMc0s14PCUPC6BNYaRzsapIkgAWuIjekPcwEPUfWaQHjz0AWlgZwz CVazThYMWAPdeMqiCXz8za2ZnmRHZEoqcSdwT3JtPyQaeyZmpW7IopQk8bdh9qFrOwB2 NGPw== X-Forwarded-Encrypted: i=1; AJvYcCXkVXY6/HiXfV3Q3ES54OAzsbZ1ixSAoxjyOC8yWSuKfN1ZclDzqeV5bVwTtShF6p3IdcXrq0QF4zTuoJA=@vger.kernel.org X-Gm-Message-State: AOJu0YySCJVERwG8SyGkwDqlr0ZMmsvG/BgZrbRsT4bY66mIzrBncQnL wfDpgYd5kFjAsCMPZaV7BDohVLy4xLS2YEs7k1A2gsf76LmYjPG+K+w4OZhDEZY= X-Gm-Gg: ASbGncuNPyt27ZVEtOK/xm9CPbeKE1r5AQAHvmg4HTKAmvJMvXMMh/CmbGwhc3rwqSw yyM9eSoniyyAtj9ksGmdO5+9ci+othoR8qBPRLoh0Tj7j4Wja8feuvGW+Wkw8/60KWvm4py69D6 5mTlzkub79KM7XMnJbD3kvpMKrXHof4dDMzOTbrCMK+SG4xSdxwchFYOi+A4UrCJAo4XuZnhWwl wFrW10ibYXPls2GKiFllwCivq9Fz6YQKaCnIXCcce18KGTPTUmDJoRenUvmt+SJuLuTjIGvN5/9 EWVqEzo= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 * *********************************************************************/ =20 -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 =3D policy->freq_table; =20 @@ -27,7 +27,6 @@ bool policy_has_boost_freq(struct cpufreq_policy *policy) =20 return false; } -EXPORT_SYMBOL_GPL(policy_has_boost_freq); =20 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, c= har *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); =20 /* 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; } =20 -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; --=20 2.31.1.272.g89b43f80a514 From nobody Sat May 9 09:14:53 2026 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 C9DE321D598 for ; Fri, 24 Jan 2025 08:59:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737709164; cv=none; b=LnGaFRAqjTcXyp03jqym4ohSfOtxCmd5E+W1dUyoP2tD0TDhB5Nta62WVynxeznolw38yr6bAT1AMwEwacMFxImE9G/Z0bmD4EA0+qMSyZVohGnZfO86FPI8PLQrGdncSB+ALQaIJXmYS0rI5JMYL7VJa07LiSBmkbbZ9FQyiOc= 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.182 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-f182.google.com with SMTP id d9443c01a7336-21649a7bcdcso32004255ad.1 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=mogDt+rIRr9mFII2sbASOhERrehOsq57sQ3CqQma4cIzlujFL0gjv4GrDW/w5zr9RU SgVMp3ROOrZIMhQZXNWNoEhmIkiXS/5altxqznUZZMY6VJJtkRuKtFG+inD5LmVk77hA Xels+H6w4qTj+nrSA9oiZ+vYrOacA4Bs1syQnluJwVor29Rh4/WEuPPkmvKIhVWxhVw4 rBFNamMDPNsGAcWmPFfkJvpSv4qRLUhHaTp9ExJFXGcL5YMFF7l+l08rV9DgtXmz/IvW CprWXgsFmtRd2BZZWAJU0EwiueQCJLb0cpiu4h5qLGNW/jNZLWTHp8OrgxyqnfEmQcBs bmVw== X-Forwarded-Encrypted: i=1; AJvYcCWgnkrYtYG887PygCI0URVhHq+JRJ6/V3j1VsOPTQdn8iZnhe6ikGDz/6Q6If8g3N1Xl8BIQldccNpGEts=@vger.kernel.org X-Gm-Message-State: AOJu0Yxu8sgRheRKr31keAQzT8s2iD81oPAPikLK+NwCuG/yKPcmHeZ4 VAMU29CQtOgKeNVr00RmBFiUbStTvABvAgzfKLkDWby309kSBo1OjQoriMmrpq0= X-Gm-Gg: ASbGnct2GOa87YY7FvvahKqoOZ4Ifx5yWx1aaGQ5AoviAzU9Y4uApDmhzT51sJeznOV HqProN5+ficB5P+tHwsMifG1nDLRyX8upteLZRoDkOHqkAuAArDHoKnnj5Cx8DWIKIs5di9M8h+ IfUP45q6tns5NbDpbh/WZsZ1D0uJPu7bSAwE4xCStkK/48bQauWZiZPaQiLqDkz4pfnKlMs2BP5 TFyu0YkTqRUTdzW9lQ+ZVGw9PJTtWRV6BSLk9UXkec7BGa/gMDPgNcUaTP6I9YLpQfjfeb3rQQD s5xjExA= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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); } =20 -int cpufreq_enable_boost_support(void) -{ - if (!cpufreq_driver) - return -EINVAL; - - if (cpufreq_boost_supported()) - return 0; - - cpufreq_driver->set_boost =3D 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, c= har *buf); =20 #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); =20 /* 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; } =20 -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; --=20 2.31.1.272.g89b43f80a514