Commit Graph

641788 Commits

Author SHA1 Message Date
Yao.Liu
921c011316 media: video layer keep last frame [2/4]
PD#152306: dont display frames which are dropped by apk

PD#152104: video layer keep last frame

Change-Id: I271ee268b8d768fe42cd60b57d1f10b12fac7fa6
Signed-off-by: Yao.Liu <yao.liu@amlogic.com>
2017-11-28 02:09:03 -07:00
Evoke Zhang
8c1fba7f28 lcd: add gpio support for mipi_dsi init cmd
PD#155126: lcd: add gpio support for mipi_dsi init cmd
add data_type 0xf0 for gpio operation

Change-Id: I58b5fc2456b8ceaf3ca97f3ca1626430d723212d
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
2017-11-27 18:57:45 -07:00
Yi Zhou
fcec451b2d hdmitx: add the hdmi change mode op
PD#153294: hdmitx: add the hdmi change mode op

add switch when changing display mode
if the display mode is NULL, the switch can't be opened.

Change-Id: I2a0bdbda6950c401ad3a7b29d810976436558c14
Signed-off-by: Yi Zhou <yi.zhou@amlogic.com>
Signed-off-by: Kaifu Hu <kaifu.hu@amlogic.com>
2017-11-27 18:55:26 -07:00
Frank Chen
a8aba76b55 dts: axg: modify Audiopdm-in and loopback setting[2/2]
PD#155244: audio: modify pdm-in and loopback setting

support 7 channel pdm-in and 1 channel loopback

Change-Id: Ia8e2314a5f80e0dc5eeee7252af9b836e921873e
Signed-off-by: Frank Chen <frank.chen@amlogic.com>
2017-11-23 18:38:20 -07:00
Bo Yang
84a1058529 watchdog: meson-wdt: fix reboot notify to stop reset
PD#154679: watchdog: meson-wdt: fix reboot notify to stop reset

In some cases, the watchdog reboot notify will not disable
watchdog. The watchdog reset workqueue will continue work
in the first cpu that invokes panic(oops). So the hardware
watchdog will not reboot.

Cancel the delayed workqueue to stop reset the watchdog in
reboot notify.
And move the print message to the right location.

Change-Id: I7d85d49f2f5d780f7c5f2612e64494e77957dfff
Signed-off-by: Bo Yang <bo.yang@amlogic.com>
2017-11-23 15:29:28 +08:00
xingyu.chen
26e3ae09aa adc_keypad: update the property file path
PD#150908: adc_keypad: update the property file path

move the property file "table" from "/sys/devices/platform/adc_keypad/"
to "/sys/class/adc_keypad/"

Change-Id: I99ebb2f49df4ef336a3db422f60cb32a49bf2936
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
2017-11-22 00:39:23 -07:00
siming chen
d5da43e066 dts: add gxl p241 v2 dts[1/3]
PD# 154923: dts: add gxl p241 board v2 dts



Change-Id: Iad6947b9af8bd76b3805cfcf95b2bb0c87ad08f6
Signed-off-by: siming chen <siming.chen@amlogic.com>
2017-11-20 20:27:55 -07:00
binqi.zhang
9896903ded ion_dev: enlarge cma heap size . [1/1]
PD#153134: some dEQP cases should always use direct render

Change-Id: I3d65b7c34e948e5a1f6d5d745713c2caa3eb89d5
Signed-off-by: binqi.zhang <binqi.zhang@amlogic.com>
2017-11-18 04:15:54 -07:00
Nan Li
fa1fa680a2 emmc: driver defect cleanup
PD#152912: driver defect cleanup:
376

Change-Id: I25e7cbdd63b7b797aec17df7b858588e60bb5be7
Signed-off-by: Nan Li <nan.li@amlogic.com>
2017-11-17 01:36:55 -07:00
Baocheng Sun
639e70ce35 defconfig: enable sdcardfs file system support [1/2]
PD#154195: enable sdcardfs file system support

CONFIG_SDCARD_FS=y

