You are not logged in.

#1 2025-03-12 03:33:26

Bluenecko
Member
Registered: 2025-03-04
Posts: 3

Unable to set cpu frequency after waking up from sleep

SystemInfo

 [sam@BlueNecko ~]$ inxi -Fazy
System:
  Kernel: 6.12.18-1-lts arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
    clocksource: tsc avail: hpet,acpi_pm
    parameters: initrd=\initramfs-linux-lts.img
    root=PARTUUID=7a933eec-9946-4eb9-a54b-2e541b752009 zswap.enabled=0 rw
    rootfstype=ext4
  Desktop: Hyprland v: 0.47.2 with: waybar vt: 2 dm: N/A Distro: Arch Linux
Machine:
  Type: Laptop System: LENOVO product: 82K2 v: IdeaPad Gaming 3 15ACH6
    serial: <superuser required> Chassis: type: 10 v: IdeaPad Gaming 3 15ACH6
    serial: <superuser required>
  Mobo: LENOVO model: LNVNB161216 v: SDK0T76486 WIN
    serial: <superuser required> part-nu: LENOVO_MT_82K2_BU_idea_FM_IdeaPad
    Gaming 3 15ACH6 uuid: <superuser required> UEFI: LENOVO v: H3CN45WW(V3.03)
    date: 09/01/2023
Battery:
  ID-1: BAT1 charge: 22.9 Wh (59.5%) condition: 38.5/45.0 Wh (85.5%)
    volts: 11.8 min: 11.5 model: 0x43 0x65 0x6C 0x78 0x70 0x72 0x74 0x00 0x32
    0x30 0x4C 0x32 0x30 0x43 0x33 0x50 type: Li-ion serial: <filter>
    status: not charging cycles: 259
CPU:
  Info: model: AMD Ryzen 5 5600H with Radeon Graphics bits: 64 type: MT MCP
    arch: Zen 3 gen: 3 level: v3 note: check built: 2021-22
    process: TSMC n7 (7nm) family: 0x19 (25) model-id: 0x50 (80) stepping: 0
    microcode: 0xA500011
  Topology: cpus: 1x dies: 1 clusters: 1 cores: 6 threads: 12 tpc: 2
    smt: enabled cache: L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 3 MiB
    desc: 6x512 KiB L3: 16 MiB desc: 1x16 MiB
  Speed (MHz): avg: 2117 min/max: 400/4280 boost: enabled scaling:
    driver: amd-pstate-epp governor: powersave cores: 1: 2117 2: 2117 3: 2117
    4: 2117 5: 2117 6: 2117 7: 2117 8: 2117 9: 2117 10: 2117 11: 2117 12: 2117
    bogomips: 79087
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow mitigation: Safe RET
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines; IBPB: conditional; IBRS_FW;
    STIBP: always-on; RSB filling; PBRSB-eIBRS: Not affected; BHI: Not
    affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q] vendor: Lenovo
    driver: N/A alternate: nouveau non-free: 550/565.xx+ status: current (as of
    2025-01; EOL~2026-12-xx) arch: Turing code: TUxxx process: TSMC 12nm FF
    built: 2018-2022 pcie: gen: 3 speed: 8 GT/s lanes: 8 link-max: gen: 4
    speed: 16 GT/s lanes: 16 bus-ID: 01:00.0 chip-ID: 10de:1f9d class-ID: 0302
  Device-2: Advanced Micro Devices [AMD/ATI] Cezanne [Radeon Vega Series /
    Radeon Mobile Series] vendor: Lenovo driver: amdgpu v: kernel arch: GCN-5
    code: Vega process: GF 14nm built: 2017-20 pcie: gen: 3 speed: 8 GT/s
    lanes: 16 link-max: gen: 4 speed: 16 GT/s ports: active: eDP-1
    empty: HDMI-A-1 bus-ID: 05:00.0 chip-ID: 1002:1638 class-ID: 0300
    temp: 62.0 C
  Device-3: IMC Networks Integrated Camera driver: uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-3:2 chip-ID: 13d3:56ff
    class-ID: 0e02
  Display: wayland server: X.org v: 1.21.1.16 with: Xwayland v: 24.1.6
    compositor: Hyprland v: 0.47.2 driver: X: loaded: amdgpu
    unloaded: modesetting,radeon alternate: fbdev,vesa dri: radeonsi
    gpu: amdgpu display-ID: 1
  Monitor-1: eDP-1 model: AU Optronics 0xd1ed built: 2019 res: 1920x1080
    dpi: 142 gamma: 1.2 size: 344x193mm (13.54x7.6") diag: 394mm (15.5")
    ratio: 16:9 modes: max: 1920x1080 min: 640x480
  API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
    device: 1 drv: swrast gbm: drv: kms_swrast surfaceless: drv: radeonsi
    wayland: drv: radeonsi x11: drv: radeonsi
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: mesa v: 24.3.4-arch1.1
    note: incomplete (EGL sourced) renderer: llvmpipe (LLVM 19.1.7 256 bits),
    AMD Radeon Graphics (radeonsi renoir LLVM 19.1.7 DRM 3.61 6.12.18-1-lts)
  API: Vulkan v: 1.4.304 layers: 7 device: 0 type: integrated-gpu name: AMD
    Radeon Graphics (RADV RENOIR) driver: N/A device-ID: 1002:1638
    surfaces: xcb,xlib,wayland
  Info: Tools: api: eglinfo, glxinfo, vulkaninfo
    gpu: nvidia-settings,nvidia-smi x11: xprop,xrandr
