Merge remote-tracking branch 'origin/auto-kernel' into auto-kernel-oss
* origin/auto-kernel: iMMENSITY: add gcc build script README: sync with kernel ARM64: configs: raphael: disable msm performance driver ANDROID: raphael_defconfig: Disable CONFIG_RT_GROUP_SCHED ARM64: configs: raphael: remove unused governors and CONFIG_CPU_BOOST Makefile: Optimize CPU setup with GCC Kbuild: allowing forcing ccache with shell script sm8150: fix gcc-10.1.0 warnings kbuild: Increase automatic inline instruction limit to 1000 for gcc-10 Revert "ipa3:msm: Added debugfs support for drop packet stats" Revert "Revert "sched: turn off the TTWU_QUEUE feature"" Revert "sched/core: Ensure cpu number is valid" sched/energy: Check out to Android 4.14 common kernel ARM: dts: sm8150: Correct off-by-one error for big CPU capacity ARM: dts: sm8150: Correct off-by-one error for little CPU capacity ARM: dts: sm8150: Re-calculate max CPU capacities Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -132,5 +132,6 @@ kernel/configs/android-*.cfg
|
||||
Android.bp
|
||||
build.sh
|
||||
build-lto.sh
|
||||
gcc.sh
|
||||
upload.sh
|
||||
out/
|
||||
|
||||
19
Makefile
19
Makefile
@@ -361,8 +361,16 @@ HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS 2>/dev/null)
|
||||
HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null)
|
||||
HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null)
|
||||
|
||||
CCACHE := $(shell which ccache)
|
||||
|
||||
ifdef KERNEL_USE_CCACHE
|
||||
HOSTCC = $(CCACHE) gcc
|
||||
HOSTCXX = $(CCACHE) g++
|
||||
$(info # BUILDING WITH CCACHE)
|
||||
else
|
||||
HOSTCC = gcc
|
||||
HOSTCXX = g++
|
||||
endif
|
||||
HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \
|
||||
-fomit-frame-pointer -std=gnu89 -pipe $(HOST_LFS_CFLAGS)
|
||||
HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS)
|
||||
@@ -377,7 +385,11 @@ endif
|
||||
# Make variables (CC, etc...)
|
||||
AS = $(CROSS_COMPILE)as
|
||||
LD = $(CROSS_COMPILE)ld
|
||||
ifdef KERNEL_USE_CCACHE
|
||||
CC = $(CCACHE) $(CROSS_COMPILE)gcc
|
||||
else
|
||||
CC = $(CROSS_COMPILE)gcc
|
||||
endif
|
||||
LDGOLD = $(CROSS_COMPILE)ld.gold
|
||||
LDLLD = ld.lld
|
||||
CPP = $(CC) -E
|
||||
@@ -427,6 +439,10 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -pipe \
|
||||
-Werror-implicit-function-declaration \
|
||||
-Wno-format-security \
|
||||
-std=gnu89
|
||||
|
||||
# Avoid gcc-10 regression
|
||||
KBUILD_CFLAGS += --param=max-inline-insns-auto=1000
|
||||
|
||||
KBUILD_CPPFLAGS := -D__KERNEL__
|
||||
KBUILD_AFLAGS_KERNEL :=
|
||||
KBUILD_CFLAGS_KERNEL :=
|
||||
@@ -707,7 +723,8 @@ else
|
||||
KBUILD_CFLAGS += -O2
|
||||
ifeq ($(cc-name),gcc)
|
||||
KBUILD_CFLAGS += -O3
|
||||
KBUILD_CFLAGS += -mcpu=cortex-a76.cortex-a55 -mtune=cortex-a76.cortex-a55
|
||||
KBUILD_CFLAGS += $(call cc-option, -mcpu=cortex-a76.cortex-a55+crc+crypto)
|
||||
KBUILD_CFLAGS += $(call cc-option, -mtune=cortex-a76.cortex-a55)
|
||||
endif
|
||||
ifeq ($(cc-name),clang)
|
||||
KBUILD_CFLAGS += -O3
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# iMMENSITY KERNEL for Redmi K20pro and Mi9Tpro
|
||||
# iMMENSITY KERNAL for RedmiK20pro / Mi9Tpro
|
||||
|
||||