Change-Id: I4ec6cac934eaabb3c7c5b0320ded63debc1a8f78
Signed-off-by: Baocheng Sun <baocheng.sun@amlogic.com>
2017-11-16 06:07:11 -07:00
Yi Zeng
92b67373dc nand: fix the bad block awareness error of K9F4G08U0F
PD#153602: fix the bad block awareness error of K9F4G08U0F

The slc-nand K9F4G08U0F has a factory bug, we need send a pre-command
before we send read command to get the block status.

Change-Id: I6468f05d8cf984d70f40abd997395d740c22d5e4
Signed-off-by: Yi Zeng <yi.zeng@amlogic.com>
2017-11-16 03:16:06 -07:00
Nian Jing
3c0ea5f05f cvbs: close cvbsoutput when disable module.
PD#154762: cvbs should be closed when cvbs module disabled

Change-Id: Id1dc4ae24e4eea7671ebffbc0f7767a6b4cc9100
Signed-off-by: Nian Jing <nian.jing@amlogic.com>
2017-11-16 16:36:03 +08:00
Yi Zhou
f0f00eddbf hdmitx: add non-standard hdr treatment mechanism
PD#154082: hdmitx: add non-standard hdr treatment mechanism

1.add non-standard hdr
2.add hlg function

Change-Id: I8a1dbbd1583809b25ef50d6e0bfbfb6e6403b60c
Signed-off-by: Yi Zhou <yi.zhou@amlogic.com>
2017-11-14 21:21:54 -07:00
Victor Wan
ee46236755 Merge branch 'android-4.9' into amlogic-4.9-dev 2017-11-14 17:18:44 +08:00
Yvonne Chen
0395d41260 tee: open tee load support
PD#153479: tee: open tee load support

Change-Id: I45f01f47677e0f8c76624e4f03f033356bb663b6
Signed-off-by: Yvonne Chen <yvonne.chen@amlogic.com>
2017-11-13 19:04:40 -07:00
jintao xu
cededce3ad ionvideo: frame_sync: rm logs for vts
PD#152092: rm logs for vts

Change-Id: I42db4d660fa098a870252426d8e1fafab210c820
Signed-off-by: jintao xu <jintao.xu@amlogic.com>
2017-11-13 03:58:06 -07:00
Jiamin Ma
f7b7bd3df5 efuse: fix INCOMPATIBLE_CAST and NEGATIVE_RETURNS errs
PD#152879: driver defect clean up
 #299
 #300
 #320
 #321

Change-Id: I3756489ea81520ab042c74642b0483f36bff6fba
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
2017-11-12 23:21:16 -07:00
Jiamin Ma
24e08553c1 iomap: remove unnecessary comparison
PD#152908: driver defect clean up

#364
#365
#366

Change-Id: I53c4bd4cbe1cc82408ec3f0b30b3b8e696ea1fc2
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
2017-11-12 23:20:12 -07:00
pengcheng chen
5160004744 osd: add osd dump cmd for drm
PD#152825: add osd dump cmd for drm

Change-Id: I9557ee84cecf00036b6ed59819aedd8e53ec6693
Signed-off-by: pengcheng chen <pengcheng.chen@amlogic.com>
2017-11-12 23:04:49 -07:00
tao zeng
b99ebebc62 mm: close debug print of cma alloc
PD#153120: mm: close debug print of cma alloc

These print message may print a lot when video playback
And cause it not smooth.

Change-Id: I77920e902189ab4aa1ec594d351749ee4aa3a3ee
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
2017-11-12 22:29:12 -07:00
pengcheng chen
e720c7885d osd: fix logo error when plugin hdmi after system power on
PD#152816: osd: fix logo error when plugin hdmi after power on
                by exchange osd and vout probe

Change-Id: Ieb89d12a975813dd238bbe4fa805bc2bcfdd682a
Signed-off-by: pengcheng chen <pengcheng.chen@amlogic.com>
2017-11-10 01:27:31 -07:00
Qiufang Dai
cdc628fd6c clk: axg fix_pll use frac mode
PD#154040: axg fix_pll enable frac mode describe

