Intel_pstate Turbo not working at all

    PC: ASUS TUF FX505GT
    OS: Manjaro 20.2 Nibia
    Kernel: x86_64 Linux 5.9.3-1-MANJARO
    Shell: bash 5.0.18
    Resolution: 1920x1080
    DE: KDE 5.75.0 / Plasma 5.20.2
    CPU: Intel Core i5-9300H @ 8x 2.4GHz
    GPU: GeForce GTX 1650
    RAM: 1994MiB / 15864MiB

When I boot my laptop into Linux with the AC plugged in all is going to be fine, because if i will unplug the AC and switch to Battery, the CPU freq reaches max 2.40Ghz as it should be, and if I replug the AC the CPU freq reaches the Turbo Clock 4.10Ghz.

The problem is: if I boot into Linux without the AC plugged (in battery mode) the CPU freq reaches max 2.40Ghz as it should be, but if i will plug the AC the CPU freq remains the same (2.40Ghz without reaching Turbo Clock).

I check CPU profile and freq with cpupower The command below shows when laptop booted without AC and then plugged in later:

sudo cpupower frequency-info
CPU 0 analysis:
  driver: intel_pstate
  CPUs operating at the same hardware frequency: 0
  CPU that must be coordinated by the software: 0
  maximum latency during transition: Unable to determine or not supported.
  hardware limits: 800 MHz - 2.40 GHz
  available managers: performance powersave
  current carrier: the frequency must remain between 800 MHz and 2.40 GHz.
                   The powersave manager can decide which speed to use
                  in this interval.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 2.40 GHz (declared by the kernel call)
  increase state support:
  Supported: yes
  Active: yes

The difference between when booting with AC is just the CPU freq:

hardware limits: 800 MHz - 4.10 GHz

Things that i tried without success: BIOS doesn’t have any option to control these arguments, Switch back to kernel 5.8, tlp, laptop-mode-tools, Pass to kernel the paramenter intel_pstate=active .

Looking forward for a little help understandig the situation. Thank you in advance!

It seems the profile isn’t changing for performance.

Check your TLP settings. You can use TLPUI for that. Check that tlp service is running. If you set it in TLP and it still fails, you can then write a udev rule.

Some time ago I had the same issue, and as mbb stated, could be a TLP related.
What I did to have turbo boost enabled when on battery:
Edit /etc/default/tlp

You will see the following section:
# Set the CPU “turbo boost” feature: 0=disable, 1=allow
# Requires an Intel Core i processor.
# Important:
# - This may conflict with your distribution’s governor settings
# - A value of 1 does not activate boosting, it just allows it
# Default:
CPU_BOOST_ON_AC=1
CPU_BOOST_ON_BAT=0

Then set CPU_BOOST_ON_BAT=0 to CPU_BOOST_ON_BAT=1
If is not applyed, run systemctl restart tlp

Done without success. Profile switching is working only when booting with AC plugged in.

missing some search

The OP informed us that has already tried:

Well, if everything else fails, you can try udev rules. I’ll post mine here. Currently they are all commented because all is set in TLP and working perfectly. Just check compatibility of the commands (the “scripts”) with your hardware and uncomment the ones you want test. You need to reload the rules with udevadm or reboot the system for them to work.

Udev rules:

[mbb@mbb-laptop ~]$ cat /etc/udev/rules.d/98-ACDC-behaviour.rules 
# Set governor to powersave and disable turbo boost on DC (handled by tlp)
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/bin/sh /home/mbb/.bin/cpugov-powersave.sh"

# Set governor to performance and enable turbo boost on AC (handled by tlp)
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/bin/sh /home/mbb/.bin/cpugov-performance.sh"

# Set software energy policy hint to 10 on DC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/bin/sh /home/mbb/.bin/x86-energy-policy-power.sh"

# Set software energy policy hint to 4 on AC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/bin/sh /home/mbb/.bin/x86-energy-policy-performance.sh"

# Set gpu max frequency to 750 Mhz on DC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/bin/sh /home/mbb/.bin/set_gpu_frequency_power.sh"

# Set gpu frequencies to defaults on AC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/bin/sh /home/mbb/.bin/set_gpu_frequency_performance.sh"

# Set turbo boost off on DC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/bin/sh /home/mbb/.bin/set_turboboost_off.sh"

# Set turbo boost on on AC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/bin/sh /home/mbb/.bin/set_turboboost_on.sh"

# Set cpu max frequency to 1200 Mhz on DC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/bin/sh /home/mbb/.bin/set_cpu_frequency_power.sh"

# Set cpu frequencies to defaults on AC
#ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/bin/sh /home/mbb/.bin/set_cpu_frequency_performance.sh"

cpugov scripts:

[mbb@mbb-laptop ~]$ cat .bin/cpugov-powersave.sh 
#!/bin/bash
# Set cpu  governor to powersave and disable turbo boost
cpupower frequency-set -g powersave
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo

[mbb@mbb-laptop ~]$ cat .bin/cpugov-performance.sh 
#!/bin/bash
# Set cpu  governor to performance and enable turbo boost
cpupower frequency-set -g performance
echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo

x86-energy-policy scripts:

[mbb@mbb-laptop ~]$ cat .bin/x86-energy-policy-power.sh 
#!/bin/bash
# Set software perfofrmance/power hint to 10 (16*2/3-1)
x86_energy_perf_policy 15

[mbb@mbb-laptop ~]$ cat .bin/x86-energy-policy-performance.sh 
#!/bin/bash
# Set software perfofrmance/power hint to 4 (16*1/3-1)
x86_energy_perf_policy 6

gpu_frequency scripts:

[mbb@mbb-laptop ~]$ cat .bin/set_gpu_frequency_power.sh 
#!/bin/bash
# Set gpu max frequency to 750 Mhz
intel_gpu_frequency --custom max=750

[mbb@mbb-laptop ~]$ cat .bin/set_gpu_frequency_performance.sh 
#!/bin/bash
# Set gpu frequencies to defaults
intel_gpu_frequency --defaults

turboboost scripts:

[mbb@mbb-laptop ~]$ cat .bin/set_turboboost_off.sh 
#!/bin/bash
# Set turbo boost off
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo

[mbb@mbb-laptop ~]$ cat .bin/set_turboboost_on.sh 
#!/bin/bash
# Set turbo boost on
echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo

cpu_frequency scripts:

[mbb@mbb-laptop ~]$ cat .bin/set_cpu_frequency_power.sh 
#!/bin/bash
# Set cpu max frequency to 1200 Mhz
cpupower frequency-set -u 1200Mhz

[mbb@mbb-laptop ~]$ cat .bin/set_cpu_frequency_performance.sh 
#!/bin/bash
# Set cpu max frequency to 2800 Mhz
cpupower frequency-set -u 2800Mhz

In my machine, if I disable turbo boost, the cpu still reaches the maximum frequency (I mean, the turbo frequency). My cpu has a maximum frequency of 1800Mhz and a turbo frequency of 2800Mhz. The only way to limit the frequency under battery is to use cpupower frequency-set. As you can see, I limit it to 1200Mhz, since it is enough for needs on bat and increases battery life a lot.