This repository has been archived by the owner on Jul 3, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpufreq: fallback to interactive if governor is not found
Nowadays, custom ROMs are starting to set custom governor profiles via init scripts, often times involving custom governors (like DrunkSauce, which is impulse on little and ironactive on big). If the user sticks with the built-in kernel, that is totally fine as everything will get loaded up properly. However, if the user decides to switch to a custom kernel and those governors are not present, this function will fail to find them when and the governor will not change. I attempt to work around this by modifying how the method handles finding the governor. Process without this patch: 1. Phone boots with performance governor. 2. Init scripts attempts to write custom governor to sys path. 3. The function cpufreq_parse_governor fails to locate the governor and returns -EINVAL since the input was invalid. 4. The phone does not switch from the performance governor. Process with this patch: 1. Phone boots with performance governor. 2. Init scripts attempts to write the custom governor to sys path. 3. The function cpufreq_parse_governor fails to locate the governor but then tries to locate the interactive governor. 4. The interactive governor is then applied. A couple of notes: 1. If you have a different governor that you want to be set on boot, make sure to change interactive to that governor's name. 2. This is a little bit of a hack; ideally, it'd be nice to only switch to interactive if the current governor is performance so that already applied governors/settings are not overwritten but there is not really a scenario where this will be accidentally be activated since custom kernel tweaking apps will only show governors that are currently available. Maybe when I have more time will I explore this in depth. Signed-off-by: Nathan Chancellor <[email protected]> (cherry picked from commit 58ef44b)
- Loading branch information