<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/devfreq/devfreq.c, branch v5.5</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.5</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.5'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2019-12-09T03:19:16Z</updated>
<entry>
<title>PM / devfreq: Use PM QoS for sysfs min/max_freq</title>
<updated>2019-12-09T03:19:16Z</updated>
<author>
<name>Leonard Crestez</name>
<email>leonard.crestez@nxp.com</email>
</author>
<published>2019-12-05T10:05:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=27dbc542f651ed09de910f274b32634904103774'/>
<id>urn:sha1:27dbc542f651ed09de910f274b32634904103774</id>
<content type='text'>
Switch the handling of min_freq and max_freq from sysfs to use the
dev_pm_qos_request interface.

Since PM QoS handles frequencies as kHz this change reduces the
precision of min_freq and max_freq. This shouldn't introduce problems
because frequencies which are not an integer number of kHz are likely
not an integer number of Hz either.

Try to ensure compatibility by rounding min values down and rounding
max values up.

Signed-off-by: Leonard Crestez &lt;leonard.crestez@nxp.com&gt;
Acked-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Tested-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
[cw00.choi: Return -EAGAIN instead of -EINVAL if dev_pm_qos is inactive]
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Add PM QoS support</title>
<updated>2019-12-09T03:19:16Z</updated>
<author>
<name>Leonard Crestez</name>
<email>leonard.crestez@nxp.com</email>
</author>
<published>2019-12-05T10:05:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=05d7ae15cfb18f9ce55eef85bb6bcd62d31acc57'/>
<id>urn:sha1:05d7ae15cfb18f9ce55eef85bb6bcd62d31acc57</id>
<content type='text'>
Register notifiers with the PM QoS framework in order to respond to
requests for DEV_PM_QOS_MIN_FREQUENCY and DEV_PM_QOS_MAX_FREQUENCY.

No notifiers are added by this patch but PM QoS constraints can be
imposed externally (for example from other devices).

Signed-off-by: Leonard Crestez &lt;leonard.crestez@nxp.com&gt;
Acked-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Tested-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
<entry>
<title>PM / devfreq: Don't fail devfreq_dev_release if not in list</title>
<updated>2019-12-09T03:19:16Z</updated>
<author>
<name>Leonard Crestez</name>
<email>leonard.crestez@nxp.com</email>
</author>
<published>2019-11-13T23:21:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=42a6b25e67df6ee6675e8d1eaf18065bd73328ba'/>
<id>urn:sha1:42a6b25e67df6ee6675e8d1eaf18065bd73328ba</id>
<content type='text'>
Right now devfreq_dev_release will print a warning and abort the rest of
the cleanup if the devfreq instance is not part of the global
devfreq_list. But this is a valid scenario, for example it can happen if
the governor can't be found or on any other init error that happens
after device_register.

Initialize devfreq-&gt;node to an empty list head in devfreq_add_device so
that list_del becomes a safe noop inside devfreq_dev_release and we can
continue the rest of the cleanup.

Signed-off-by: Leonard Crestez &lt;leonard.crestez@nxp.com&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-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: Introduce get_freq_range helper</title>
<updated>2019-12-09T03:19:16Z</updated>
<author>
<name>Leonard Crestez</name>
<email>leonard.crestez@nxp.com</email>
</author>
<published>2019-10-31T21:34:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=46cecc0bf095bbffdf58618a1b4a5f9c9f073bf8'/>
<id>urn:sha1:46cecc0bf095bbffdf58618a1b4a5f9c9f073bf8</id>
<content type='text'>
Moving handling of min/max freq to a single function and call it from
update_devfreq and for printing min/max freq values in sysfs.

This changes the behavior of out-of-range min_freq/max_freq: clamping
is now done at evaluation time. This means that if an out-of-range
constraint is imposed by sysfs and it later becomes valid then it will
be enforced.

Signed-off-by: Leonard Crestez &lt;leonard.crestez@nxp.com&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-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: Set scaling_max_freq to max on OPP notifier error</title>
<updated>2019-12-09T03:19:15Z</updated>
<author>
<name>Leonard Crestez</name>
<email>leonard.crestez@nxp.com</email>
</author>
<published>2019-10-31T21:34:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e7cc792d00049c874010b398a27c3cc7bc8fef34'/>
<id>urn:sha1:e7cc792d00049c874010b398a27c3cc7bc8fef34</id>
<content type='text'>
The devfreq_notifier_call functions will update scaling_min_freq and
scaling_max_freq when the OPP table is updated.

