Bug 204579

Summary: min cpu clocks incorrect in amd ryzen 5 3550H
Product: Platform Specific/Hardware Reporter: Alberto (albertogomezmarin)
Component: x86-64Assignee: platform_x86_64 (platform_x86_64)
Status: NEW ---    
Severity: high CC: albertogomezmarin, damienroch22, david, djip.perois, mmattq, postix
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 5.0 5.1 5.2 5.3 Subsystem:
Regression: No Bisected commit-id:

Description Alberto 2019-08-14 14:13:53 UTC
steps to reproduce:
boot any distro with linux kernel in r5 3550H that has a base clock of 2,1 Ghz aprox and turbo of 3,7Ghz, they are working well, but the problem is that the minimum clocks reported in linux are 1400Mhz while in windows they are 400 Mhz.
I have to explain that is a mobile cpu of ryzen mobile and the battery in linux is drained double faster than windows one.

output cpupower frequency-info
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 1.40 GHz - 2.10 GHz
  available frequency steps:  2.10 GHz, 1.70 GHz, 1.40 GHz
  available cpufreq governors: performance schedutil
  current policy: frequency should be within 1.40 GHz and 2.10 GHz.
                  The governor "schedutil" may decide which speed to use
                  within this range.
  current CPU frequency: 2.10 GHz (asserted by call to hardware)
  boost state support:
    Supported: no
    Active: no
    Boost States: 0
    Total States: 3
    Pstate-P0:  2100MHz
    Pstate-P1:  1700MHz
    Pstate-P2:  1400MHz

Expected behaviour:
Havind a hardware limit of 400 Mhz-2,1Ghz for having 400Mhz frequenzy avalaible because having upper clock frequencys stop cores to enter C states more than 2 and having much power loses included in idle
My asus fx505DY in windows report a power drain of 5 W in idle while in linux is 10,8 Min, average 12W
Comment 1 Alberto 2019-08-14 14:16:32 UTC
lscpu output:
Arquitectura:                        x86_64
modo(s) de operación de las CPUs:    32-bit, 64-bit
Orden de los bytes:                  Little Endian
Tamaños de las direcciones:          43 bits physical, 48 bits virtual
CPU(s):                              8
Lista de la(s) CPU(s) en línea:      0-7
Hilo(s) de procesamiento por núcleo: 2
Núcleo(s) por «socket»:              4
«Socket(s)»                          1
Modo(s) NUMA:                        1
ID de fabricante:                    AuthenticAMD
Familia de CPU:                      23
Modelo:                              24
Nombre del modelo:                   AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx
Revisión:                            1
Aumento de frecuencia:               activada
CPU MHz:                             2922.948
CPU MHz máx.:                        2100,0000
CPU MHz mín.:                        1400,0000
BogoMIPS:                            4191.95
Virtualización:                      AMD-V
Caché L1d:                           128 KiB
Caché L1i:                           256 KiB
Caché L2:                            2 MiB
Caché L3:                            4 MiB
CPU(s) del nodo NUMA 0:              0-7
Vulnerability L1tf:                  Not affected
Vulnerability Mds:                   Not affected
Vulnerability Meltdown:              Not affected
Vulnerability Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:            Mitigation; Full AMD retpoline, IBPB conditional, STIBP disabled, RSB filling
Indicadores:                         fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apic
                                     id aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tc
                                     e topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate sme ssbd sev ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero 
                                     irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca
Comment 2 Alberto 2019-08-14 14:19:42 UTC
cpu clocks:
cpu MHz         : 1396.943
cpu MHz         : 1395.566
cpu MHz         : 1393.907
cpu MHz         : 1396.590
cpu MHz         : 1265.845
cpu MHz         : 1319.679
cpu MHz         : 1231.136
cpu MHz         : 1219.892
 
you can see any core entering in idle because the governor thinks that the hardware can not underclock.
Comment 3 djip.perois 2019-09-06 22:30:17 UTC
Same here. I have see the 400MHz seed 1 time after CPU protection on over 85°C CPU

on Fedora30 + kernel 5.2...

anyone can give advise. I have the same Hardware and can patch/build kernel for testing.
Comment 5 djip.perois 2019-09-06 22:44:23 UTC
related:
https://bugzilla.kernel.org/show_bug.cgi?id=204581
Comment 6 damienroch22 2020-03-10 09:08:12 UTC
I have the same machine, this problem still exists on kernel 5.6-rc5.