<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/cpufreq/cpufreq.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-10-20T19:25:36Z</updated>
<entry>
<title>cpufreq: Replace deprecated strcpy() in cpufreq_unregister_governor()</title>
<updated>2025-10-20T19:25:36Z</updated>
<author>
<name>Thorsten Blum</name>
<email>thorsten.blum@linux.dev</email>
</author>
<published>2025-10-17T15:33:54Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ace04717749d20e34dac9f78c5ac772168232b67'/>
<id>urn:sha1:ace04717749d20e34dac9f78c5ac772168232b67</id>
<content type='text'>
strcpy() is deprecated; assign the NUL terminator directly instead.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum &lt;thorsten.blum@linux.dev&gt;
[ rjw: Subject tweaks ]
Link: https://patch.msgid.link/20251017153354.82009-2-thorsten.blum@linux.dev
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: preserve freq_table_sorted across suspend/hibernate</title>
<updated>2025-10-20T19:01:35Z</updated>
<author>
<name>Zihuan Zhang</name>
<email>zhangzihuan@kylinos.cn</email>
</author>
<published>2025-10-11T07:24:20Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6db0f533d320fab54154b0207e9df108427dd939'/>
<id>urn:sha1:6db0f533d320fab54154b0207e9df108427dd939</id>
<content type='text'>
During S3/S4 suspend and resume, cpufreq policies are not freed or
recreated; the freq_table and policy structure remain intact. However,
set_freq_table_sorted() currently resets policy-&gt;freq_table_sorted to
UNSORTED unconditionally, which is unnecessary since the table order
does not change across suspend/resume.

This patch adds a check to skip validation if policy-&gt;freq_table_sorted
is already ASCENDING or DESCENDING. This avoids unnecessary traversal
of the frequency table on S3/S4 resume or repeated online events,
reducing overhead while preserving correctness.