Change-Id: I1223b5710687a2e9902d953fd7c8eac9c8574f4d
Signed-off-by: Qiufang Dai <qiufang.dai@amlogic.com>
2017-11-10 01:13:34 -07:00
Xing Wang
2cedfd7494 audio: fixed pdm clk and pamaraters for fixed pll decimal mode
PD#154040: fixed pdm record data is only DC value issue.
1. fixed pdm sys clk to 133m
2. fixed sample count according to dclk

Change-Id: Ica8a21c9877c9bf81f157e5590fd08e2860140f9
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
2017-11-10 01:13:12 -07:00
kunpeng.tang
56136d1572 media: ionvideo: fix adaptiveEosFlushSeek bug
PD#152800: init inovideo queue when flush

Change-Id: I3fdf24407586ef191905a37cfad1957dab2c9f6c
Signed-off-by: kunpeng.tang <kunpeng.tang@amlogic.com>
2017-11-10 00:26:13 -07:00
shihong.zheng
442caae23c media: recover calculated disp pts for video
PD#153240: add disp pts in vf for some unstable pts

Change-Id: I1d4cfd04c94feafac109bd69be3bd422aca3d8bf
Signed-off-by: shihong.zheng <shihong.zheng@amlogic.com>
2017-11-09 23:14:50 -07:00
Peipeng Zhao
d383851245 led: fixed led driver for is31fl32xx
PD#154214: fixed led is31fl32xx driver for D605 board

please add CONFIG_LEDS_IS31FL32XX=y on kernel  defconfig

please read Documentation/leds/leds-is31fl32xx.txt
in order to configure dts

Change-Id: Ib9903c5d628fd392bde3787786a4dfb2e90911a6
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
2017-11-09 18:58:24 -07:00
Zhi Zhou
420cb9b88e media: vfm: fixed vfm crash bug [1/1]
PD#141785: fixed vframe provider debug
	merged from 7.1
        for o bug:153539
	old commit:5f5fcfa9c618 & 3bcf5865b002fa
	print info's buffer may freeed so dump old provider
	infos may crash.
	used  buffer array now.

Change-Id: I537f62fda4bd541513b929fa5a2e289b1ea66558
Signed-off-by: Zhi Zhou <zhi.zhou@amlogic.com>
2017-11-09 02:00:54 -07:00
Peipeng Zhao
f6a3271ab8 audio: add audio codec es7243 driver
PD#153483: codec: add sound codec es7243 driver

Change-Id: I3e4e76026bca7ea75df2ad8b0c5e6a730826c4bc
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
2017-11-09 12:22:07 +08:00
Jiamin Ma
8e96d0d385 printk: a fix for log output disordering
PD#154008: the log output is in disorder

The defination for a continues line in printk is much more strict
from 3.14 to 4.9:

in kernel 3.14, if the first fragment does not end with CR, and the
next fragment does not start with LOG_PREFIX(KERN_ALERT, KERN_ERR and
so on), then they are in a continues line

eg. pr_err("foo "); printk("bar\n")
    or pr_err("foo "); pr_cont("bar\n"); both are printing a continues
    line

in kernel 4.9, if only the first fragment does not end with CR, and the
next fragment start with LOG_CONT, then they are in a continues line

eg. pr_err("foo "); printk("bar\n"); are not printing a continues line
    and pr_err("foo "); pr_cont("bar\n"); are printing a continues line

but in the code path of crash info dumping in kernel 4.9.y, not all of
the continues line printing has been switched to the 4.9 way(aka.
calling pr_cont). Only in kernel 4.13.y all of that has been updated.

so in this commit, we lose the definition of continues line back to
3.14 way to sovle current issue, and need to revert it when we sync
with upstream kernel 4.13.y

Change-Id: I64403d3a18531ceb832b41d96dff4b79a6d7fb5a
Signed-off-by: Jiamin Ma <jiamin.ma@amlogic.com>
2017-11-07 22:43:05 -07:00
Yalong Liu
63a6fdd4fa drm: force ARGB8888 format to osd display
PD#152825: convert XRGB8888 to ARGB8888 fomat to osd display

