<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/devfreq.h, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-05-29T14:23:04+00:00</updated>
<entry>
<title>PM / devfreq: Reorder fields in 'struct devfreq_dev_status'</title>
<updated>2023-05-29T14:23:04+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2023-05-08T07:42:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a3a2c32a5ee163bc8f195b04751f165aa4d9c83'/>
<id>urn:sha1:4a3a2c32a5ee163bc8f195b04751f165aa4d9c83</id>
<content type='text'>
Group some variables based on their sizes to reduce holes.
On x86_64, this shrinks the size of 'struct devfreq_dev_status' from 72 to
64 bytes.

This structure is used both to allocate static variables or is embedded in
some other structures. In both cases, reducing its size is nice to have.

Moreover, the whole structure now fits in a single cache line on x86_64.

Finally, it makes the order of code match the order of the above kernel
doc.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Acked-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Fix build issues with devfreq disabled</title>
<updated>2023-01-30T15:37:40+00:00</updated>
<author>
<name>Rob Clark</name>
<email>robdclark@chromium.org</email>
</author>
<published>2023-01-23T15:37:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dbd7a2a941b8cbf9e5f79a777ed9fe0090eebb61'/>
<id>urn:sha1:dbd7a2a941b8cbf9e5f79a777ed9fe0090eebb61</id>
<content type='text'>
The existing no-op shims for when PM_DEVFREQ (or an individual governor)
only do half the job.  The governor specific config/tuning structs need
to be available to avoid compile errors in drivers using devfreq.

Fixes: 6563f60f14cb ("drm/msm/gpu: Add devfreq tuning debugfs")
Signed-off-by: Rob Clark &lt;robdclark@chromium.org&gt;
Acked-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
Acked-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/519801/
Link: https://lore.kernel.org/r/20230123153745.3185032-1-robdclark@gmail.com
</content>
</entry>
<entry>
<title>PM/devfreq: governor: Add a private governor_data for governor</title>
<updated>2022-11-20T11:49:51+00:00</updated>
<author>
<name>Kant Fan</name>
<email>kant@allwinnertech.com</email>
</author>
<published>2022-10-25T07:21:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5fdded8448924e3631d466eea499b11606c43640'/>
<id>urn:sha1:5fdded8448924e3631d466eea499b11606c43640</id>
<content type='text'>
The member void *data in the structure devfreq can be overwrite
by governor_userspace. For example:
1. The device driver assigned the devfreq governor to simple_ondemand
by the function devfreq_add_device() and init the devfreq member
void *data to a pointer of a static structure devfreq_simple_ondemand_data
by the function devfreq_add_device().
2. The user changed the devfreq governor to userspace by the command
"echo userspace &gt; /sys/class/devfreq/.../governor".
3. The governor userspace alloced a dynamic memory for the struct
userspace_data and assigend the member void *data of devfreq to
this memory by the function userspace_init().
4. The user changed the devfreq governor back to simple_ondemand
by the command "echo simple_ondemand &gt; /sys/class/devfreq/.../governor".
5. The governor userspace exited and assigned the member void *data
in the structure devfreq to NULL by the function userspace_exit().
6. The governor simple_ondemand fetched the static information of
devfreq_simple_ondemand_data in the function
devfreq_simple_ondemand_func() but the member void *data of devfreq was
assigned to NULL by the function userspace_exit().
7. The information of upthreshold and downdifferential is lost
and the governor simple_ondemand can't work correctly.

The member void *data in the structure devfreq is designed for
a static pointer used in a governor and inited by the function
devfreq_add_device(). This patch add an element named governor_data
in the devfreq structure which can be used by a governor(E.g userspace)
who want to assign a private data to do some private things.

Fixes: ce26c5bb9569 ("PM / devfreq: Add basic governors")
Cc: stable@vger.kernel.org # 5.10+
Reviewed-by: Chanwoo Choi &lt;cwchoi00@gmail.com&gt;
Acked-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
Signed-off-by: Kant Fan &lt;kant@allwinnertech.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Rework freq_table to be local to devfreq struct</title>
<updated>2022-06-29T20:11:17+00:00</updated>
<author>
<name>Christian Marangi</name>
<email>ansuelsmth@gmail.com</email>
</author>
<published>2022-06-19T22:03:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b5d281f6c16dd432b618bdfd36ddba1a58d5b603'/>
<id>urn:sha1:b5d281f6c16dd432b618bdfd36ddba1a58d5b603</id>
<content type='text'>
On a devfreq PROBE_DEFER, the freq_table in the driver profile struct,
is never reset and may be leaved in an undefined state.

This comes from the fact that we store the freq_table in the driver
profile struct that is commonly defined as static and not reset on
PROBE_DEFER.
We currently skip the reinit of the freq_table if we found
it's already defined since a driver may declare his own freq_table.

This logic is flawed in the case devfreq core generate a freq_table, set
it in the profile struct and then PROBE_DEFER, freeing the freq_table.
In this case devfreq will found a NOT NULL freq_table that has been
freed, skip the freq_table generation and probe the driver based on the
wrong table.

To fix this and correctly handle PROBE_DEFER, use a local freq_table and
max_state in the devfreq struct and never modify the freq_table present
in the profile struct if it does provide it.

