Lately I’ve been going through the Xperia XA2 Ultra kernel (sdm660) and trying to add new features. Today I was adding in some governors, and several of them had the same underlying issues. Part of the problem was that I got the governors from a 3.10 kernel and put them into a 4.4 kernel, so understandably some things have changed.

Another error that I’ve had pop up numerous times is this whole “pm_idle” issue:

/home/alaskalinuxuser/aokp_pie/kernel/sony/sdm660/drivers/cpufreq/cpufreq_asswax.c:765:4: error: use of undeclared identifier ‘pm_idle’
pm_idle = pm_idle_old;

 

/home/alaskalinuxuser/aokp_pie/kernel/sony/sdm660/drivers/cpufreq/cpufreq_brazilianwax.c:712:39: error: use of undeclared identifier ‘pm_idle’
pm_idle_old = pm_idle;

 

/home/alaskalinuxuser/aokp_pie/kernel/sony/sdm660/drivers/cpufreq/cpufreq_smartass.c:602:18: error: use of undeclared identifier ‘pm_idle’
pm_idle_old = pm_idle;

 

/home/alaskalinuxuser/aokp_pie/kernel/sony/sdm660/drivers/cpufreq/cpufreq_smartass2.c error: use of undeclared identifier ‘pm_idle’
pm_idle_old = pm_idle;

It appears that somewhere in the older kernel, “pm_idle” was declared somewhere, but it no longer is declared in the newer 4.4 kernel. So, I just declared it in each governor by adding these lines at the beginning:

static void (*pm_idle)(void); // WJH

Now that it is declared (statically, so it stays here), it can be used in the formulas to calculate the needed values for adjusting the CPU frequencies. I’m honestly not sure that this was the best fix, but it certainly did work and now the compiling finished and the governors did function. At least, as far as I could tell….

Linux – keep it simple.

Leave a Reply

Your email address will not be published. Required fields are marked *