Change-Id: Ia7c7362510d14ecbff5273e1df95f8c5441e0398
Signed-off-by: Yalong Liu <yalong.liu@amlogic.com>
2017-11-07 18:38:04 -07:00
Jakub Kicinski
4ca16e6643 UPSTREAM: security: bpf: replace include of linux/bpf.h with forward declarations
Touching linux/bpf.h makes us rebuild a surprisingly large
portion of the kernel.  Remove the unnecessary dependency
from security.h, it only needs forward declarations.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

(cherry picked from net-next: 1495dc9f0a)
Bug: 30950746

Change-Id: I93d4210845e7e2c748f13e260010b71d91864093
2017-11-07 13:01:06 -08:00
Chenbo Feng
0521e0b3fc UPSTREAM: selinux: bpf: Add addtional check for bpf object file receive
Introduce a bpf object related check when sending and receiving files
through unix domain socket as well as binder. It checks if the receiving
process have privilege to read/write the bpf map or use the bpf program.
This check is necessary because the bpf maps and programs are using a
anonymous inode as their shared inode so the normal way of checking the
files and sockets when passing between processes cannot work properly on
eBPF object. This check only works when the BPF_SYSCALL is configured.

Signed-off-by: Chenbo Feng <fengc@google.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Reviewed-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

(cherry-pick from net-next: f66e448cfd)
Bug: 30950746

Change-Id: I5b2cf4ccb4eab7eda91ddd7091d6aa3e7ed9f2cd
2017-11-07 12:59:54 -08:00
Chenbo Feng
9b62913289 UPSTREAM: selinux: bpf: Add selinux check for eBPF syscall operations
Implement the actual checks introduced to eBPF related syscalls. This
implementation use the security field inside bpf object to store a sid that
identify the bpf object. And when processes try to access the object,
selinux will check if processes have the right privileges. The creation
of eBPF object are also checked at the general bpf check hook and new
cmd introduced to eBPF domain can also be checked there.

Signed-off-by: Chenbo Feng <fengc@google.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

(cherry-pick from net-next: ec27c3568a)
Bug: 30950746
Change-Id: Ifb0cdd4b7d470223b143646b339ba511ac77c156
2017-11-07 12:59:36 -08:00
Chenbo Feng
f3ad3766a9 BACKPORT: security: bpf: Add LSM hooks for bpf object related syscall
Introduce several LSM hooks for the syscalls that will allow the
userspace to access to eBPF object such as eBPF programs and eBPF maps.
The security check is aimed to enforce a per object security protection
for eBPF object so only processes with the right priviliges can
read/write to a specific map or use a specific eBPF program. Besides
that, a general security hook is added before the multiplexer of bpf
syscall to check the cmd and the attribute used for the command. The
actual security module can decide which command need to be checked and
how the cmd should be checked.

Signed-off-by: Chenbo Feng <fengc@google.com>
Acked-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Added the LIST_HEAD_INIT call for security hooks, it nolonger exist in
uptream code.
(cherry-pick from net-next: afdb09c720)
Bug: 30950746

Change-Id: Ieb3ac74392f531735fc7c949b83346a5f587a77b
2017-11-07 12:59:20 -08:00
Chenbo Feng
4672ded3ec BACKPORT: bpf: Add file mode configuration into bpf maps
Introduce the map read/write flags to the eBPF syscalls that returns the
map fd. The flags is used to set up the file mode when construct a new
file descriptor for bpf maps. To not break the backward capability, the
f_flags is set to O_RDWR if the flag passed by syscall is 0. Otherwise
it should be O_RDONLY or O_WRONLY. When the userspace want to modify or
read the map content, it will check the file mode to see if it is
allowed to make the change.

Signed-off-by: Chenbo Feng <fengc@google.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

Deleted the file mode configuration code in unsupported map type and
removed the file mode check in non-existing helper functions.
(cherry-pick from net-next: 6e71b04a82)
Bug: 30950746

