<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/cpufreq/freq_table.c, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2025-09-23T15:16:56Z</updated>
<entry>
<title>cpufreq: Replace pointer subtraction with iteration macro</title>
<updated>2025-09-23T15:16:56Z</updated>
<author>
<name>Zihuan Zhang</name>
<email>zhangzihuan@kylinos.cn</email>
</author>
<published>2025-09-23T07:55:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9a1aa642c1fb5a3776447182aaf37dfaafb36134'/>
<id>urn:sha1:9a1aa642c1fb5a3776447182aaf37dfaafb36134</id>
<content type='text'>
The cpufreq documentation suggests avoiding direct pointer subtraction
when working with entries in driver_freq_table, as it is relatively
costly. Instead, the recommended approach is to use the provided
iteration macros, like cpufreq_for_each_valid_entry_idx().

Use cpufreq_for_each_entry_idx() instead of pointer subtraction in
cpufreq_frequency_table_cpuinfo() which improves code clarity and
follows the established cpufreq coding style.

While at it, remove redundant local variable initialization from
cpufreq_table_index_unsorted().

No functional change intended.

Signed-off-by: Zihuan Zhang &lt;zhangzihuan@kylinos.cn&gt;
Link: https://patch.msgid.link/20250923075553.45532-1-zhangzihuan@kylinos.cn
[ rjw: Subject tweak, changelog edits, local variable definition tweak ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Drop redundant freq_table parameter</title>
<updated>2025-09-05T18:16:55Z</updated>
<author>
<name>Zihuan Zhang</name>
<email>zhangzihuan@kylinos.cn</email>
</author>
<published>2025-09-02T07:33:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=97248d05b70edc674f2f2fa835fed33172686b1d'/>
<id>urn:sha1:97248d05b70edc674f2f2fa835fed33172686b1d</id>
<content type='text'>
Since commit e0b3165ba521 ("cpufreq: add 'freq_table' in struct
cpufreq_policy"), freq_table has been stored in struct cpufreq_policy
instead of being maintained separately.

However, several helpers in freq_table.c still take both policy and
freq_table as parameters, even though policy-&gt;freq_table can always be
used. This leads to redundant function arguments and increases the
chance of inconsistencies.

This patch removes the unnecessary freq_table argument from these
functions and updates their callers to only pass policy. This makes
the code simpler, more consistent, and avoids duplication.

Signed-off-by: Zihuan Zhang &lt;zhangzihuan@kylinos.cn&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Link: https://patch.msgid.link/20250902073323.48330-1-zhangzihuan@kylinos.cn
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Fix setting policy limits when frequency tables are used</title>
<updated>2025-04-28T12:36:41Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2025-04-25T11:36:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b79028039f440e7d2c4df6ab243060c4e3803e84'/>
<id>urn:sha1:b79028039f440e7d2c4df6ab243060c4e3803e84</id>
<content type='text'>
Commit 7491cdf46b5c ("cpufreq: Avoid using inconsistent policy-&gt;min and
policy-&gt;max") overlooked the fact that policy-&gt;min and policy-&gt;max were
accessed directly in cpufreq_frequency_table_target() and in the
functions called by it.  Consequently, the changes made by that commit
led to problems with setting policy limits.

Address this by passing the target frequency limits to __resolve_freq()
and cpufreq_frequency_table_target() and propagating them to the
functions called by the latter.

Fixes: 7491cdf46b5c ("cpufreq: Avoid using inconsistent policy-&gt;min and policy-&gt;max")
Cc: 5.16+ &lt;stable@vger.kernel.org&gt; # 5.16+
Closes: https://lore.kernel.org/linux-pm/aAplED3IA_J0eZN0@linaro.org/
Reported-by: Stephan Gerhold &lt;stephan.gerhold@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Tested-by: Stephan Gerhold &lt;stephan.gerhold@linaro.org&gt;
Reviewed-by: Lifeng Zheng &lt;zhenglifeng1@huawei.com&gt;
Link: https://patch.msgid.link/5896780.DvuYhMxLoT@rjwysocki.net
</content>
</entry>
<entry>
<title>cpufreq: staticize policy_has_boost_freq()</title>
<updated>2025-02-07T04:15:16Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2025-01-23T08:57:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c952775a3d72b0505c2f8f4171929c293479f0fd'/>
<id>urn:sha1:c952775a3d72b0505c2f8f4171929c293479f0fd</id>
<content type='text'>
policy_has_boost_freq() isn't used outside of freq_table.c now, mark it
static.

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>cpufreq: Introduce policy-&gt;boost_supported flag</title>
<updated>2025-02-07T04:15:14Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2025-01-23T05:34:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1f7d1bab50e6ae517f8b6699e56d709d61ae13e5'/>
<id>urn:sha1:1f7d1bab50e6ae517f8b6699e56d709d61ae13e5</id>
<content type='text'>
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 -&gt;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 &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>cpufreq: Remove cpufreq_generic_attrs</title>
<updated>2025-02-07T04:15:14Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2025-01-22T11:10:54Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=486729c6012042c486db2a5e4d5dd034fb1d3f3c'/>
<id>urn:sha1:486729c6012042c486db2a5e4d5dd034fb1d3f3c</id>
<content type='text'>
All users of cpufreq_generic_attr are migrated now, remove it. While at
it, also stop exporting attributes for available and boost frequencies
as they are only used by cpufreq core now.

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Acked-by: Rafael J. Wysocki &lt;rafael@kernel.org&gt;
</content>
</entry>
<entry>
<title>cpufreq: Fix up printing large CPU numbers and frequency values</title>
<updated>2024-04-30T10:55:01Z</updated>
<author>
<name>Joshua Yeong</name>
<email>joshua.yeong@starfivetech.com</email>
</author>
<published>2024-04-25T11:00:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a2bd1d268e5d6411ddf3a10cdd3d964aad621cab'/>
<id>urn:sha1:a2bd1d268e5d6411ddf3a10cdd3d964aad621cab</id>
<content type='text'>
A negative CPU number or frequency value may be printed if they are
really large (which is unlikely, though).

Signed-off-by: Joshua Yeong &lt;joshua.yeong@starfivetech.com&gt;
Reviewed-by: Thorsten Blum &lt;thorsten.blum@toblux.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
[ rjw: Subject and changelog edits. ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Use a smaller freq for the policy-&gt;max when verify</title>
<updated>2024-03-27T15:19:39Z</updated>
<author>
<name>Xuewen Yan</name>
<email>xuewen.yan@unisoc.com</email>
</author>
<published>2024-03-19T08:01:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=db9ea3b22315b74fd682d0c381a6e2ad09a105e3'/>
<id>urn:sha1:db9ea3b22315b74fd682d0c381a6e2ad09a105e3</id>
<content type='text'>
When driver use the cpufreq_frequency_table_verify() as the
cpufreq_driver-&gt;verify's callback. It may cause the policy-&gt;max
bigger than the freq_qos's max freq.

Just as follow:

unisoc:/sys/devices/system/cpu/cpufreq/policy0 # cat scaling_available_frequencies
614400 768000 988000 1228800 1469000 1586000 1690000 1833000 2002000 2093000

unisoc:/sys/devices/system/cpu/cpufreq/policy0 # echo 1900000 &gt; scaling_max_freq
unisoc:/sys/devices/system/cpu/cpufreq/policy0 # echo 1900000 &gt; scaling_min_freq
unisoc:/sys/devices/system/cpu/cpufreq/policy0 # cat scaling_max_freq
2002000
unisoc:/sys/devices/system/cpu/cpufreq/policy0 # cat scaling_min_freq
2002000

When user set the qos_min and qos_max as the same value, and the value
is not in the freq-table, the above scenario will occur.

This is because in cpufreq_frequency_table_verify() func, when it can not
find the freq in table, it will change the policy-&gt;max to be a bigger freq,
as above, because there is no 1.9G in the freq-table, the policy-&gt;max would
be set to 2.002G. As a result, the cpufreq_policy-&gt;max is bigger than the
user's qos_max. This is unreasonable.

So use a smaller freq when can not find the freq in fre-table, to prevent
the policy-&gt;max exceed the qos's max freq.

Signed-off-by: Xuewen Yan &lt;xuewen.yan@unisoc.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Fix per-policy boost behavior on SoCs using cpufreq_boost_set_sw()</title>
<updated>2024-03-13T19:57:00Z</updated>
<author>
<name>Sibi Sankar</name>
<email>quic_sibis@quicinc.com</email>
</author>
<published>2024-03-12T10:37:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f37a4d6b4a2c77414e8b9d25dd5ee31537ce9b00'/>
<id>urn:sha1:f37a4d6b4a2c77414e8b9d25dd5ee31537ce9b00</id>
<content type='text'>
In the existing code, per-policy flags don't have any impact i.e.
if cpufreq_driver boost is enabled and boost is disabled for one or
more of the policies, the cpufreq driver will behave as if boost is
enabled.

Fix this by incorporating per-policy boost flag in the policy-&gt;max
computation used in cpufreq_frequency_table_cpuinfo and setting the
default per-policy boost to mirror the cpufreq_driver boost flag.

Fixes: 218a06a79d9a ("cpufreq: Support per-policy performance boost")
Reported-by: Dietmar Eggemann &lt;dietmar.eggemann@arm.com&gt;
Reviewed-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt;
Signed-off-by: Sibi Sankar &lt;quic_sibis@quicinc.com&gt;
Tested-by:Yipeng Zou &lt;zouyipeng@huawei.com&gt; &lt;mailto:zouyipeng@huawei.com&gt;
Reviewed-by: Yipeng Zou &lt;zouyipeng@huawei.com&gt; &lt;mailto:zouyipeng@huawei.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'cpufreq-arm-updates-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm</title>
<updated>2023-04-20T17:30:01Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2023-04-20T17:30:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0bdd95cede51d725c7f29c9787e62b77bfb0f034'/>
<id>urn:sha1:0bdd95cede51d725c7f29c9787e62b77bfb0f034</id>
<content type='text'>
Pull cpufreq/ARM updates for 6.4 from Viresh Kumar:

"- Add opp and bandwidth support to tegra194 cpufreq driver (Sumit
   Gupta).

 - Use of_property_present() for testing DT property presence (Rob
   Herring).

 - Remove MODULE_LICENSE in non-modules (Nick Alcock).

 - Add SM7225 to cpufreq-dt-platdev blocklist (Luca Weiss).

 - Optimizations and fixes for qcom-cpufreq-hw driver (Krzysztof
   Kozlowski, Konrad Dybcio, and Bjorn Andersson).

 - DT binding updates for qcom-cpufreq-hw driver (Konrad Dybcio and
   Bartosz Golaszewski).

 - Updates and fixes for mediatek driver (Jia-Wei Chang and
   AngeloGioacchino Del Regno)."
</content>
</entry>
</feed>
