Adding a kernel governor can be a Nightmare!

Okay, so a little play on words, especially since I am adding the Nightmare governor to the tblte (Samsung Galaxy Note Edge) kernel, but it did turn out to be a bit of a problem child, fortunately, it was quickly corrected. As you can see, I did the standard additions, as well as adding the cpufreq_nightmare.c file:

Added to Makefile:

[CODE]
………….EDITED FOR SPACE…………………..
obj-$(CONFIG_CPU_FREQ_GOV_NIGHTMARE) += cpufreq_nightmare.o
………….EDITED FOR SPACE…………………..
[/CODE]

Added to Kconfig:

[CODE]
………….EDITED FOR SPACE…………………..
config CPU_FREQ_DEFAULT_GOV_NIGHTMARE
bool “nightmare”
select CPU_FREQ_GOV_NIGHTMARE
help
Use the CPUFreq governor ‘nightmare’ as default. -WJH
………….EDITED FOR SPACE…………………..
config CPU_FREQ_GOV_NIGHTMARE
tristate “‘nightmare’ cpufreq policy governor”
help
‘nightmare’ – This driver is a modified PegasusQ.

To compile this driver as a module, choose M here: the
module will be called cpufreq_nightmare.

For details, take a look at linux/Documentation/cpu-freq.

If in doubt, say N. -WJH
………….EDITED FOR SPACE…………………..
[/CODE]

Added to cpufreq.h:

[CODE]
………….EDITED FOR SPACE…………………..
#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_NIGHTMARE)
extern struct cpufreq_governor cpufreq_gov_nightmare;
#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_nightmare)
………….EDITED FOR SPACE…………………..
[/CODE]

Added to config:

[CODE]
………….EDITED FOR SPACE…………………..
CONFIG_CPU_FREQ_GOV_NIGHTMARE=y
………….EDITED FOR SPACE…………………..
[/CODE]

But, when I ran the compiler, I got this output:

[CODE]
/home/alaskalinuxuser/Documents/projects/phones/compile/build_slim6/kernel/samsung/tblte/drivers/cpufreq/cpufreq_nightmare.c: In function ‘nightmare_check_cpu’:
/home/alaskalinuxuser/Documents/projects/phones/compile/build_slim6/kernel/samsung/tblte/drivers/cpufreq/cpufreq_nightmare.c:540:2: error: implicit declaration of function ‘cpufreq_notify_utilization’ [-Werror=implicit-function-declaration]
cpufreq_notify_utilization(policy, max_load);
[/CODE]

So I edited that line out in build_slim6/kernel/samsung/tblte/drivers/cpufreq/cpufreq_nightmare.c:

[CODE]
// WJH cpufreq_notify_utilization(policy, max_load);
[/CODE]

And viola! By God’s grace it even worked! That usually doesn’t get fixed so easily, so I guess that wasn’t so bad.

Linux – keep it simple.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s