Commit Graph

204 Commits

Author SHA1 Message Date
Liang Chen
1641eb4fc2 PM / devfreq: adjust opp-table by board IR-Drop
Change-Id: I94280b3f4a122961c0201cf9f8fbf5dc34058581
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-03-16 17:49:29 +08:00
Tao Huang
3430c68a33 Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
* linux-linaro-lsk-v4.4-android: (660 commits)
  ANDROID: keychord: Check for write data size
  ANDROID: sdcardfs: Set num in extension_details during make_item
  ANDROID: sdcardfs: Hold i_mutex for i_size_write
  BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck64-XTS
  BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck128-XTS
  BACKPORT, FROMGIT: crypto: arm/speck - add NEON-accelerated implementation of Speck-XTS
  FROMGIT: crypto: speck - export common helpers
  BACKPORT, FROMGIT: crypto: speck - add support for the Speck block cipher
  UPSTREAM: ANDROID: binder: synchronize_rcu() when using POLLFREE.
  f2fs: updates on v4.16-rc1
  BACKPORT: tee: shm: Potential NULL dereference calling tee_shm_register()
  BACKPORT: tee: shm: don't put_page on null shm->pages
  BACKPORT: tee: shm: make function __tee_shm_alloc static
  BACKPORT: tee: optee: check type of registered shared memory
  BACKPORT: tee: add start argument to shm_register callback
  BACKPORT: tee: optee: fix header dependencies
  BACKPORT: tee: shm: inline tee_shm_get_id()
  BACKPORT: tee: use reference counting for tee_context
  BACKPORT: tee: optee: enable dynamic SHM support
  BACKPORT: tee: optee: add optee-specific shared pool implementation
  ...

Conflicts:
	drivers/irqchip/Kconfig
	drivers/media/i2c/tc35874x.c
	drivers/media/v4l2-core/v4l2-compat-ioctl32.c
	drivers/usb/gadget/function/f_fs.c
	fs/f2fs/node.c

Change-Id: Icecd73a515821b536fa3d81ea91b63d9b3699916
2018-03-09 19:10:14 +08:00
Liang Chen
3efb6d37bd PM / devfreq: record opp rate instead of real clock rate for thermal
Opp rate is used to calc power in thermal framework, so we record
this rate instead of real clock rate.
Devfreq is not ready in target() when use performance governor, so
we need record opp rate in probe().

Change-Id: Iec1918ad5d12124b9f112964f247339e0d50645f
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-03-08 15:08:36 +08:00
Liang Chen
385761959c PM / devfreq: rockchip_dmc: protect video_info_list with mutex
When multiple videos are playback at the same time, video_info_list
may be damaged, so we need protect the list with a muxte_lock.

Change-Id: I7f9ab8d9a9cd29b69550b47d1b35b6645357b0b0
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-02-28 09:36:02 +08:00
Bjorn Andersson
8bb3fe364f PM / devfreq: Propagate error from devfreq_add_device()
commit d1bf2d30728f310f72296b54f0651ecdb09cbb12 upstream.

Propagate the error of devfreq_add_device() in devm_devfreq_add_device()
rather than statically returning ENOMEM. This makes it slightly faster
to pinpoint the cause of a returned error.

Fixes: 8cd84092d3 ("PM / devfreq: Add resource-managed function for devfreq device")
Cc: stable@vger.kernel.org
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22 15:44:58 +01:00
YouMin Chen
3f9d4749de PM / devfreq: event: add support for px30 dfi
Change-Id: Ib6808d961b65d993fea05ab15d648d814d14a4a2
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-02-08 14:53:27 +08:00
YouMin Chen
8865f61ad2 PM / devfreq: rockchip_dmc: add support for px30
Change-Id: I225088ce179f9b9cd62fce256b87bccb591fd2b2
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-02-08 14:52:32 +08:00
Rocky Hao
f417571488 PM / devfreq: rockchip_dmc: record opp rate instead of real clock rate
opp rate is used to calc power in thermal framework, so we record this rate
instead of real clock rate.

Change-Id: Ic51a8c36be8d63fcf765e6d49930d1d437a2e502
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2018-02-08 09:47:01 +08:00
Finley Xiao
3aa3d78ce1 PM / devfreq: rockchip_dmc: Disable auto-freq if events is disabled
Change-Id: Ia39dfc884feea8cb6c29a7ed293bb567aca15b83
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-08 09:46:14 +08:00
Liang Chen
f06ee6308f PM / devfreq: rockchip_dmc: add support for rk3228
Change-Id: I3943716a66b3c0849d815b7f69cc0bbd843d7e4e
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-02-08 09:37:30 +08:00
Rocky Hao
33b1e41afd PM / devfreq: rockchip_dmc: pass a pointer to devfreq in bandwidth request/update actions
By passing a pointer to struct devfreq, we can fix global data abuse issue.

Change-Id: I17f6264b86549f67d61d03f38da0127e666eee3c
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2018-01-23 14:18:50 +08:00
Rocky Hao
0ea4217387 PM / devfreq: rockchip_dmc: init and update last_status
Last_status is used to calculate dmc's power in thermal control.
If last_status is neithor inited nor kept updated, the power model will
get the wrong status and then the wrong power. And dmc gets wrong
cooling state at last.
Meanwhile this issue reports the  warning "core: dev_pm_opp_get_voltage
: Invalid parameters"

Change-Id: Ic371796ad94fd6dab376fefbea91adff0068d26b
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2018-01-12 19:17:11 +08:00
Rocky Hao
5172573fa1 PM / devfreq: rockchip_dmc: optimize thermal control code
use framework internal dynamic power calc function. Do not use
global data, rk_dmcfreq.