Change-Id: Icfad20f1abb77f91068d244fb0d87fa40824dd1b
2017-11-07 12:47:56 -08:00
liangzhuo.xie
bcc77e8542 dts: create p230 buildroot dts
PD#146897: create p230 buildroot dts.[2/2]

Change-Id: If1ad7718cad1c52ece538dd06288ab7d3905e1c5
Signed-off-by: liangzhuo.xie <liangzhuo.xie@amlogic.com>
2017-11-07 05:20:49 -07:00
tao zeng
42ef1cc737 mm: change memory pre-alloc of page trace
PD#153090: mm: change memory pre-alloc of page trace

Use standard API of alloc_page* instead of directly delete page
lru from buddy.

Change-Id: Ia537d39f5d4e7e66c2c36eeeaf837b09bbccebff
Signed-off-by: tao zeng <tao.zeng@amlogic.com>
2017-11-07 03:46:52 -07:00
Xindong Xu
5281102bdc PD#153899: p241: add arch/arm64/boot/dts/amlogic/gxl_p241_1g.dts [2/2]
1. init gxl_p241_1g.dts from gxl_p241_1g_buildroot.dts
2. change gxl_p241_1g.dts accord to gxl_p212_1g.dts in
   4.9 & gxl_p241_1g.dts in 3.14

Change-Id: I73ab298776ca257f79f4f54b5a4e619dd8af1a15
Signed-off-by: Xindong Xu <xindong.xu@amlogic.com>
2017-11-07 00:50:13 -07:00
Viresh Kumar
e0907557ef cpufreq: Drop schedfreq governor
We all should be using (and improving) the schedutil governor now. Get
rid of the non-upstream governor.

Tested on Hikey.

Change-Id: I2104558b03118b0a9c5f099c23c42cd9a6c2a963
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2017-11-07 10:31:04 +05:30
liangzhuo.xie
35ca293b34 dts: fix the boot-strap crash
PD#152825: fix the boot-strap crash

Change-Id: I427e09237b8fef508f129b509d5045eae7bd2149
Signed-off-by: liangzhuo.xie <liangzhuo.xie@amlogic.com>
2017-11-07 11:11:00 +08:00
Kuibao Zhang
6e9a95794a defconfig: meson64: add CONFIG_HIDRAW
PD#150889: Support Android O BT remote audio

1.CONFIG_HIDRAW=y

Change-Id: I21cf8d6f33c11477f8d54295c48dc9fdb752ec37
Signed-off-by: Kuibao Zhang <kuibao.zhang@amlogic.com>
2017-11-06 05:10:12 -07:00
Chris Redpath
dfe0a9bcfc Merge branch 'ack/android-4.9-eas-dev' into ack/android_4.9/merge_eas_dev_r1.4
Merge in the EAS r1.4 patches from eas-dev to 4.9 common branch.

There is one patch in android-4.9-eas-dev which is not part of the 1.4
patches
  ANDROID: sched/fair: Select correct capacity state for energy_diff
but we have already merged it into android-4.4 so in the interests
of keeping aligned, let's include that in the merge.

Merge Log:
* ack/android-4.9-eas-dev:
  sched: EAS: Fix the condition to distinguish energy before/after
  sched: EAS: update trg_cpu to backup_cpu if no energy saving for target_cpu
  sched/fair: consider task utilization in group_max_util()
  sched/fair: consider task utilization in group_norm_util()
  sched/fair: enforce EAS mode
  sched/fair: ignore backup CPU when not valid
  sched/fair: trace energy_diff for non boosted tasks
  UPSTREAM: sched/fair: Sync task util before slow-path wakeup
  UPSTREAM: sched/core: Add missing update_rq_clock() call in set_user_nice()
  UPSTREAM: sched/core: Add missing update_rq_clock() call for task_hot()
  UPSTREAM: sched/core: Add missing update_rq_clock() in detach_task_cfs_rq()
  UPSTREAM: sched/core: Add missing update_rq_clock() in post_init_entity_util_avg()
  UPSTREAM: sched/fair: Fix task group initialization
  cpufreq/sched: Consider max cpu capacity when choosing frequencies
  cpufreq/sched: Use cpu max freq rather than policy max
  sched/fair: remove erroneous RCU_LOCKDEP_WARN from start_cpu()
  ANDROID: sched/fair: Select correct capacity state for energy_diff
  UPSTREAM: sched/fair: Fix usage of find_idlest_group() when the local group is idlest
  UPSTREAM: sched/fair: Fix usage of find_idlest_group() when no groups are allowed
  UPSTREAM: sched/fair: Fix find_idlest_group() when local group is not allowed
  UPSTREAM: sched/fair: Remove unnecessary comparison with -1
  UPSTREAM: sched/fair: Move select_task_rq_fair() slow-path into its own function
  UPSTREAM: sched/fair: Force balancing on NOHZ balance if local group has capacity
  UPSTREAM: sched: use load_avg for selecting idlest group
  UPSTREAM: sched: fix find_idlest_group for fork