If fetching the maximum frequency fails then scaling_max_freq remains
set to zero which is confusing. Set to ULONG_MAX instead so we don't
need special handling for this case in other places.

Signed-off-by: Leonard Crestez &lt;leonard.crestez@nxp.com&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-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: Fix devfreq_notifier_call returning errno</title>
<updated>2019-12-09T03:19:15Z</updated>
<author>
<name>Leonard Crestez</name>
<email>leonard.crestez@nxp.com</email>
</author>
<published>2019-10-31T21:34:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e876e710ede23f670494331e062d643928e4142a'/>
<id>urn:sha1:e876e710ede23f670494331e062d643928e4142a</id>
<content type='text'>
Notifier callbacks shouldn't return negative errno but one of the
NOTIFY_OK/DONE/BAD values.

The OPP core will ignore return values from notifiers but returning a
value that matches NOTIFY_STOP_MASK will stop the notification chain.

Fix by always returning NOTIFY_OK.

Signed-off-by: Leonard Crestez &lt;leonard.crestez@nxp.com&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-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: Add missing locking while setting suspend_freq</title>
<updated>2019-11-29T11:50:34Z</updated>
<author>
<name>Marek Szyprowski</name>
<email>m.szyprowski@samsung.com</email>
</author>
<published>2019-11-12T10:47:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e1e047ace8cef6d143f38c7d769753f133becbe6'/>
<id>urn:sha1:e1e047ace8cef6d143f38c7d769753f133becbe6</id>
<content type='text'>
Commit 2abb0d5268ae ("PM / devfreq: Lock devfreq in trans_stat_show")
revealed a missing locking while calling devfreq_update_status() function
during suspend/resume cycle.

Code analysis revealed that devfreq_set_target() function was called
without needed locks held for setting device specific suspend_freq if such
has been defined. This patch fixes that by adding the needed locking, what
fixes following kernel warning on Exynos4412-based OdroidU3 board during
system suspend:

PM: suspend entry (deep)
Filesystems sync: 0.002 seconds
Freezing user space processes ... (elapsed 0.001 seconds) done.
OOM killer disabled.
Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
------------[ cut here ]------------
WARNING: CPU: 2 PID: 1385 at drivers/devfreq/devfreq.c:204 devfreq_update_status+0xc0/0x188
Modules linked in:
CPU: 2 PID: 1385 Comm: rtcwake Not tainted 5.4.0-rc6-next-20191111 #6848
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[&lt;c0112588&gt;] (unwind_backtrace) from [&lt;c010e070&gt;] (show_stack+0x10/0x14)
[&lt;c010e070&gt;] (show_stack) from [&lt;c0afb010&gt;] (dump_stack+0xb4/0xe0)
[&lt;c0afb010&gt;] (dump_stack) from [&lt;c01272e0&gt;] (__warn+0xf4/0x10c)
[&lt;c01272e0&gt;] (__warn) from [&lt;c01273a8&gt;] (warn_slowpath_fmt+0xb0/0xb8)
[&lt;c01273a8&gt;] (warn_slowpath_fmt) from [&lt;c07d105c&gt;] (devfreq_update_status+0xc0/0x188)
[&lt;c07d105c&gt;] (devfreq_update_status) from [&lt;c07d2d70&gt;] (devfreq_set_target+0xb0/0x15c)
[&lt;c07d2d70&gt;] (devfreq_set_target) from [&lt;c07d3598&gt;] (devfreq_suspend+0x2c/0x64)
[&lt;c07d3598&gt;] (devfreq_suspend) from [&lt;c05de0b0&gt;] (dpm_suspend+0xa4/0x57c)
[&lt;c05de0b0&gt;] (dpm_suspend) from [&lt;c05def74&gt;] (dpm_suspend_start+0x98/0xa0)
[&lt;c05def74&gt;] (dpm_suspend_start) from [&lt;c0195b58&gt;] (suspend_devices_and_enter+0xec/0xc74)
[&lt;c0195b58&gt;] (suspend_devices_and_enter) from [&lt;c0196a20&gt;] (pm_suspend+0x340/0x410)
[&lt;c0196a20&gt;] (pm_suspend) from [&lt;c019480c&gt;] (state_store+0x6c/0xc8)
[&lt;c019480c&gt;] (state_store) from [&lt;c033fc50&gt;] (kernfs_fop_write+0x10c/0x228)
[&lt;c033fc50&gt;] (kernfs_fop_write) from [&lt;c02a6d3c&gt;] (__vfs_write+0x30/0x1d0)
[&lt;c02a6d3c&gt;] (__vfs_write) from [&lt;c02a9afc&gt;] (vfs_write+0xa4/0x180)
[&lt;c02a9afc&gt;] (vfs_write) from [&lt;c02a9d58&gt;] (ksys_write+0x60/0xd8)
[&lt;c02a9d58&gt;] (ksys_write) from [&lt;c0101000&gt;] (ret_fast_syscall+0x0/0x28)
Exception stack(0xed3d7fa8 to 0xed3d7ff0)
...
irq event stamp: 9667
hardirqs last  enabled at (9679): [&lt;c0b1e7c4&gt;] _raw_spin_unlock_irq+0x20/0x58
hardirqs last disabled at (9698): [&lt;c0b16a20&gt;] __schedule+0xd8/0x818
softirqs last  enabled at (9694): [&lt;c01026fc&gt;] __do_softirq+0x4fc/0x5fc
softirqs last disabled at (9719): [&lt;c012fe68&gt;] irq_exit+0x16c/0x170
---[ end trace 41ac5b57d046bdbc ]---
------------[ cut here ]------------

Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Acked-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: Add new interrupt_driven flag for governors</title>
<updated>2019-11-06T03:04:01Z</updated>
<author>
<name>Dmitry Osipenko</name>
<email>digetx@gmail.com</email>
</author>
<published>2019-11-04T21:56:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5c0f6c79595760c9e366c3517314051af530e3e6'/>
<id>urn:sha1:5c0f6c79595760c9e366c3517314051af530e3e6</id>
<content type='text'>
Currently interrupt-driven governors (like NVIDIA Tegra30 ACTMON governor)
are used to set polling_ms=0 in order to avoid periodic polling of device
status by devfreq core. This means that polling interval can't be changed
by userspace for such governors.

The new governor flag allows interrupt-driven governors to convey that
devfreq core shouldn't perform polling of device status and thus generic
devfreq polling interval could be supported by these governors now.

Signed-off-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Reviewed-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: Lock devfreq in trans_stat_show</title>
<updated>2019-11-06T03:04:00Z</updated>
<author>
<name>Leonard Crestez</name>
<email>leonard.crestez@nxp.com</email>
</author>
<published>2019-09-24T07:52:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2abb0d5268ae7b5ddf82099b1f8d5aa8414637d4'/>
<id>urn:sha1:2abb0d5268ae7b5ddf82099b1f8d5aa8414637d4</id>
<content type='text'>
There is no locking in this sysfs show function so stats printing can
race with a devfreq_update_status called as part of freq switching or
with initialization.

Also add an assert in devfreq_update_status to make it clear that lock
must be held by caller.

Fixes: 39688ce6facd ("PM / devfreq: account suspend/resume for stats")
Cc: stable@vger.kernel.org
Signed-off-by: Leonard Crestez &lt;leonard.crestez@nxp.com&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-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: Check NULL governor in available_governors_show</title>
<updated>2019-11-06T03:03:59Z</updated>
<author>
<name>Leonard Crestez</name>
<email>leonard.crestez@nxp.com</email>
</author>
<published>2019-09-24T07:26:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d68adc8f85cd757bd33c8d7b2660ad6f16f7f3dc'/>
<id>urn:sha1:d68adc8f85cd757bd33c8d7b2660ad6f16f7f3dc</id>
<content type='text'>
The governor is initialized after sysfs attributes become visible so in
theory the governor field can be NULL here.

Fixes: bcf23c79c4e46 ("PM / devfreq: Fix available_governor sysfs")
Signed-off-by: Leonard Crestez &lt;leonard.crestez@nxp.com&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Reviewed-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
</content>
</entry>
</feed>