Signed-off-by: Zihuan Zhang &lt;zhangzihuan@kylinos.cn&gt;
Link: https://patch.msgid.link/20251011072420.11495-1-zhangzihuan@kylinos.cn
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge back earlier cpufreq material for 6.18</title>
<updated>2025-09-24T19:32:28Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2025-09-24T19:32:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c51f0d3b6ef1d1e40b6d7a5db76fadc034a98109'/>
<id>urn:sha1:c51f0d3b6ef1d1e40b6d7a5db76fadc034a98109</id>
<content type='text'>
</content>
</entry>
<entry>
<title>cpufreq: Initialize cpufreq-based invariance before subsys</title>
<updated>2025-09-20T11:00:20Z</updated>
<author>
<name>Christian Loehle</name>
<email>christian.loehle@arm.com</email>
</author>
<published>2025-09-18T10:15:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8ffe28b4e8d8b18cb2f2933410322c24f039d5d6'/>
<id>urn:sha1:8ffe28b4e8d8b18cb2f2933410322c24f039d5d6</id>
<content type='text'>
commit 2a6c72738706 ("cpufreq: Initialize cpufreq-based
frequency-invariance later") postponed the frequency invariance
initialization to avoid disabling it in the error case.
This isn't locking safe, instead move the initialization up before
the subsys interface is registered (which will rebuild the
sched_domains) and add the corresponding disable on the error path.

Observed lockdep without this patch:
[    0.989686] ======================================================
[    0.989688] WARNING: possible circular locking dependency detected
[    0.989690] 6.17.0-rc4-cix-build+ #31 Tainted: G S
[    0.989691] ------------------------------------------------------
[    0.989692] swapper/0/1 is trying to acquire lock:
[    0.989693] ffff800082ada7f8 (sched_energy_mutex){+.+.}-{4:4}, at: rebuild_sched_domains_energy+0x30/0x58
[    0.989705]
               but task is already holding lock:
[    0.989706] ffff000088c89bc8 (&amp;policy-&gt;rwsem){+.+.}-{4:4}, at: cpufreq_online+0x7f8/0xbe0
[    0.989713]
               which lock already depends on the new lock.

Fixes: 2a6c72738706 ("cpufreq: Initialize cpufreq-based frequency-invariance later")
Signed-off-by: Christian Loehle &lt;christian.loehle@arm.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Add defensive check during driver registration</title>
<updated>2025-09-19T21:11:44Z</updated>
<author>
<name>Zihuan Zhang</name>
<email>zhangzihuan@kylinos.cn</email>
</author>
<published>2025-09-08T08:57:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7c0dde86c17665cb27e1c8dd23d263e2ed2d5b50'/>
<id>urn:sha1:7c0dde86c17665cb27e1c8dd23d263e2ed2d5b50</id>
<content type='text'>
Currently, cpufreq allows drivers to implement both -&gt;target() and
-&gt;target_index() callbacks, but that can lead to ambiguous or incorrect
behavior.

For this reason, prevent cpufreq drivers implementing both -&gt;target()
and -&gt;target_index() at the same time from registering.

This check can help to catch driver implementation mistakes early and
improve overall robustness, without affecting existing valid drivers.

Signed-off-by: Zihuan Zhang &lt;zhangzihuan@kylinos.cn&gt;
Link: https://patch.msgid.link/20250908085738.31602-1-zhangzihuan@kylinos.cn
[ rjw: Subject adjustment and changelog rewrite ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: core: Rearrange variable declarations involving __free()</title>
<updated>2025-09-05T18:46:05Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2025-09-03T14:56:04Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c05fa4091863468fd53abf1334c05052eda1ff52'/>
<id>urn:sha1:c05fa4091863468fd53abf1334c05052eda1ff52</id>
<content type='text'>
Follow cleanup.h recommendations and always define and assign variables
in one statement when __free() is used.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Link: https://patch.msgid.link/4691667.LvFx2qVVIh@rafael.j.wysocki
</content>
</entry>
<entry>
<title>cpufreq: Use int type to store negative error codes</title>
<updated>2025-09-05T18:28:46Z</updated>
<author>
<name>Qianfeng Rong</name>
<email>rongqianfeng@vivo.com</email>
</author>
<published>2025-09-02T11:45:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b49d70849530f046b1f9a42c963840ca91c60929'/>
<id>urn:sha1:b49d70849530f046b1f9a42c963840ca91c60929</id>
<content type='text'>
Change the 'ret' variable in store_scaling_setspeed() from unsigned int to
int, as it needs to store either negative error codes or zero returned
by kstrtouint().

No effect on runtime.

Signed-off-by: Qianfeng Rong &lt;rongqianfeng@vivo.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Link: https://patch.msgid.link/20250902114545.651661-2-rongqianfeng@vivo.com
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: simplify setpolicy/target check in driver verification</title>
<updated>2025-08-22T19:33:22Z</updated>
<author>
<name>Zihuan Zhang</name>
<email>zhangzihuan@kylinos.cn</email>
</author>
<published>2025-08-22T07:04:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1647830388ffea4d7a39c1a5f7692925e9d8351d'/>
<id>urn:sha1:1647830388ffea4d7a39c1a5f7692925e9d8351d</id>
<content type='text'>
cpufreq drivers are supposed to use either -&gt;setpolicy() or
-&gt;target()/-&gt;target_index().

Simplify the existing check by collapsing it into a single boolean
expression:

    (!!driver-&gt;setpolicy == (driver-&gt;target_index || driver-&gt;target))

This is a readability/maintainability cleanup and keeps the semantics
unchanged.

No functional change intended.

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/20250822070424.166795-3-zhangzihuan@kylinos.cn
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: use strlen() for governor name comparison</title>
<updated>2025-08-22T19:33:22Z</updated>
<author>
<name>Zihuan Zhang</name>
<email>zhangzihuan@kylinos.cn</email>
</author>
<published>2025-08-22T07:04:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e9e124501f0d7ea2caea94711efe50fe081a11ea'/>
<id>urn:sha1:e9e124501f0d7ea2caea94711efe50fe081a11ea</id>
<content type='text'>
Most kernel code using strncasecmp()/strncmp() passes strlen("xxx")
as the length argument. cpufreq_parse_policy() previously used
CPUFREQ_NAME_LEN (16), which is longer than the actual strings
("performance" is 11 chars, "powersave" is 9 chars).

This patch switches to strlen() for the comparison, making the
matching slightly more permissive (e.g., "powersavexxx" will now
also match "powersave"). While this is unlikely to cause functional
issues, it aligns cpufreq with common kernel style and makes the
behavior more intuitive.

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/20250822070424.166795-2-zhangzihuan@kylinos.cn
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