Change-Id: I57bc516f9c804bfc7144a6a5bcf70572d82f7321
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
2017-11-03 13:51:48 +00:00
Hui Zhang
4425d2ecd9 PD#153316: media: sync decoder code with 3.14 trunk
add two ioctl defines which used in media module

Change-Id: Ie4bde7b9c3803b767bef66e1edf3078b771870d8
Signed-off-by: Hui Zhang <hui.zhang@amlogic.com>
2017-11-02 20:19:25 -07:00
Evgenii Stepanov
b4ace31b10 ANDROID: Revert "arm64: move ELF_ET_DYN_BASE to 4GB / 4MB"
Part of the above change was reverted in 240628085effc47e86f51fc3fb37bc0e628f9a85;
this change reverts the rest.

This ARM mmap change breaks AddressSanitizer:

Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.

Revert it until ASAN runtime library is updated to handle it.

Bug: 67425063

Signed-off-by: Evgenii Stepanov <eugenis@google.com>
2017-11-02 19:09:41 +00:00
Evgenii Stepanov
089ea43276 ANDROID: Revert "arm: move ELF_ET_DYN_BASE to 4MB"
This ARM mmap change breaks AddressSanitizer:

Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.

Revert it until ASAN runtime library is updated to handle it.

Bug: 67425063

This reverts commit d2471b5e84.