Fixes: 0ec09ac2cebe ("PM / devfreq: Set the freq_table of devfreq device")
Cc: stable@vger.kernel.org
Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: passive: Keep cpufreq_policy for possible cpus</title>
<updated>2022-05-17T09:24:39+00:00</updated>
<author>
<name>Chanwoo Choi</name>
<email>cw00.choi@samsung.com</email>
</author>
<published>2022-04-26T18:49:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=26984d9d581e5049bd75091d2e789b9cc3ea12e0'/>
<id>urn:sha1:26984d9d581e5049bd75091d2e789b9cc3ea12e0</id>
<content type='text'>
The passive governor requires the cpu data to get the next target frequency
of devfreq device if depending on cpu. In order to reduce the unnecessary
memory data, keep cpufreq_policy data for possible cpus instead of NR_CPU.

Tested-by: Chen-Yu Tsai &lt;wenst@chromium.org&gt;
Tested-by: Johnson Wang &lt;johnson.wang@mediatek.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Add cpu based scaling support to passive governor</title>
<updated>2022-05-17T09:24:39+00:00</updated>
<author>
<name>Saravana Kannan</name>
<email>skannan@codeaurora.org</email>
</author>
<published>2021-03-02T06:58:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a03dacb0316f74400846aaf144d6c73f4217ca08'/>
<id>urn:sha1:a03dacb0316f74400846aaf144d6c73f4217ca08</id>
<content type='text'>
Many CPU architectures have caches that can scale independent of the
CPUs. Frequency scaling of the caches is necessary to make sure that the
cache is not a performance bottleneck that leads to poor performance and
power. The same idea applies for RAM/DDR.

To achieve this, this patch adds support for cpu based scaling to the
passive governor. This is accomplished by taking the current frequency
of each CPU frequency domain and then adjust the frequency of the cache
(or any devfreq device) based on the frequency of the CPUs. It listens
to CPU frequency transition notifiers to keep itself up to date on the
current CPU frequency.

To decide the frequency of the device, the governor does one of the
following:
* Derives the optimal devfreq device opp from required-opps property of
  the parent cpu opp_table.

* Scales the device frequency in proportion to the CPU frequency. So, if
  the CPUs are running at their max frequency, the device runs at its
  max frequency. If the CPUs are running at their min frequency, the
  device runs at its min frequency. It is interpolated for frequencies
  in between.

Tested-by: Chen-Yu Tsai &lt;wenst@chromium.org&gt;
Tested-by: Johnson Wang &lt;johnson.wang@mediatek.com&gt;
Signed-off-by: Saravana Kannan &lt;skannan@codeaurora.org&gt;
[Sibi: Integrated cpu-freqmap governor into passive_governor]
Signed-off-by: Sibi Sankar &lt;sibis@codeaurora.org&gt;
[Chanwoo: Fix conflict with latest code and cleanup code]
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Register devfreq as a cooling device on demand</title>
<updated>2021-03-09T06:40:16+00:00</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2021-03-08T13:30:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1224451bb6f938023dd7fa4e7ba43bfb185bc9e3'/>
<id>urn:sha1:1224451bb6f938023dd7fa4e7ba43bfb185bc9e3</id>
<content type='text'>
Currently the default behavior is to manually having the devfreq
backend to register themselves as a devfreq cooling device.

Instead of adding the code in the drivers for the thermal cooling
device registering, let's provide a flag in the devfreq's profile to
tell the common devfreq code to register the newly created devfreq as
a cooling device.

Suggested-by: Chanwoo Choi &lt;cwchoi00@gmail.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Reviewed-by: Steven Price &lt;steven.price@arm.com&gt;
Reviewed-by: Lukasz Luba &lt;lukasz.luba@arm.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Cache OPP table reference in devfreq</title>
<updated>2021-02-04T11:06:28+00:00</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2021-02-04T08:14:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=26f9c7cc42a6dc036edf871544fd0e6b3a0601c1'/>
<id>urn:sha1:26f9c7cc42a6dc036edf871544fd0e6b3a0601c1</id>
<content type='text'>
The OPP table can be used often in devfreq. Trying to get it each time can
be expensive, so cache it in the devfreq struct.

Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Acked-by: MyungJoo Ham &lt;myungjoo.ham@samsung.com&gt;
Acked-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
[ Viresh: Added a blank line ]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Remove redundant governor_name from struct devfreq</title>
<updated>2020-10-26T02:50:51+00:00</updated>
<author>
<name>Chanwoo Choi</name>
<email>cw00.choi@samsung.com</email>
</author>
<published>2020-10-20T06:12:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=96ffcdf239de6f9970178bb7d643e16fd9e68ab9'/>
<id>urn:sha1:96ffcdf239de6f9970178bb7d643e16fd9e68ab9</id>
<content type='text'>
The devfreq structure instance contains the governor_name and a governor
instance. When need to show the governor name, better to use the name
of devfreq_governor structure. So, governor_name variable in struct devfreq
is a redundant and unneeded variable. Remove the redundant governor_name
of struct devfreq and then use the name of devfreq_governor instance.

Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: remove a duplicated kernel-doc markup</title>
<updated>2020-10-16T05:28:20+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab+huawei@kernel.org</email>
</author>
<published>2020-10-05T08:58:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3e2ac9798e13ad1f52d735ea2ea1d252cb140ae5'/>
<id>urn:sha1:3e2ac9798e13ad1f52d735ea2ea1d252cb140ae5</id>
<content type='text'>
The update_devfreq() is also documented at devfreq.c, which
has a more complete note.

So, drop the duplicated markup, in order to avoid this
warning:
	.../Documentation/driver-api/device_link.rst: WARNING: Duplicate C declaration, also defined in 'driver-api/infrastructure'.
	Declaration is 'device_link_state'.

(and to cause a problem with cross-references to it)

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
</content>
</entry>
</feed>