Change-Id: I1f46b2471b5d25a9233724fdd61efe63ea13b860
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2018-01-12 14:30:19 +08:00
CanYang He
96312b689d PM / devfreq: rockchip_dmc: fix rk3328 of_get_ddr_timings fail
because of_parse_phandle() phandle_name parameter incorrect

Change-Id: Ic1b2cf7b1a7331aff52102a863e97a937677f2ae
Signed-off-by: CanYang He <hcy@rock-chips.com>
2018-01-08 21:01:19 +08:00
Javi Merino
5dcb4226bb BACKPORT: devfreq_cooling: pass a pointer to devfreq in the power model callbacks
When the devfreq cooling device was designed, it was an oversight not to
pass a pointer to the struct devfreq as the first parameters of the
callbacks.  The design patterns of the kernel suggest it for a good
reason.

By passing a pointer to struct devfreq, the driver can register one
function that works with multiple devices.  With the current
implementation, a driver that can work with multiple devices has to
create multiple copies of the same function with different parameters so
that each devfreq_cooling_device can use the appropriate one.  By
passing a pointer to struct devfreq, the driver can identify which
device it's referring to.

Change-Id: I384bf9aafd2391eccab2ca6a76e4e57f2740aa6b
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Reviewed-by: Punit Agrawal <punit.agrawal@arm.com>
Reviewed-by: Ørjan Eide <orjan.eide@arm.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 3aa5374376746f20a27be8682be7f91c8b71d1d8)
2018-01-04 09:22:34 +08:00
Liang Chen
17efab953d soc: rockchip: add functions to select opp level form device-tree
Some chips need adjust opp level by different chip-process, add
common functions to select opp level from device-tree, so modules
can select opp level easy.

Change-Id: Ifbd5f720e6a52a68f13697bbb37ac01ff4a87e3e
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-01-02 10:21:39 +08:00
Hecanyang
4807c45f72 PM / devfreq: rockchip_dmc: add support for rk3328
This adds the necessary data for handling dmcfreq on the rk3328

Change-Id: If4cff5cc372f80b6776a7272a1bff54abef2cf33
Signed-off-by: CanYang He <hcy@rock-chips.com>
2017-12-28 08:48:54 +08:00
Hecanyang
3397fb4994 PM / devfreq: event: add support for rk3328 dfi
This adds the necessary data for handling dfi on the rk3328.

Change-Id: Id870f78dad3ddd6cb5771674a4e8905322f9e8ef
Signed-off-by: CanYang He <hcy@rock-chips.com>
2017-12-28 08:48:23 +08:00
Hecanyang
3943bc44aa PM / devfreq: event: make dfi more extension
after modify, rockchip_dfi_ops can apply to other platform use such
version ddr monitor. regardless of channel count, only one channel
of rk3288,rk3399,rk3328 can work. and regardless of monitor clk,
some platform like rk3328 monitor clk is always on.

Change-Id: Ia1c02a89116546ded385c5a6a3e36d020d66b7f3
Signed-off-by: CanYang He <hcy@rock-chips.com>
2017-12-28 08:47:43 +08:00
Rocky Hao
e422847701 PM / devfreq: rockchip_dmc: add thermal control support
add rockchip_dmc as a cooling device in thermal control

Change-Id: Iefb046a104eb2205f2ef17dd80bb31fd75b42c90
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2017-12-26 19:46:01 +08:00
Finley Xiao
ccfeccfe22 PM / devfreq: event: Add new Rockchip NoC probe driver
This patch adds NoC (Network on Chip) Probe driver which provides
the primitive values to get the performance data. For example, RK3399
has multiple NoC probes to monitor traffic statistics for analyzing
the transaction flow.

Change-Id: I66f6708f0d244488ca08f0f1f1cb36b19c7a2d0a
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-11-21 20:24:57 +08:00
Wyon Bi
c9d26e763b PM / devfreq: rockchip_dmc: Fix compiler warning
drivers/devfreq/rockchip_dmc.c: In function 'rk3368_dmc_init':
drivers/devfreq/rockchip_dmc.c:649:7: warning: 'ret' may be used uninitialized in this function [-Wuninitialized]
drivers/devfreq/rockchip_dmc.c:639:6: note: 'ret' was declared here

Change-Id: I843b7a4a0804bcf02152ba3218dcefa26d047c95
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2017-10-18 14:32:48 +08:00
YouMin Chen
b9d770c7de PM / devfreq: rockchip_dmc: add auto_lp_dis_freq to rk3399 dram timing table
When DRAM frequency greater than or equal to this setting value,
the function of auto power-down will disable.

Change-Id: I0c7faee045ff00de0dc36adc45e21389c41aa81f
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2017-09-20 11:31:08 +08:00
YouMin Chen
4625e95606 PM / devfreq: rockchip_dmc: modify rk3399 dram default timing
Change-Id: I1af3177d78240c0767a4a71f4f085b55b2d7a2c6
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2017-09-20 11:30:58 +08:00
Finley Xiao
f6c39e35ad PM / devfreq: rockchip_dmc: Add dmc_ondemand governor
The dmc driver supports changing min_freq and max_freq according to
system status and vop bandwidth at present. But even if user changes
governor to userspace, the ddr frequency may also change constantly.

This patch adds a new dmc_ondemand governor which doesn't chang min_freq
and max_freq, it can also support changing ddr frequecy based on usage,
system status and vop bandwidth. So users can set their own frequency by
the userspace governor.

Change-Id: Ib731f29a6ded3b7f05e60cbae4f858e6beeac9da
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-09-20 09:42:56 +08:00