Signed-off-by: Evgenii Stepanov <eugenis@google.com>
2017-11-02 19:09:28 +00:00
Ke Wang
c409b20240 sched: EAS: Fix the condition to distinguish energy before/after
Before commit 5f8b3a757d ("sched/fair: consider task utilization in
group_norm_util()"), eenv->util_delta is used to distinguish energy
before and energy after in sched_group_energy(). After that commit,
eenv->util_delta can not do that any more.

In this commit, use trg_cpu to distinguish energy before/after in
sched_group_energy().

Before apply this commit, cap_before/cap_delta is not correct:
<idle>-0 [001] 147504.608920: sched_energy_diff: pid=7 comm=rcu_preempt
src_cpu=1 dst_cpu=3 usage_delta=7 nrg_before=250 nrg_after=250 nrg_diff=0
cap_before=0 cap_after=528 cap_delta=1056 nrg_delta=0 nrg_payoff=0

After apply this commit, cap_before/cap_delta retrun to normal:
<idle>-0 [001] 220.494011: sched_energy_diff:    pid=7 comm=rcu_preempt
src_cpu=1 dst_cpu=2 usage_delta=3 nrg_before=248 nrg_after=248 nrg_diff=0
cap_before=528 cap_after=528 cap_delta=0 nrg_delta=0 nrg_payoff=0

Change-Id: I7b5f7ccce56e93af7ea4e87d8e0ea6e2405f9c27
Signed-off-by: Ke Wang <ke.wang@spreadtrum.com>
(cherry picked from commit 0da783a605cd20d5a37c2a840e8a1fa641c09768)
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
2017-11-02 18:24:24 +00:00
Ke Wang
ece6d3b76e sched: EAS: update trg_cpu to backup_cpu if no energy saving for target_cpu
If no energy saving for target_cpu in the calculation of energy_diff(),
backup_cpu will be set as the new dst_cpu for the next calculation. At this
point, we also need update the new trg_cpu as backup_cpu to make sure the
subsequent calculation of energy_diff() is correct.

Change-Id: If3b35b6dc54865f1cb4b1603134102d4422227d5
Signed-off-by: Ke Wang <ke.wang@spreadtrum.com>
(cherry picked from commit b1923e22f4eca3e537e015d6ea3dce1187edea37)
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
2017-11-02 18:24:04 +00:00
Patrick Bellasi
06d637c9f9 sched/fair: consider task utilization in group_max_util()
The group_max_util() function is used to compute the maximum utilization
across the CPUs of a certain energy_env configuration.
Its main client is the energy_diff function when it needs to compute the
SG capacity for one of the before/after scheduling candidates.

Currently, the energy_diff function sets util_delta = 0 when it wants to
compute the energy corresponding to the scheduling candidate where the
task runs in the previous CPU. This implies that, for the task waking up
in the previous CPU we consider only its blocked load tracked by the CPU
RQ. However, in case of a medium-big task which is waking up on a long
time idle CPU, this blocked load can be already completely decayed.

More in general, the current approach is biased towards under-estimating
the capacity requirements for the "before" scheduling candidate.

This patch fixes this by:
- always use the cpu_util_wake() to properly get the utilization of a CPU
  without any (partially decayed) contribution of the waking up task
- adding the task utilization to the cpu_util_wake just for the target
  cpu

The "target CPU" is defined by the energy_env to be either the src_cpu or
the dst_cpu, depending on which scheduling candidate we are considering.

Finally, since this update removes the last usage of calc_util_delta()
this function is now safely removed.

Change-Id: I20ee1bcf40cee6bf6e265fb2d32ef79061ad6ced
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
(cherry picked from commit 52d70152fade678e304683bd1a5842af95e83558)
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
2017-11-02 18:23:46 +00:00
Chris Redpath
4530ed9a46 sched/fair: consider task utilization in group_norm_util()
The group_norm_util() function is used to compute the normalized
utilization of a SG given a certain energy_env configuration.
The main client of this function is the energy_diff function when it
comes to compute the SG energy for one of the before/after scheduling
candidates.

Currently, the energy_diff function sets util_delta = 0 when it wants to
compute the energy corresponding to the scheduling candidate where the
task runs in the previous CPU. This implies that, for the task waking up
in the previous CPU we consider only its blocked load tracked by the CPU
RQ. However, in case of a medium-big task which is waking up on a long
time idle CPU, this blocked load can be already completely decayed.

More in general, the current approach is biased towards under-estimating
the energy consumption for the "before" scheduling candidate.

This patch fixes this by:
- always use the cpu_util_wake() to properly get the utilization of a CPU
  without any (partially decayed) contribution of the waking up task
- adding the task utilization to the cpu_util_wake just for the
  target cpu

The "target CPU" is defined by the energy_env to be either the src_cpu
or the dst_cpu, depending on which scheduling candidate we are
considering.

This patch update also the definition of __cpu_norm_util(), which is
currently called just by the group_norm_util() function. This allows to
simplify the code by using this function just to normalize a specified
utilization with respect to a given capacity.

This update allows to completely remove any dependency of
group_norm_util() from calc_util_delta().

Change-Id: I3b6ec50ce8decb1521faae660e326ab3319d3c82
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
(cherry picked from commit ef34ea830347ca175ba8a1baf05357ed98d5728c)
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
2017-11-02 18:23:26 +00:00
Patrick Bellasi
1e58674375 sched/fair: enforce EAS mode
For non latency sensitive tasks the goal is to optimize for energy efficiency.
Thus, we should try our best to avoid moving a task on a CPU which is then
going to be marked as overutilized.

Let's use the capacity_margin metric to verify if a candidate target CPU
should be considered without risking to bail out of EAS mode.

Change-Id: Ib3697106f4073aedf4a6c6ce42bd5d000fa8c007
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
(cherry picked from commit f95753da4ba7e1c1eee0500ffe41b3e5fa68b347)
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
2017-11-02 18:23:06 +00:00