From c0636b5baebd4f6b0d2de2a9c185ada1978efd06 Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.king@canonical.com>
Date: Thu, 20 Aug 2020 15:12:55 +0100
Subject: [PATCH] UBUNTU: [Config] Set the default CPU governor to ONDEMAND

BugLink: https://bugs.launchpad.net/bugs/1885730

The cpu-freq script in systemd has been removed for Ubuntu 20.10
because of conflicts between users wanting to change cpu governor
state and the defaulted post-boot ondemand setting my be set at
the inappropriate time post-boot (or with a setting that the user
doesn't want).  To remove all the confusing complexity, the best
viable option for now is to default to the ondemand governor and
let the user select their preferred setting post-boot.  As it
stands, the current performance governor is not power efficient
and not the best all round default, so it needs to be changed.

We can re-visit ways to speed up kernel boot times with governor
settings at a later date.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 debian.master/config/annotations          | 4 ++--
 debian.master/config/config.common.ubuntu | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/debian.master/config/annotations b/debian.master/config/annotations
index 29ef0acaa7f6e..2f8232c331291 100644
--- a/debian.master/config/annotations
+++ b/debian.master/config/annotations
@@ -12536,10 +12536,10 @@ CONFIG_X86_POWERNOW_K8                          note<not autoloadable>
 # Menu: Power management and ACPI options >> CPU Frequency scaling >> CPU Frequency scaling >> CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)
 
 # Menu: Power management and ACPI options >> CPU Frequency scaling >> CPU Frequency scaling >> Default CPUFreq governor
-CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE         policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y'}>
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE         policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n'}>
 CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE           policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n'}>
 CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE           policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n'}>
-CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND            policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n'}>
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND            policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y'}>
 CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE        policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n'}>
 CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL           policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n'}>
 #
diff --git a/debian.master/config/config.common.ubuntu b/debian.master/config/config.common.ubuntu
index 6024f492a03ae..d2715906349ab 100644
--- a/debian.master/config/config.common.ubuntu
+++ b/debian.master/config/config.common.ubuntu
@@ -1984,8 +1984,8 @@ CONFIG_CPU_CP15=y
 CONFIG_CPU_CP15_MMU=y
 CONFIG_CPU_FREQ=y
 # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
-CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set