|
||||
|
||||
> Based on the Qualcomm AUTO tag **LE.UM.4.2.1.r1-02600-QCS404.0**
|
||||
> Merged AOSP kernel_common/android-4.14-stable [4.14.184]
|
||||
> Current CAF tag: **LV.AU.0.1.0.r2-02000-qtiquingvm.0**
|
||||
> Merged AOSP kernel_common/android-4.14-stable [4.14.185]
|
||||
> Current CAF tag: **LE.UM.4.1.1.r1-00300-sa515m**
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
compatible = "arm,armv8";
|
||||
reg = <0x0 0x0>;
|
||||
enable-method = "psci";
|
||||
capacity-dmips-mhz = <1024>;
|
||||
capacity-dmips-mhz = <447>;
|
||||
next-level-cache = <&L2_0>;
|
||||
sched-energy-costs = <&CPU_COST_0 &CLUSTER_COST_0>;
|
||||
qcom,lmh-dcvs = <&lmh_dcvs0>;
|
||||
@@ -111,7 +111,7 @@
|
||||
compatible = "arm,armv8";
|
||||
reg = <0x0 0x100>;
|
||||
enable-method = "psci";
|
||||
capacity-dmips-mhz = <1024>;
|
||||
capacity-dmips-mhz = <447>;
|
||||
next-level-cache = <&L2_1>;
|
||||
sched-energy-costs = <&CPU_COST_0 &CLUSTER_COST_0>;
|
||||
qcom,lmh-dcvs = <&lmh_dcvs0>;
|
||||
@@ -142,7 +142,7 @@
|
||||
compatible = "arm,armv8";
|
||||
reg = <0x0 0x200>;
|
||||
enable-method = "psci";
|
||||
capacity-dmips-mhz = <1024>;
|
||||
capacity-dmips-mhz = <447>;
|
||||
next-level-cache = <&L2_2>;
|
||||
sched-energy-costs = <&CPU_COST_0 &CLUSTER_COST_0>;
|
||||
qcom,lmh-dcvs = <&lmh_dcvs0>;
|
||||
@@ -173,7 +173,7 @@
|
||||
compatible = "arm,armv8";
|
||||
reg = <0x0 0x300>;
|
||||
enable-method = "psci";
|
||||
capacity-dmips-mhz = <1024>;
|
||||
capacity-dmips-mhz = <447>;
|
||||
next-level-cache = <&L2_3>;
|
||||
sched-energy-costs = <&CPU_COST_0 &CLUSTER_COST_0>;
|
||||
qcom,lmh-dcvs = <&lmh_dcvs0>;
|
||||
@@ -204,7 +204,7 @@
|
||||
compatible = "arm,armv8";
|
||||
reg = <0x0 0x400>;
|
||||
enable-method = "psci";
|
||||
capacity-dmips-mhz = <1740>;
|
||||
capacity-dmips-mhz = <1025>;
|
||||
next-level-cache = <&L2_4>;
|
||||
sched-energy-costs = <&CPU_COST_1 &CLUSTER_COST_1>;
|
||||
qcom,lmh-dcvs = <&lmh_dcvs1>;
|
||||
@@ -244,7 +244,7 @@
|
||||
compatible = "arm,armv8";
|
||||
reg = <0x0 0x500>;
|
||||
enable-method = "psci";
|
||||
capacity-dmips-mhz = <1740>;
|
||||
capacity-dmips-mhz = <1025>;
|
||||
next-level-cache = <&L2_5>;
|
||||
sched-energy-costs = <&CPU_COST_1 &CLUSTER_COST_1>;
|
||||
qcom,lmh-dcvs = <&lmh_dcvs1>;
|
||||
@@ -284,7 +284,7 @@
|
||||
compatible = "arm,armv8";
|
||||
reg = <0x0 0x600>;
|
||||
enable-method = "psci";
|
||||
capacity-dmips-mhz = <1740>;
|
||||
capacity-dmips-mhz = <1025>;
|
||||
next-level-cache = <&L2_6>;
|
||||
sched-energy-costs = <&CPU_COST_1 &CLUSTER_COST_1>;
|
||||
qcom,lmh-dcvs = <&lmh_dcvs1>;
|
||||
@@ -324,7 +324,7 @@
|
||||
compatible = "arm,armv8";
|
||||
reg = <0x0 0x700>;
|
||||
enable-method = "psci";
|
||||
capacity-dmips-mhz = <1740>;
|
||||
capacity-dmips-mhz = <1024>;
|
||||
next-level-cache = <&L2_7>;
|
||||
sched-energy-costs = <&CPU_COST_2 &CLUSTER_COST_2>;
|
||||
qcom,lmh-dcvs = <&lmh_dcvs1>;
|
||||
|
||||
@@ -152,7 +152,7 @@ CONFIG_BLK_CGROUP=y
|
||||
CONFIG_CGROUP_WRITEBACK=y
|
||||
CONFIG_CGROUP_SCHED=y
|
||||
CONFIG_FAIR_GROUP_SCHED=y
|
||||
CONFIG_RT_GROUP_SCHED=y
|
||||
# CONFIG_RT_GROUP_SCHED is not set
|
||||
# CONFIG_CGROUP_PIDS is not set
|
||||
# CONFIG_CGROUP_RDMA is not set
|
||||
CONFIG_CGROUP_FREEZER=y
|
||||
@@ -723,7 +723,6 @@ CONFIG_ARM_CPUIDLE=y
|
||||
#
|
||||
CONFIG_CPU_FREQ=y
|
||||
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
|
||||
CONFIG_CPU_FREQ_GOV_COMMON=y
|
||||
CONFIG_CPU_FREQ_STAT=y
|
||||
CONFIG_CPU_FREQ_TIMES=y
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
|
||||
@@ -735,10 +734,10 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE is not set
|
||||
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
|
||||
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
|
||||
CONFIG_CPU_FREQ_GOV_USERSPACE=y
|
||||
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
|
||||
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
|
||||
CONFIG_CPU_BOOST=y
|
||||
# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
|
||||
# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
|
||||
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
|
||||
# CONFIG_CPU_BOOST is not set
|
||||
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
|
||||
# CONFIG_CPU_FREQ_GOV_INTERACTIVE is not set
|
||||
|
||||
@@ -4134,7 +4133,7 @@ CONFIG_MEM_SHARE_QMI_SERVICE=y
|
||||
# CONFIG_MSM_HAB is not set
|
||||
# CONFIG_MSM_AGL is not set
|
||||
# CONFIG_QCOM_HGSL_TCSR_SIGNAL is not set
|
||||
CONFIG_MSM_PERFORMANCE=y
|
||||
# CONFIG_MSM_PERFORMANCE is not set
|
||||
CONFIG_QCOM_QHEE_ENABLE_MEM_PROTECTION=y
|
||||
CONFIG_QCOM_SMP2P_SLEEPSTATE=y
|
||||
CONFIG_QCOM_CDSP_RM=y
|
||||
|
||||
@@ -183,7 +183,7 @@ static irqreturn_t nqx_dev_irq_handler(int irq, void *dev_id)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static int is_data_available_for_read(struct nqx_dev *nqx_dev)
|
||||
static __maybe_unused int is_data_available_for_read(struct nqx_dev *nqx_dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -141,10 +141,6 @@ out:
|
||||
#ifndef CONFIG_MODULES
|
||||
static int __init of_free_phandle_cache(void)
|
||||
{
|
||||
const char *name;
|
||||
struct kobject *parent;
|
||||
struct property *pp;
|
||||
int rc;
|
||||
unsigned long flags;
|
||||
|
||||
if (!of_kset)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
@@ -2051,81 +2051,6 @@ static ssize_t ipa_debugfs_print_drop_stats(struct file *file,
|
||||
return simple_read_from_buffer(ubuf, count, ppos, dbg_buff, nbytes);
|
||||
}
|
||||
|
||||
static ssize_t ipa_debugfs_enable_disable_drop_stats(struct file *file,
|
||||
const char __user *ubuf, size_t count, loff_t *ppos)
|
||||
{
|
||||
unsigned long missing;
|
||||
unsigned int pipe_num = 0;
|
||||
bool enable_pipe = true;
|
||||
u32 pipe_bitmask = ipa3_ctx->hw_stats.drop.init.enabled_bitmask;
|
||||
char seprator = ',';
|
||||
int i, j;
|
||||
bool is_pipe = false;
|
||||
ssize_t ret;
|
||||
|
||||
mutex_lock(&ipa3_ctx->lock);
|
||||
if (sizeof(dbg_buff) < count + 1) {
|
||||
ret = -EFAULT;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
missing = copy_from_user(dbg_buff, ubuf, count);
|
||||
if (missing) {
|
||||
ret = -EFAULT;
|
||||
goto bail;
|
||||
}
|
||||
dbg_buff[count] = '\0';
|
||||
IPADBG("data is %s", dbg_buff);
|
||||
|
||||
i = 0;
|
||||
while (dbg_buff[i] != ' ' && i < count)
|
||||
i++;
|
||||
j = i;
|
||||
i++;
|
||||
if (i < count) {
|
||||
if (dbg_buff[i] == '0') {
|
||||
enable_pipe = false;
|
||||
IPADBG("Drop stats will be disabled for pipes:");
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < j; i++) {
|
||||
if (dbg_buff[i] >= '0' && dbg_buff[i] <= '9') {
|
||||
pipe_num = (pipe_num * 10) + (dbg_buff[i] - '0');
|
||||
is_pipe = true;
|
||||
}
|
||||
if (dbg_buff[i] == seprator) {
|
||||
if (pipe_num >= 0 && pipe_num < ipa3_ctx->ipa_num_pipes
|
||||
&& ipa3_get_client_by_pipe(pipe_num) <
|
||||
IPA_CLIENT_MAX) {
|
||||
IPADBG("pipe number %u\n", pipe_num);
|
||||
if (enable_pipe)
|
||||
pipe_bitmask = pipe_bitmask |
|
||||
(1 << pipe_num);
|
||||
else
|
||||
pipe_bitmask = pipe_bitmask &
|
||||
(~(1 << pipe_num));
|
||||
}
|
||||
pipe_num = 0;
|
||||
is_pipe = false;
|
||||
}
|
||||
}
|
||||
if (is_pipe && pipe_num >= 0 && pipe_num < ipa3_ctx->ipa_num_pipes &&
|
||||
ipa3_get_client_by_pipe(pipe_num) < IPA_CLIENT_MAX) {
|
||||
IPADBG("pipe number %u\n", pipe_num);
|
||||
if (enable_pipe)
|
||||
pipe_bitmask = pipe_bitmask | (1 << pipe_num);
|
||||
else
|
||||
pipe_bitmask = pipe_bitmask & (~(1 << pipe_num));
|
||||
}
|
||||
|
||||
ipa_init_drop_stats(pipe_bitmask);
|
||||
ret = count;
|
||||
bail:
|
||||
mutex_unlock(&ipa3_ctx->lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct file_operations ipa3_quota_ops = {
|
||||
.read = ipa_debugfs_print_quota_stats,
|
||||
.write = ipa_debugfs_reset_quota_stats,
|
||||
@@ -2146,14 +2071,10 @@ static const struct file_operations ipa3_drop_ops = {
|
||||
.write = ipa_debugfs_reset_drop_stats,
|
||||
};
|
||||
|
||||
static const struct file_operations ipa3_enable_drop_ops = {
|
||||
.write = ipa_debugfs_enable_disable_drop_stats,
|
||||
};
|
||||
|
||||
int ipa_debugfs_init_stats(struct dentry *parent)
|
||||
{
|
||||
const mode_t read_write_mode = 0664;
|
||||
const mode_t write_mode = 0220;
|
||||
struct dentry *file;
|
||||
struct dentry *dent;
|
||||
|
||||
@@ -2180,13 +2101,6 @@ int ipa_debugfs_init_stats(struct dentry *parent)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
file = debugfs_create_file("enable_drop_stats", write_mode, dent, NULL,
|
||||
&ipa3_enable_drop_ops);
|
||||
if (IS_ERR_OR_NULL(file)) {
|
||||
IPAERR("fail to create file %s\n", "enable_drop_stats");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
file = debugfs_create_file("tethering", read_write_mode, dent, NULL,
|
||||
&ipa3_tethering_ops);
|
||||
if (IS_ERR_OR_NULL(file)) {
|
||||
|
||||
@@ -1190,7 +1190,7 @@ static int usb_bam_disconnect_ipa_prod(
|
||||
__func__, pipe_connect->bam_type);
|
||||
else
|
||||
ctx->pipes_enabled_per_bam -= 1;
|
||||
spin_unlock(&ctx->usb_bam_lock);
|
||||
spin_unlock(&ctx->usb_bam_lock);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1312,7 +1312,7 @@ retry:
|
||||
__func__, pipe_connect->bam_type);
|
||||
else
|
||||
ctx->pipes_enabled_per_bam -= 1;
|
||||
spin_unlock(&ctx->usb_bam_lock);
|
||||
spin_unlock(&ctx->usb_bam_lock);
|
||||
}
|
||||
|
||||
pipe_connect->ipa_clnt_hdl = -1;
|
||||
|
||||
33
gcc.sh
Normal file
33
gcc.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
OUT_DIR=out/
|
||||
|
||||
export KBUILD_BUILD_HOST=CuntsSpace
|
||||
export KERNEL_USE_CCACHE=1
|
||||
|
||||
make ARCH=arm64 \
|
||||
O=${OUT_DIR} \
|
||||
raphael_defconfig \
|
||||
-j4
|
||||
|
||||
scripts/config --file ${OUT_DIR}/.config \
|
||||
-d LTO \
|
||||
-d LTO_CLANG \
|
||||
-d TOOLS_SUPPORT_RELR \
|
||||
-d LD_LLD \
|
||||
-d FORTIFY_SOURCE
|
||||
|
||||
cd ${OUT_DIR}
|
||||
make O=${OUT_DIR} \
|
||||
ARCH=arm64 \
|
||||
olddefconfig
|
||||
cd ../
|
||||
|
||||
PATH=/home/utsavthecunt/arm64-gcc/bin:/home/utsavthecunt/arm32-gcc/bin:$PATH
|
||||
|
||||
make ARCH=arm64 \
|
||||
O=out \
|
||||
CROSS_COMPILE="aarch64-elf-" \
|
||||
CROSS_COMPILE_ARM32="arm-eabi-" \
|
||||
-j4
|
||||
|
||||
rm out/.version
|
||||
@@ -309,7 +309,7 @@ error:
|
||||
* You can assume the first device is /dev/dm-0, the next device is /dev/dm-1,
|
||||
* and so forth.
|
||||
*/
|
||||
static int __init dm_setup(char *str)
|
||||
static int __maybe_unused __init dm_setup(char *str)
|
||||
{
|
||||
struct dm_option opt;
|
||||
unsigned long num_devices;
|
||||
|
||||
@@ -5984,7 +5984,7 @@ int sched_isolate_count(const cpumask_t *mask, bool include_offline)
|
||||
*/
|
||||
int sched_isolate_cpu(int cpu)
|
||||
{
|
||||
struct rq *rq;
|
||||
struct rq *rq = cpu_rq(cpu);
|
||||
cpumask_t avail_cpus;
|
||||
int ret_code = 0;
|
||||
u64 start_time = 0;
|
||||
@@ -5996,14 +5996,11 @@ int sched_isolate_cpu(int cpu)
|
||||
|
||||
cpumask_andnot(&avail_cpus, cpu_online_mask, cpu_isolated_mask);
|
||||
|
||||
if (cpu < 0 || cpu >= nr_cpu_ids || !cpu_possible(cpu)
|
||||
|| !cpu_online(cpu)) {
|
||||
if (!cpu_online(cpu)) {
|
||||
ret_code = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
rq = cpu_rq(cpu);
|
||||
|
||||
if (++cpu_isolation_vote[cpu] > 1)
|
||||
goto out;
|
||||
|
||||
@@ -6062,10 +6059,6 @@ int sched_unisolate_cpu_unlocked(int cpu)
|
||||
struct rq *rq = cpu_rq(cpu);
|
||||
u64 start_time = 0;
|
||||
|
||||
if (cpu < 0 || cpu >= nr_cpu_ids || !cpu_possible(cpu)) {
|
||||
ret_code = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
if (trace_sched_isolate_enabled())
|
||||
start_time = sched_clock();
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ static void free_resources(void)
|
||||
}
|
||||
}
|
||||
static bool sge_ready;
|
||||
static bool freq_energy_model;
|
||||
|
||||
void check_max_cap_vs_cpu_scale(int cpu, struct sched_group_energy *sge)
|
||||
{
|
||||
@@ -62,7 +63,7 @@ void check_max_cap_vs_cpu_scale(int cpu, struct sched_group_energy *sge)
|
||||
if (max_cap == cpu_scale)
|
||||
return;
|
||||
|
||||
pr_debug("CPU%d max energy model capacity=%ld != cpu_scale=%ld\n", cpu,
|
||||
pr_warn("CPU%d max energy model capacity=%ld != cpu_scale=%ld\n", cpu,
|
||||
max_cap, cpu_scale);
|
||||
}
|
||||
|
||||
@@ -76,9 +77,6 @@ void init_sched_energy_costs(void)
|
||||
int sd_level, i, nstates, cpu;
|
||||
const __be32 *val;
|
||||
|
||||
if (!sched_is_energy_aware())
|
||||
return;
|
||||
|
||||
for_each_possible_cpu(cpu) {
|
||||
cn = of_get_cpu_node(cpu, NULL);
|
||||
if (!cn) {
|
||||
@@ -90,6 +88,9 @@ void init_sched_energy_costs(void)
|
||||
pr_warn("CPU device node has no sched-energy-costs\n");
|
||||
return;
|
||||
}
|
||||
/* Check if the energy model contains frequency/power values */
|
||||
if (of_find_property(cn, "freq-energy-model", NULL))
|
||||
freq_energy_model = true;
|
||||
|
||||
for_each_possible_sd_level(sd_level) {
|
||||
cp = of_parse_phandle(cn, "sched-energy-costs", sd_level);
|
||||
@@ -104,21 +105,25 @@ void init_sched_energy_costs(void)
|
||||
|
||||
sge = kcalloc(1, sizeof(struct sched_group_energy),
|
||||
GFP_NOWAIT);
|
||||
if (!sge)
|
||||
goto out;
|
||||
|
||||
nstates = (prop->length / sizeof(u32)) / 2;
|
||||
cap_states = kcalloc(nstates,
|
||||
sizeof(struct capacity_state),
|
||||
GFP_NOWAIT);
|
||||
if (!cap_states) {
|
||||
kfree(sge);
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (i = 0, val = prop->value; i < nstates; i++) {
|
||||
cap_states[i].cap = SCHED_CAPACITY_SCALE;
|
||||
cap_states[i].frequency = be32_to_cpup(val++);
|
||||
if (freq_energy_model) {
|
||||
/*
|
||||
* Capacity values will be calculated later using
|
||||
* frequency reported by OPP driver and cpu_uarch_scale
|
||||
* values.
|
||||
*/
|
||||
cap_states[i].frequency = be32_to_cpup(val++);
|
||||
cap_states[i].cap = 0;
|
||||
} else {
|
||||
cap_states[i].frequency = 0;
|
||||
cap_states[i].cap = be32_to_cpup(val++);
|
||||
}
|
||||
cap_states[i].power = be32_to_cpup(val++);
|
||||
}
|
||||
|
||||
@@ -128,8 +133,6 @@ void init_sched_energy_costs(void)
|
||||
prop = of_find_property(cp, "idle-cost-data", NULL);
|
||||
if (!prop || !prop->value) {
|
||||
pr_warn("No idle-cost data, skipping sched_energy init\n");
|
||||
kfree(sge);
|
||||
kfree(cap_states);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -137,11 +140,6 @@ void init_sched_energy_costs(void)
|
||||
idle_states = kcalloc(nstates,
|
||||
sizeof(struct idle_state),
|
||||
GFP_NOWAIT);
|
||||
if (!idle_states) {
|
||||
kfree(sge);
|
||||
kfree(cap_states);
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (i = 0, val = prop->value; i < nstates; i++)
|
||||
idle_states[i].power = be32_to_cpup(val++);
|
||||
@@ -151,10 +149,9 @@ void init_sched_energy_costs(void)
|
||||
|
||||
sge_array[cpu][sd_level] = sge;
|
||||
}
|
||||
|
||||
check_max_cap_vs_cpu_scale(cpu, sge_array[cpu][SD_LEVEL0]);
|
||||
if (!freq_energy_model)
|
||||
check_max_cap_vs_cpu_scale(cpu, sge_array[cpu][SD_LEVEL0]);
|
||||
}
|
||||
|
||||
sge_ready = true;
|
||||
pr_info("Sched-energy-costs installed from DT\n");
|
||||
return;
|
||||
@@ -165,17 +162,16 @@ out:
|
||||
|
||||
static int sched_energy_probe(struct platform_device *pdev)
|
||||
{
|
||||
unsigned long max_freq = 0;
|
||||
int max_efficiency = INT_MIN;
|
||||
int cpu;
|
||||
unsigned long *max_frequencies = NULL;
|
||||
int ret;
|
||||
|
||||
if (!sched_is_energy_aware())
|
||||
return 0;
|
||||
if (!sge_ready)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
if (!energy_aware() || !freq_energy_model)
|
||||
return 0;
|
||||
|
||||
max_frequencies = kmalloc_array(nr_cpu_ids, sizeof(unsigned long),
|
||||
GFP_KERNEL);
|
||||
if (!max_frequencies) {
|
||||
@@ -190,9 +186,6 @@ static int sched_energy_probe(struct platform_device *pdev)
|
||||
for_each_possible_cpu(cpu) {
|
||||
struct device *cpu_dev;
|
||||
struct dev_pm_opp *opp;
|
||||
int efficiency = topology_get_cpu_efficiency(cpu);
|
||||
|
||||
max_efficiency = max(efficiency, max_efficiency);
|
||||
|
||||
cpu_dev = get_cpu_device(cpu);
|
||||
if (IS_ERR_OR_NULL(cpu_dev)) {
|
||||
@@ -217,19 +210,13 @@ static int sched_energy_probe(struct platform_device *pdev)
|
||||
|
||||
/* Convert HZ to KHZ */
|
||||
max_frequencies[cpu] /= 1000;
|
||||
max_freq = max(max_freq, max_frequencies[cpu]);
|
||||
}
|
||||
|
||||
/* update capacity in energy model */
|
||||
for_each_possible_cpu(cpu) {
|
||||
unsigned long cpu_max_cap;
|
||||
struct sched_group_energy *sge_l0, *sge;
|
||||
int efficiency = topology_get_cpu_efficiency(cpu);
|
||||
|
||||
cpu_max_cap = DIV_ROUND_UP(SCHED_CAPACITY_SCALE *
|
||||
max_frequencies[cpu], max_freq);
|
||||
cpu_max_cap = DIV_ROUND_UP(cpu_max_cap * efficiency,
|
||||
max_efficiency);
|
||||
cpu_max_cap = topology_get_cpu_scale(NULL, cpu);
|
||||
|
||||
/*
|
||||
* All the cap_states have same frequency table so use
|
||||
@@ -261,7 +248,6 @@ static int sched_energy_probe(struct platform_device *pdev)
|
||||
break;
|
||||
sge->cap_states[i].cap = cap;
|
||||
}
|
||||
|
||||
dev_dbg(&pdev->dev,
|
||||
"cpu=%d freq=%ld cap=%ld power_d0=%ld\n",
|
||||
cpu, freq, sge_l0->cap_states[i].cap,
|
||||
@@ -269,8 +255,8 @@ static int sched_energy_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
dev_info(&pdev->dev,
|
||||
"cpu=%d eff=%d [freq=%ld cap=%ld power_d0=%ld] -> [freq=%ld cap=%ld power_d0=%ld]\n",
|
||||
cpu, efficiency,
|
||||
"cpu=%d [freq=%ld cap=%ld power_d0=%ld] -> [freq=%ld cap=%ld power_d0=%ld]\n",
|
||||
cpu,
|
||||
sge_l0->cap_states[0].frequency,
|
||||
sge_l0->cap_states[0].cap,
|
||||
sge_l0->cap_states[0].power,
|
||||
@@ -279,47 +265,42 @@ static int sched_energy_probe(struct platform_device *pdev)
|
||||
sge_l0->cap_states[ncapstates - 1].power
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
dev_dbg(&pdev->dev,
|
||||
"cpu=%d efficiency=%d max_frequency=%ld max_efficiency=%d cpu_max_capacity=%ld\n",
|
||||
cpu, efficiency, max_frequencies[cpu], max_efficiency,
|
||||
cpu_max_cap);
|
||||
|
||||
}
|
||||
|
||||
kfree(max_frequencies);
|
||||
|
||||
walt_map_freq_to_load();
|
||||
|
||||
dev_info(&pdev->dev, "Sched-energy-costs capacity updated\n");
|
||||
return 0;
|
||||
|
||||
exit:
|
||||
if (ret != -EPROBE_DEFER)
|
||||
dev_err(&pdev->dev, "error=%d\n", ret);
|
||||
|
||||
kfree(max_frequencies);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct of_device_id of_sched_energy_dt[] = {
|
||||
{
|
||||
.compatible = "sched-energy",
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct platform_driver energy_driver = {
|
||||
.driver = {
|
||||
.name = "sched-energy",
|
||||
.of_match_table = of_sched_energy_dt,
|
||||
},
|
||||
.probe = sched_energy_probe,
|
||||
};
|
||||
|
||||
static struct platform_device energy_device = {
|
||||
.name = "sched-energy",
|
||||
};
|
||||
|
||||
static int __init sched_energy_init(void)
|
||||
{
|
||||
return platform_driver_register(&energy_driver);
|
||||
int ret;
|
||||
|
||||
ret = platform_device_register(&energy_device);
|
||||
if (ret)
|
||||
pr_err("%s device_register failed:%d\n", __func__, ret);
|
||||
ret = platform_driver_register(&energy_driver);
|
||||
if (ret) {
|
||||
pr_err("%s driver_register failed:%d\n", __func__, ret);
|
||||
platform_device_unregister(&energy_device);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
subsys_initcall(sched_energy_init);
|
||||
|
||||
@@ -56,7 +56,7 @@ SCHED_FEAT(NONTASK_CAPACITY, true)
|
||||
* Queue remote wakeups on the target CPU and process them
|
||||
* using the scheduler IPI. Reduces rq->lock contention/bounces.
|
||||
*/
|
||||
SCHED_FEAT(TTWU_QUEUE, true)
|
||||
SCHED_FEAT(TTWU_QUEUE, false)
|
||||
|
||||
/*
|
||||
* When doing wakeups, attempt to limit superfluous scans of the LLC domain.
|
||||
|
||||
@@ -4292,7 +4292,7 @@ static int voice_send_cvp_mfc_config_cmd(struct voice_data *v)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int voice_get_avcs_version_per_service(uint32_t service_id)
|
||||
static __maybe_unused int voice_get_avcs_version_per_service(uint32_t service_id)
|
||||
{
|
||||
int ret = 0;
|
||||
size_t ver_size;
|
||||
|
||||
Reference in New Issue
Block a user