Dynamically adjust cpufreq_max_limit according to scaling_max setting without breaking power save mode (part 2)

(credit to yanklu555, simone201)