Audio:
  Device-1: Advanced Micro Devices [AMD/ATI] Renoir Radeon High Definition
    Audio vendor: Lenovo driver: snd_hda_intel v: kernel pcie: gen: 3
    speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s bus-ID: 05:00.1
    chip-ID: 1002:1637 class-ID: 0403
  Device-2: Advanced Micro Devices [AMD] ACP/ACP3X/ACP6x Audio Coprocessor
    vendor: Lenovo driver: N/A alternate: snd_pci_acp3x, snd_rn_pci_acp3x,
    snd_pci_acp5x, snd_pci_acp6x, snd_acp_pci, snd_rpl_pci_acp6x, snd_pci_ps,
    snd_sof_amd_renoir, snd_sof_amd_rembrandt, snd_sof_amd_vangogh,
    snd_sof_amd_acp63, snd_sof_amd_acp70 pcie: gen: 3 speed: 8 GT/s lanes: 16
    link-max: gen: 4 speed: 16 GT/s bus-ID: 05:00.5 chip-ID: 1022:15e2
    class-ID: 0480
  Device-3: Advanced Micro Devices [AMD] Family 17h/19h/1ah HD Audio
    vendor: Lenovo driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s
    lanes: 16 link-max: gen: 4 speed: 16 GT/s bus-ID: 05:00.6
    chip-ID: 1022:15e3 class-ID: 0403
  API: ALSA v: k6.12.18-1-lts status: kernel-api tools: N/A
  Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
  Server-2: PipeWire v: 1.4.0 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: Lenovo driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
    port: 2000 bus-ID: 02:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp2s0 state: down mac: <filter>
  Device-2: MEDIATEK MT7921 802.11ax PCI Express Wireless Network Adapter
    vendor: Lenovo driver: mt7921e v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 1
    bus-ID: 03:00.0 chip-ID: 14c3:7961 class-ID: 0280
  IF: wlan0 state: up mac: <filter>
  Info: services: iwd, systemd-networkd, systemd-timesyncd
Bluetooth:
  Device-1: Foxconn / Hon Hai MediaTek Bluetooth Adapter driver: btusb v: 0.8
    type: USB rev: 2.1 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-4:3
    chip-ID: 0489:e0cd class-ID: e001 serial: <filter>
  Report: btmgmt ID: hci0 rfk-id: 4 state: up address: <filter> bt-v: 5.2
    lmp-v: 11 status: discoverable: yes pairing: yes class-ID: c010c
