[Galaxy S II Original Android Development] Entropy512:
No, it is truth.

Now this is the lie. You claim that Lionheart is original work - it's not. It is pure kanging, plain and simple. While I haven't had a chance to look at Phoenix yet because you make it as difficult as possible for people to review your source while complying with the GPL (hiding something?), Lionheart in void.echo contains not a single shred of original work from you.

Now, let's give you a little bit of credit - you backported upstream Linux patches, getting you up to here:

http://git.kernel.org/?p=linux/kern...c;hb=326c86deaed54ad1b364fcafe5073f563671eb58

That said, in terms of actual benefit to the user, most of those upstream patches are minor.

So, let's see what is left:

diff -ur ../../../cpufreq_conservative.c cpufreq_lionheart.c > ~/Documents/gs2/linuxupstream_lionheart.diff

Aaaand the results are:

--- ../../../cpufreq_conservative.c	2012-01-24 18:08:11.000000000 -0500
+++ cpufreq_lionheart.c	2011-11-22 20:16:24.000000000 -0500
@@ -1,14 +1,24 @@
/*
- * drivers/cpufreq/cpufreq_conservative.c
+ * drivers/cpufreq/cpufreq_lionheart.c
*
- * Copyright (C) 2001 Russell King
- * (C) 2003 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>.
- * Jun Nakajima <jun.nakajima@intel.com>
- * (C) 2009 Alexander Clouter <alex@digriz.org.uk>
+ * Patched & tweaked: knzo
+ *
+ * Based on the Conservative governor by:
+ *
+ * Copyright (C) 2001 Russell King
+ * (C) 2003 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>.
+ * Jun Nakajima <jun.nakajima@intel.com>
+ * (C) 2009 Alexander Clouter <alex@digriz.org.uk>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
*/

#include <linux/kernel.h>
@@ -24,24 +34,8 @@
#include <linux/ktime.h>
#include <linux/sched.h>

-/*
- * dbs is used in this file as a shortform for demandbased switching
- * It helps to keep variable names smaller, simpler
- */
-
-#define DEF_FREQUENCY_UP_THRESHOLD	(80)
-#define DEF_FREQUENCY_DOWN_THRESHOLD	(20)
-
-/*
- * The polling frequency of this governor depends on the capability of
- * the processor. Default polling frequency is 1000 times the transition
- * latency of the processor. The governor will work on any processor with
- * transition latency <= 10mS, using appropriate sampling
- * rate.
- * For CPUs with transition latency > 10mS (mostly drivers with CPUFREQ_ETERNAL)
- * this governor will not work.
- * All times here are in uS.
- */
+#define DEF_FREQUENCY_UP_THRESHOLD	(65)
+#define DEF_FREQUENCY_DOWN_THRESHOLD	(30)
#define MIN_SAMPLING_RATE_RATIO	(2)

static unsigned int min_sampling_rate;
@@ -64,20 +58,13 @@
unsigned int requested_freq;
int cpu;
unsigned int enable:1;
-	/*
-	* percpu mutex that serializes governor limit change with
-	* do_dbs_timer invocation. We do not want do_dbs_timer to run
-	* when user is changing the governor or limits.
-	*/
+
struct mutex timer_mutex;
};
static DEFINE_PER_CPU(struct cpu_dbs_info_s, cs_cpu_dbs_info);

-static unsigned int dbs_enable;	/* number of CPUs using this policy */
+static unsigned int dbs_enable;

-/*
- * dbs_mutex protects dbs_enable in governor start/stop.
- */
static DEFINE_MUTEX(dbs_mutex);

static struct dbs_tuners {
@@ -128,7 +115,6 @@
return idle_time;
}

-/* keep track of frequency transitions */
static int
dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
void *data)
@@ -144,11 +130,6 @@

policy = this_dbs_info->cur_policy;

-	/*
-	* we only care if our internally tracked freq moves outside
-	* the 'valid' ranges of freqency available to us otherwise
-	* we do not change it
-	*/
if (this_dbs_info->requested_freq > policy->max
|| this_dbs_info->requested_freq < policy->min)
this_dbs_info->requested_freq = freq->new;
@@ -160,7 +141,6 @@
.notifier_call = dbs_cpufreq_notifier
};

