<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/devfreq, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/devfreq?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/devfreq?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-05-19T17:32:19Z</updated>
<entry>
<title>PM / devfreq: passive: Return non-error when not-supported event is required</title>
<updated>2022-05-19T17:32:19Z</updated>
<author>
<name>Chanwoo Choi</name>
<email>cw00.choi@samsung.com</email>
</author>
<published>2022-05-19T01:07:53Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=42d2607d91c4ec37ea1970899c2d614824f3014b'/>
<id>urn:sha1:42d2607d91c4ec37ea1970899c2d614824f3014b</id>
<content type='text'>
Each devfreq governor specifies the supported governor event
such as GOV_START and GOV_STOP. When not-supported event is required,
just return non-error. But, commit ce9a0d88d97a ("PM / devfreq: Add
cpu based scaling support to passive governor") returned the error
value. So that return non-error value when not-supported event is required.

Fixes: ce9a0d88d97a ("PM / devfreq: Add cpu based scaling support to passive governor")
Reported-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: passive: Keep cpufreq_policy for possible cpus</title>
<updated>2022-05-17T09:24:39Z</updated>
<author>
<name>Chanwoo Choi</name>
<email>cw00.choi@samsung.com</email>
</author>
<published>2022-04-26T18:49:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/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: passive: Reduce duplicate code when passive_devfreq case</title>
<updated>2022-05-17T09:24:39Z</updated>
<author>
<name>Chanwoo Choi</name>
<email>cw00.choi@samsung.com</email>
</author>
<published>2021-03-02T08:22:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=05723e71234b60a1a47313ea1a889797ec648f1c'/>
<id>urn:sha1:05723e71234b60a1a47313ea1a889797ec648f1c</id>
<content type='text'>
In order to keep the consistent coding style between passive_devfreq
and passive_cpufreq, use common code for handling required opp property.
Also remove the unneed conditional statement and unify the comment
of both passive_devfreq and passive_cpufreq when getting the target frequency.

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:39Z</updated>
<author>
<name>Saravana Kannan</name>
<email>skannan@codeaurora.org</email>
</author>
<published>2021-03-02T06:58:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/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: Export devfreq_get_freq_range symbol within devfreq</title>
<updated>2022-05-17T09:24:39Z</updated>
<author>
<name>Chanwoo Choi</name>
<email>cw00.choi@samsung.com</email>
</author>
<published>2021-02-28T17:07:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=713472e53e6e53c985e283782b0fd76b8ecfd47e'/>
<id>urn:sha1:713472e53e6e53c985e283782b0fd76b8ecfd47e</id>
<content type='text'>
In order to get frequency range within devfreq governors,
export devfreq_get_freq_range symbol within devfreq.

Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
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: rk3399_dmc: Block PMU during transitions</title>
<updated>2022-05-08T18:38:07Z</updated>
<author>
<name>Brian Norris</name>
<email>briannorris@chromium.org</email>
</author>
<published>2022-04-06T01:48:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2e691421a2c9e0462175fe98171afa632861b199'/>
<id>urn:sha1:2e691421a2c9e0462175fe98171afa632861b199</id>
<content type='text'>
See the previous patch ("soc: rockchip: power-domain: Manage resource
conflicts with firmware") for a thorough explanation of the conflicts.
While ARM Trusted Firmware may be modifying memory controller and
power-domain states, we need to block the kernel's power-domain driver.

If the power-domain driver is disabled, there is no resource conflict
and this becomes a no-op.

Signed-off-by: Brian Norris &lt;briannorris@chromium.org&gt;
Reviewed-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Acked-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: rk3399_dmc: Avoid static (reused) profile</title>
<updated>2022-04-13T22:18:12Z</updated>
<author>
<name>Brian Norris</name>
<email>briannorris@chromium.org</email>
</author>
<published>2022-03-08T19:09:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=5d521a307526871f5613d24a8e71babf1869c486'/>
<id>urn:sha1:5d521a307526871f5613d24a8e71babf1869c486</id>
<content type='text'>
This static struct can get reused if the device gets removed/reprobed,
and that causes use-after-free in its -&gt;freq_table.

Let's just move the struct to our dynamic allocation.

Signed-off-by: Brian Norris &lt;briannorris@chromium.org&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: rk3399_dmc: Use devm_pm_opp_of_add_table()</title>
<updated>2022-04-13T22:18:12Z</updated>
<author>
<name>Brian Norris</name>
<email>briannorris@chromium.org</email>
</author>
<published>2022-03-08T19:09:00Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=cb178a9585946d5f2691d784640038edd4111cd1'/>
<id>urn:sha1:cb178a9585946d5f2691d784640038edd4111cd1</id>
<content type='text'>
This simplifies error-cleanup and remove().

Signed-off-by: Brian Norris &lt;briannorris@chromium.org&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: rk3399_dmc: Disable edev on remove()</title>
<updated>2022-04-13T22:18:12Z</updated>
<author>
<name>Brian Norris</name>
<email>briannorris@chromium.org</email>
</author>
<published>2022-03-08T19:08:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2fccf9e6050e0e3b8b4cd275d41daf7f7fa22804'/>
<id>urn:sha1:2fccf9e6050e0e3b8b4cd275d41daf7f7fa22804</id>
<content type='text'>
Otherwise we hit an unablanced enable-count when unbinding the DFI
device:

[ 1279.659119] ------------[ cut here ]------------
[ 1279.659179] WARNING: CPU: 2 PID: 5638 at drivers/devfreq/devfreq-event.c:360 devfreq_event_remove_edev+0x84/0x8c
...
[ 1279.659352] Hardware name: Google Kevin (DT)
[ 1279.659363] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO BTYPE=--)
[ 1279.659371] pc : devfreq_event_remove_edev+0x84/0x8c
[ 1279.659380] lr : devm_devfreq_event_release+0x1c/0x28
...
[ 1279.659571] Call trace:
[ 1279.659582]  devfreq_event_remove_edev+0x84/0x8c
[ 1279.659590]  devm_devfreq_event_release+0x1c/0x28
[ 1279.659602]  release_nodes+0x1cc/0x244
[ 1279.659611]  devres_release_all+0x44/0x60
[ 1279.659621]  device_release_driver_internal+0x11c/0x1ac
[ 1279.659629]  device_driver_detach+0x20/0x2c
[ 1279.659641]  unbind_store+0x7c/0xb0
[ 1279.659650]  drv_attr_store+0x2c/0x40
[ 1279.659663]  sysfs_kf_write+0x44/0x58
[ 1279.659672]  kernfs_fop_write_iter+0xf4/0x190
[ 1279.659684]  vfs_write+0x2b0/0x2e4
[ 1279.659693]  ksys_write+0x80/0xec
[ 1279.659701]  __arm64_sys_write+0x24/0x30
[ 1279.659714]  el0_svc_common+0xf0/0x1d8
[ 1279.659724]  do_el0_svc_compat+0x28/0x3c
[ 1279.659738]  el0_svc_compat+0x10/0x1c
[ 1279.659746]  el0_sync_compat_handler+0xa8/0xcc
[ 1279.659758]  el0_sync_compat+0x188/0x1c0
[ 1279.659768] ---[ end trace cec200e5094155b4 ]---

Signed-off-by: Brian Norris &lt;briannorris@chromium.org&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: rk3399_dmc: Support new *-ns properties</title>
<updated>2022-04-13T22:18:12Z</updated>
<author>
<name>Brian Norris</name>
<email>briannorris@chromium.org</email>
</author>
<published>2022-03-08T19:08:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=fd5b8479ef7e6a6cf1cf83ed62349c11b3864f12'/>
<id>urn:sha1:fd5b8479ef7e6a6cf1cf83ed62349c11b3864f12</id>
<content type='text'>
We want to keep the idle time fixed, so compute based on the current DDR
frequency.

The old properties were deprecated and never used, so we can safely drop
them from the driver.

This is a rewritten version of work by Lin Huang &lt;hl@rock-chips.com&gt;.

Signed-off-by: Brian Norris &lt;briannorris@chromium.org&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
</feed>