Drives:
  Local Storage: total: 942.7 GiB used: 305.65 GiB (32.4%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: MZALQ512HBLU-00BL2
    size: 476.94 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: 7L2QFXM7 temp: 37.9 C
    scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Western Digital
    model: WD5000LPCX-00VHAT0 size: 465.76 GiB block-size: physical: 4096 B
    logical: 512 B speed: 6.0 Gb/s tech: HDD rpm: 5400 serial: <filter>
    fw-rev: 1A01 scheme: GPT
Partition:
  ID-1: / raw-size: 43.37 GiB size: 42.39 GiB (97.74%) used: 35.71 GiB (84.2%)
    fs: ext4 dev: /dev/nvme0n1p10 maj-min: 259:10
  ID-2: /boot raw-size: 1024 MiB size: 1022 MiB (99.80%)
    used: 440.8 MiB (43.1%) fs: vfat dev: /dev/nvme0n1p8 maj-min: 259:8
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default) zswap: no
  ID-1: swap-1 type: zram size: 3.56 GiB used: 0 KiB (0.0%) priority: 100
    comp: zstd avail: lzo-rle,lzo,lz4,lz4hc,deflate,842 max-streams: 12
    dev: /dev/zram0
  ID-2: swap-2 type: partition size: 4 GiB used: 0 KiB (0.0%) priority: -2
    dev: /dev/nvme0n1p9 maj-min: 259:9
Sensors:
  System Temperatures: cpu: 63.1 C mobo: 52.0 C gpu: amdgpu temp: 61.0 C
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 8 GiB note: est. available: 7.12 GiB used: 1.73 GiB (24.2%)
  Processes: 261 Power: uptime: 11m states: freeze,mem,disk suspend: deep
    avail: s2idle wakeups: 1 hibernate: platform avail: shutdown, reboot,
    suspend, test_resume image: 2.81 GiB services: upowerd Init: systemd v: 257
    default: graphical tool: systemctl
  Packages: 952 pm: pacman pkgs: 951 libs: 291 tools: paru pm: flatpak
    pkgs: 1 Compilers: clang: 19.1.7 gcc: 14.2.1 Shell: Bash v: 5.2.37
    running-in: kitty inxi: 3.3.37

problem kernel: 6.13.6-arch1-1 , LTS has no such issues, currently using 6.12.18-1-lts

I use this everytime to set frequencies manually, but when i wake up from sleep it just doesnt work anymore, like i cant see any errors in  stdout or in dmesg

    # Set CPU frequency scaling with sudo
    for cpu in /sys/devices/system/cpu/cpu[0-9]*; do
        sudo bash -c "echo $max_freq > $cpu/cpufreq/scaling_max_freq"
        sudo bash -c "echo $min_freq > $cpu/cpufreq/scaling_min_freq"
        sudo bash -c "echo $governor > $cpu/cpufreq/scaling_governor"

# The Behavior after waking up from sleep

 [sam@BlueNecko ~]$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
powersave
powersave
powersave
powersave
powersave
powersave
powersave
powersave
powersave
powersave
powersave
powersave
[sam@BlueNecko ~]$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq
600000
600000
600000
600000
600000
600000
600000
600000
600000
600000
600000
600000
[sam@BlueNecko ~]$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
1600000
1600000
1600000
1600000
1600000
1600000
1600000
1600000
1600000
1600000
1600000
1600000
[sam@BlueNecko ~]$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
3782009
4042028
4014020
3011445
4031110
3452611
4042180
600000
3815034
600000
4024472
600000
 [sam@BlueNecko ~]$ cpupower frequency-info
analyzing CPU 2:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 2
  CPUs which need to have their frequency coordinated by software: 2
  maximum transition latency: 20.0 us
  hardware limits: 400 MHz - 4.28 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 600 MHz and 1.60 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 3.29 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    AMD PSTATE Highest Performance: 166. Maximum Frequency: 4.28 GHz.
    AMD PSTATE Nominal Performance: 128. Nominal Frequency: 3.30 GHz.
    AMD PSTATE Lowest Non-linear Performance: 43. Lowest Non-linear Frequency: 1.11 GHz.
    AMD PSTATE Lowest Performance: 16. Lowest Frequency: 400 MHz.
 [sam@BlueNecko ~]$ cat /sys/power/mem_sleep
s2idle [deep]

Offline

#2 2025-03-12 08:55:04

gromit
Package Maintainer (PM)
From: Germany
Registered: 2024-02-10
Posts: 1,028
Website

Re: Unable to set cpu frequency after waking up from sleep

So what was the last kernel that it worked with?

Offline

#3 2025-03-12 13:58:03

seth
Member
Registered: 2012-09-03
Posts: 61,712

Re: Unable to set cpu frequency after waking up from sleep

Also what are the acutal values you're writing in your script, when does that run and can you change the governor manually

echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

Why are you setting the limits before the governor?
Does the same happen if you s2idle instead of S3 (deep) sleep?

Offline

Board footer

Powered by FluxBB