diff --git a/patches/ANDROID-gki_defconfig-remove-PWRSEQ_EMMC-and-PWRSEQ_SIMPLE.patch b/patches/ANDROID-gki_defconfig-remove-PWRSEQ_EMMC-and-PWRSEQ_SIMPLE.patch new file mode 100644 index 000000000000..e0854d154867 --- /dev/null +++ b/patches/ANDROID-gki_defconfig-remove-PWRSEQ_EMMC-and-PWRSEQ_SIMPLE.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ram Muthiah +Date: Thu, 17 Oct 2019 18:28:10 -0700 +Subject: ANDROID: gki_defconfig: remove PWRSEQ_EMMC and PWRSEQ_SIMPLE + +These modules are not required for GKI. + +Bug: 139431025 +Signed-off-by: Ram Muthiah +Change-Id: I9a82010eb326b0a336725037e0356a63a0c9f053 +--- + arch/x86/configs/gki_defconfig | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/x86/configs/gki_defconfig b/arch/x86/configs/gki_defconfig +index 18c3429c7ede..949c449b9d1f 100644 +--- a/arch/x86/configs/gki_defconfig ++++ b/arch/x86/configs/gki_defconfig +@@ -289,6 +289,8 @@ CONFIG_USB_CONFIGFS_F_ACC=y + CONFIG_USB_CONFIGFS_F_AUDIO_SRC=y + CONFIG_USB_CONFIGFS_F_MIDI=y + CONFIG_MMC=m ++# CONFIG_PWRSEQ_EMMC is not set ++# CONFIG_PWRSEQ_SIMPLE is not set + CONFIG_NEW_LEDS=y + CONFIG_LEDS_CLASS=y + CONFIG_LEDS_TRIGGERS=y diff --git a/patches/ANDROID-sched-Honor-sync-flag-for-energy-aware-wakeups.patch b/patches/ANDROID-sched-Honor-sync-flag-for-energy-aware-wakeups.patch new file mode 100644 index 000000000000..0e51f4e02b75 --- /dev/null +++ b/patches/ANDROID-sched-Honor-sync-flag-for-energy-aware-wakeups.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Chris Redpath +Date: Thu, 17 Oct 2019 11:18:08 +0100 +Subject: ANDROID: sched: Honor sync flag for energy-aware wakeups + +Since we don't do energy-aware wakeups when we are overutilized, always +honoring sync wakeups in this state does not prevent wake-wide mechanics +overruling the flag as normal. + +Having the check for (cpu_rq(cpu)->nr_running == 1) in the test condition +means that we only bypass the energy model for sync wakeups where the +cpu is about to become idle. This matches the use of this flag in Binder +which is the main place where sync wakeups come from in Android. + +This patch is based upon previous work to build EAS for android products. +It replaces +commit 79e3a4a27ee5 ("ANDROID: sched: Unconditionally honor sync flag + for energy-aware wakeups") +in what's considered to be 'EAS'. + +sync-hint code taken from wahoo +https://android.googlesource.com/kernel/msm/+/4a5e890ec60d +written by Juri Lelli + +Change-Id: I4b3d79141fc8e53dc51cd63ac11096c2e3cb10f5 +Signed-off-by: Chris Redpath +(cherry-picked from commit f1ec666a62de) +[ Moved the feature to find_energy_efficient_cpu() and removed the + sysctl knob ] +Signed-off-by: Quentin Perret +[ Add 'cpu_rq(cpu)->nr_running == 1' to the condition and remove the + word 'Unconditionally' from the patch name ] +Signed-off-by: Dietmar Eggemann +--- + kernel/sched/fair.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index ba1eaa599dbc..8f8692baa679 100644 +--- a/kernel/sched/fair.c ++++ b/kernel/sched/fair.c +@@ -6364,7 +6364,8 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, int sy + goto fail; + + cpu = smp_processor_id(); +- if (sync && cpumask_test_cpu(cpu, p->cpus_ptr)) { ++ if (sync && cpu_rq(cpu)->nr_running == 1 && ++ cpumask_test_cpu(cpu, p->cpus_ptr)) { + rcu_read_unlock(); + return cpu; + } diff --git a/patches/ANDROID-unconditionally-compile-sig_ok-in-struct-module.patch b/patches/ANDROID-unconditionally-compile-sig_ok-in-struct-module.patch new file mode 100644 index 000000000000..53fa59ffe57c --- /dev/null +++ b/patches/ANDROID-unconditionally-compile-sig_ok-in-struct-module.patch @@ -0,0 +1,42 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Steve Muckle +Date: Thu, 17 Oct 2019 12:14:13 -0700 +Subject: ANDROID: unconditionally compile sig_ok in struct module + +The generic kernel image must have module signing disabled so it can +load kernel modules from all vendors. Unfortunately loading a signed +kernel module into a kernel with module signing disabled will fail +because struct module_layout (which appears in kernel modules) contains +struct module, and struct module contains the sig_ok field, which is +conditionally compiled depending on CONFIG_MODULE_SIG (module signing). + +Unconditionally compile the sig_ok field to work around this problem. + +Bug: 135940219 +Test: load a signed kernel module with module signing disabled +Change-Id: I5cc437c806f74f89c0e45ce4135136ca0c70738e +Signed-off-by: Steve Muckle +--- + include/linux/module.h | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/include/linux/module.h b/include/linux/module.h +index 6d20895e7739..6744ffe9a727 100644 +--- a/include/linux/module.h ++++ b/include/linux/module.h +@@ -389,10 +389,12 @@ struct module { + const s32 *unused_gpl_crcs; + #endif + +-#ifdef CONFIG_MODULE_SIG +- /* Signature was verified. */ ++ /* ++ * Signature was verified. Unconditionally compiled in Android to ++ * preserve ABI compatibility between kernels without module ++ * signing enabled and signed modules. ++ */ + bool sig_ok; +-#endif + + bool async_probe_requested; + diff --git a/patches/series b/patches/series index 943c392c150c..79928bfc6932 100644 --- a/patches/series +++ b/patches/series @@ -2,7 +2,7 @@ # android-mainline patches # # Applies onto mainline 4f5cafb5cb84 Linux v5.4-rc3 -# Matches android-mainline 1caeb408f5db UPSTREAM: base: soc: Handle custom soc information sysfs entries +# Matches android-mainline 06dc94f19d2f "ANDROID: sched: Honor sync flag for energy-aware wakeups" # ANDROID-x86-Remove-a-useless-warning-message.patch ANDROID-Kbuild-LLVMLinux-allow-overriding-clang-target-triple.patch @@ -232,3 +232,6 @@ Revert-drivers-qcom-rpmh-rsc-modularize-RSC-controller-driver.patch clk-add-pre-and-post-change-rate-callbacks.patch ANDROID-gki_defconfig-enable-fs-verity.patch UPSTREAM-base-soc-Handle-custom-soc-information-sysfs-entries.patch +ANDROID-unconditionally-compile-sig_ok-in-struct-module.patch +ANDROID-gki_defconfig-remove-PWRSEQ_EMMC-and-PWRSEQ_SIMPLE.patch +ANDROID-sched-Honor-sync-flag-for-energy-aware-wakeups.patch