Linux kernel source tree
Go to file
Matthias Kaehlcke 6c619c5700 UPSTREAM: PM / devfreq: Fix handling of min/max_freq == 0
Commit ab8f58ad72 ("PM / devfreq: Set min/max_freq when adding the
devfreq device") initializes df->min/max_freq with the min/max OPP when
the device is added. Later commit f1d981eaec ("PM / devfreq: Use the
available min/max frequency") adds df->scaling_min/max_freq and the
following to the frequency adjustment code:

  max_freq = MIN(devfreq->scaling_max_freq, devfreq->max_freq);

With the current handling of min/max_freq this is incorrect:

Even though df->max_freq is now initialized to a value != 0 user space
can still set it to 0, in this case max_freq would be 0 instead of
df->scaling_max_freq as intended. In consequence the frequency adjustment
is not performed:

  if (max_freq && freq > max_freq) {
	freq = max_freq;

To fix this set df->min/max freq to the min/max OPP in max/max_freq_store,
when the user passes a value of 0. This also prevents df->max_freq from
being set below the min OPP when df->min_freq is 0, and similar for
min_freq. Since it is now guaranteed that df->min/max_freq can't be 0 the
checks for this case can be removed.

Fixes: f1d981eaec ("PM / devfreq: Use the available min/max frequency")
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
(cherry picked from commit df5cf4a361)

Change-Id: Ib8e2def7d3bf605dba81cf75bab89a23a39ca6f3
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-06-12 09:38:43 +08:00
arch soc: rockchip: Change the parameter of power model for cpu and npu 2019-06-12 09:38:43 +08:00
block Merge remote branch 'android-4.19' of https://android.googlesource.com/kernel/common 2019-02-14 11:48:20 +08:00
certs rk: revert to v4.4 2019-02-10 00:33:21 +08:00
crypto rk: revert to v4.4 2019-02-10 00:33:21 +08:00
Documentation UPSTREAM: usb: dwc3: Add disabling of start_transfer failure quirk 2019-05-16 19:19:54 +08:00
drivers UPSTREAM: PM / devfreq: Fix handling of min/max_freq == 0 2019-06-12 09:38:43 +08:00
firmware kbuild: remove all dummy assignments to obj- 2017-11-18 11:46:06 +09:00
fs f2fs: add a new limit for reserve root 2019-02-25 16:39:12 +08:00
include thermal: trace: Add trace for staitc power 2019-06-12 09:38:43 +08:00
init rk: init/main.c: support print long kernel command line 2019-03-21 19:59:28 +08:00
ipc rk: revert to v4.4 2019-02-10 00:33:21 +08:00
kernel printk: add support show process information on printks 2019-04-19 12:00:55 +08:00
lib printk: add support show process information on printks 2019-04-19 12:00:55 +08:00
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text 2018-10-18 11:28:50 +02:00
mm rk: revert to v4.4 2019-02-10 00:33:21 +08:00
net Merge remote branch 'android-4.19' of https://android.googlesource.com/kernel/common 2019-02-14 11:48:20 +08:00
samples rk: revert to v4.4 2019-02-10 00:33:21 +08:00
scripts ANDROID: rk: kbuild: dtc generation of symbols 2019-02-15 19:57:37 +08:00
security Merge remote branch 'android-4.19' of https://android.googlesource.com/kernel/common 2019-02-14 11:48:20 +08:00
sound ASoC: rockchip: spdif: fix some coding style issues 2019-03-28 22:13:27 +08:00
tools rk: revert to v4.4 2019-02-10 00:33:21 +08:00
usr initramfs: move gen_initramfs_list.sh from scripts/ to usr/ 2018-08-22 23:21:44 +09:00
virt rk: revert to v4.4 2019-02-10 00:33:21 +08:00
.checkpatch.conf
.clang-format clang-format: Set IndentWrappedFunctionNames false 2018-08-01 18:38:51 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore rk: .gitignore: ignore boot.img/kernel.img/resource.img/zboot.mg 2019-02-15 18:31:05 +08:00
.mailmap rk: revert to v4.4 2019-02-10 00:33:21 +08:00
.scmversion
build.config.cuttlefish.aarch64 rk: revert to v4.4 2019-02-10 00:33:21 +08:00
build.config.cuttlefish.x86_64 rk: revert to v4.4 2019-02-10 00:33:21 +08:00
COPYING COPYING: use the new text with points to the license files 2018-03-23 12:41:45 -06:00
CREDITS 9p: remove Ron Minnich from MAINTAINERS 2018-08-17 16:20:26 -07:00
Kbuild rk: revert to v4.4 2019-02-10 00:33:21 +08:00
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt 2018-08-02 08:06:55 +09:00
logo_kernel.bmp
logo.bmp
MAINTAINERS rk: revert to v4.4 2019-02-10 00:33:21 +08:00
Makefile rk: Makefile: fix Revert "x86: Force asm-goto" 2019-02-14 18:26:48 +08:00
README Docs: Added a pointer to the formatted docs to README 2018-03-21 09:02:53 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.