-/************************** sysfs interface ************************/
static ssize_t show_sampling_rate_min(struct kobject *kobj,
struct attribute *attr, char *buf)
{
@@ -169,13 +149,13 @@

define_one_global_ro(sampling_rate_min);

-/* cpufreq_conservative Governor Tunables */
#define show_one(file_name, object)	\
static ssize_t show_##file_name	\
(struct kobject *kobj, struct attribute *attr, char *buf)	\
{	\
return sprintf(buf, "%u\n", dbs_tuners_ins.object);	\
}
+
show_one(sampling_rate, sampling_rate);
show_one(sampling_down_factor, sampling_down_factor);
show_one(up_threshold, up_threshold);
@@ -234,7 +214,6 @@
int ret;
ret = sscanf(buf, "%u", &input);

-	/* cannot be lower than 11 otherwise freq will not fall */
if (ret != 1 || input < 11 || input > 100 ||
input >= dbs_tuners_ins.up_threshold)
return -EINVAL;
@@ -258,12 +237,11 @@
if (input > 1)
input = 1;

-	if (input == dbs_tuners_ins.ignore_nice) /* nothing to do */
+	if (input == dbs_tuners_ins.ignore_nice)
return count;

dbs_tuners_ins.ignore_nice = input;

-	/* we need to re-evaluate prev_cpu_idle */
for_each_online_cpu(j) {
struct cpu_dbs_info_s *dbs_info;
dbs_info = &per_cpu(cs_cpu_dbs_info, j);
@@ -288,8 +266,6 @@
if (input > 100)
input = 100;

-	/* no need to test here if freq_step is zero as the user might actually
-	* want this, they would be crazy though :) */
dbs_tuners_ins.freq_step = input;
return count;
}
@@ -314,11 +290,9 @@

static struct attribute_group dbs_attr_group = {
.attrs = dbs_attributes,
-	.name = "conservative",
+	.name = "Lionheart",
};

-/************************** sysfs end ************************/
-
static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
{
unsigned int load = 0;
@@ -330,18 +304,6 @@

policy = this_dbs_info->cur_policy;

-	/*
-	* Every sampling_rate, we check, if current idle time is less
-	* than 20% (default), then we try to increase frequency
-	* Every sampling_rate*sampling_down_factor, we check, if current
-	* idle time is more than 80%, then we try to decrease frequency
-	*
-	* Any frequency increase takes it to the maximum frequency.
-	* Frequency reduction happens at minimum steps of
-	* 5% (default) of maximum frequency
-	*/
-
-	/* Get Absolute Load */
for_each_cpu(j, policy->cpus) {
struct cpu_dbs_info_s *j_dbs_info;
cputime64_t cur_wall_time, cur_idle_time;
@@ -365,10 +327,7 @@

cur_nice = cputime64_sub(kstat_cpu(j).cpustat.nice,
j_dbs_info->prev_cpu_nice);
-	/*
-	* Assumption: nice time between sampling periods will
-	* be less than 2^32 jiffies for 32 bit sys
-	*/
+
cur_nice_jiffies = (unsigned long)
cputime64_to_jiffies64(cur_nice);

@@ -385,24 +344,17 @@
max_load = load;
}

-	/*
-	* break out if we 'cannot' reduce the speed as the user might
-	* want freq_step to be zero
-	*/
if (dbs_tuners_ins.freq_step == 0)
return;

-	/* Check for frequency increase */
if (max_load > dbs_tuners_ins.up_threshold) {
this_dbs_info->down_skip = 0;

-	/* if we are already at full speed then break out early */
if (this_dbs_info->requested_freq == policy->max)
return;

freq_target = (dbs_tuners_ins.freq_step * policy->max) / 100;

-	/* max freq cannot be less than 100. But who knows.... */
if (unlikely(freq_target == 0))
freq_target = 5;

@@ -415,11 +367,6 @@
return;
}

-	/*
-	* The optimal frequency is the frequency that is the lowest that
-	* can support the current CPU usage without triggering the up
-	* policy. To be safe, we focus 10 points under the threshold.
-	*/
if (max_load < (dbs_tuners_ins.down_threshold - 10)) {
freq_target = (dbs_tuners_ins.freq_step * policy->max) / 100;

@@ -427,9 +374,6 @@
if (this_dbs_info->requested_freq < policy->min)
this_dbs_info->requested_freq = policy->min;

-	/*
-	* if we cannot reduce the frequency anymore, break out early
-	*/
if (policy->cur == policy->min)
return;

@@ -445,10 +389,9 @@
container_of(work, struct cpu_dbs_info_s, work.work);
unsigned int cpu = dbs_info->cpu;

-	/* We want all CPUs to do sampling nearly on same jiffy */
int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);

So, you removed all of the comments in the conservative governor code - Why? What are you trying to hide? There is no legitimate reason for doing this. In the entirety of the above, you have not made a single change that affects the user, other than changing the default up/down thresholds. Plenty of other people do that. Oh yeah, you changed the name to Lionheart. Big deal - you haven't done a single thing yet to justify a new name.

-	delay -= jiffies % delay;
+
+	// delay -= jiffies % delay;

dbs_info->enable = 1;
INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer);
@@ -509,13 +452,10 @@

mutex_init(&this_dbs_info->timer_mutex);
dbs_enable++;
-	/*
-	* Start the timerschedule work, when this governor
-	* is used for first time
-	*/
+
if (dbs_enable == 1) {
unsigned int latency;
-	/* policy latency is in nS. Convert it to uS first */
+
latency = policy->cpuinfo.transition_latency / 1000;
if (latency == 0)
latency = 1;

More deletion of comments, the first actual technical code change - one which gokhanmoral has had in his source tree since before void even existed.

@@ -527,18 +467,8 @@
return rc;
}

-	/*
-	* conservative does not implement micro like ondemand
-	* governor, thus we are bound to jiffes/HZ
-	*/
-	min_sampling_rate =
-	MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(10);
-	/* Bring kernel and HW constraints together */
-	min_sampling_rate = max(min_sampling_rate,
-	MIN_LATENCY_MULTIPLIER * latency);
-	dbs_tuners_ins.sampling_rate =
-	max(min_sampling_rate,
-	latency * LATENCY_MULTIPLIER);
+	min_sampling_rate = 10000;
+	dbs_tuners_ins.sampling_rate = 10000;

cpufreq_register_notifier(
&dbs_cpufreq_notifier_block,

Here we go. Here's the meat of Lionheart. This is where 99% of the benefits the user sees comes from. Now, this looks familiar to me.

Oh wait, I've seen it before (and written better, too) - https://github.com/netarchy/infuse4g-sources/commit/e4ab71ad9028bd5a38ba398c066878e40157f3d0 - Netarchy committed that on August 17, months before your void series even existed. Remove the changes to default thresholds and it's an elegant two-liner patch to do it properly and retain the safety checks in the kernel as opposed to hardcoding it. I've had it in my I777 tree since October 6, 2011, Simone201 has had it in his NEAK tree since October 28 or so, Gokhan has had it since November 26 at least, if not earlier (bitbucket makes it hard to review older history.) So despite your claims that no other kernel can provide Lionheart benefits, the source code says otherwise - numerous kernels had the capability before you even created this thread.

@@ -557,10 +487,6 @@
dbs_enable--;
mutex_destroy(&this_dbs_info->timer_mutex);

-	/*
-	* Stop the timerschedule work, when this governor
-	* is used for first time
-	*/
if (dbs_enable == 0)
cpufreq_unregister_notifier(
&dbs_cpufreq_notifier_block,
@@ -590,11 +516,11 @@
return 0;
}

-#ifndef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
+#ifndef CONFIG_CPU_FREQ_DEFAULT_GOV_LIONHEART
static
#endif
-struct cpufreq_governor cpufreq_gov_conservative = {
-	.name	= "conservative",
+struct cpufreq_governor cpufreq_gov_lionheart = {
+	.name	= "Lionheart",
.governor	= cpufreq_governor_dbs,
.max_transition_latency	= TRANSITION_LATENCY_LIMIT,
.owner	= THIS_MODULE,
@@ -602,24 +528,17 @@

static int __init cpufreq_gov_dbs_init(void)
{
-	return cpufreq_register_governor(&cpufreq_gov_conservative);
+	return cpufreq_register_governor(&cpufreq_gov_lionheart);
}

static void __exit cpufreq_gov_dbs_exit(void)
{
-	cpufreq_unregister_governor(&cpufreq_gov_conservative);
+	cpufreq_unregister_governor(&cpufreq_gov_lionheart);
}

-
-MODULE_AUTHOR("Alexander Clouter <alex@digriz.org.uk>");
-MODULE_DESCRIPTION("'cpufreq_conservative' - A dynamic cpufreq governor for "
-	"Low Latency Frequency Transition capable processors "
-	"optimised for use in a battery environment");
+MODULE_AUTHOR("knzo");
+MODULE_DESCRIPTION("'cpufreq_lionheart' - A brave and agile conservative-based governor.");
MODULE_LICENSE("GPL");

-#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
fs_initcall(cpufreq_gov_dbs_init);
-#else
-module_init(cpufreq_gov_dbs_init);
-#endif
module_exit(cpufreq_gov_dbs_exit);

Removal of comments and a rename.

Without a doubt, Lionheart is a fraud - you have passed it off as a major original work when it consists of nothing but kanging from three sources (Linux kernel upstream, gokhanmoral, netarchy). You continue to maintain that no other kernel has its capabilities, when the code clearly says otherwise - in fact other kernels had the capabilities that Lionheart does BEFORE you even released the first Void version here on XDA. We just didn't pass it off as being way more than what it was.

So, a bunch of code in the kernel (probably buggy and kanged too) to do what SetCPU can do. Yeah, you gain maybe 0.1 seconds or less on wakeup - but hell, the device takes at least 0.5-0.65 seconds to resume from suspend to begin with. Not enough to justify yet ANOTHER stupid name.

Edit: Also, there is not a single shred of arighi's code (except maybe that one commented out line?) in here either. Claiming you have the code from an excellent developer like him in your kernel is incredibly disrespectful to him.