Bug 1466991

Summary: Frequency scaling and thermal zones do not work for iMX6 SOC
Product: [Fedora] Fedora Reporter: billiboy
Component: kernelAssignee: Peter Robinson <pbrobinson>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: gansalmon, ichavero, itamar, jonathan, kernel-maint, madhu.chinakonda, mchehab, pbrobinson
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kernel-4.15.2-300.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-05 17:14:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 245418    

Description billiboy 2017-07-01 08:20:41 UTC
Description of problem:

Frequency scaling and thermal zones do not work for iMX6 SOC

Version-Release number of selected component (if applicable):

current fedora stock kernel

How reproducible:

Always with fedora stock kernel

Steps to Reproduce:

Boot fedora on iMX6 SOC device

Actual results:
ls /sys/devices/system/cpu/cpufreq/
 ==> empty directory

start tmon
 ==> No thermal zones found, exit

Expected results:
populated directories:
/sys/devices/system/cpu/cpufreq/policy0
 affected_cpus
 cpuinfo_cur_freq
 cpuinfo_max_freq
 cpuinfo_min_freq
 cpuinfo_transition_latency
 related_cpus
 scaling_available_frequencies
 scaling_available_governors
 scaling_cur_freq
 scaling_driver
 scaling_governor
 scaling_max_freq
 scaling_min_freq
 scaling_setspeed
/sys/devices/system/cpu/cpufreq/policy0/stats
 reset
 time_in_state
 total_trans
 trans_table

proper tmon status:
TMON v1.0

+----------------------------------------------------THERMAL ZONES(SENSORS)----+
|Thermal Zones:                 imx_therm00                                    |
|Trip Points:                   CP                                             |
+------------------------------------------------------------------------------+
+--------------------------------------------------------- COOLING DEVICES ----+
|ID  Cooling Dev   Cur    Max   Thermal Zone Binding                           |
|00 thermal-cpuf     0      2   ||||||||||||                                   |
|01   134000.gpu     0      6   ||||||||||||                                   |
|02   130000.gpu     0      6   ||||||||||||                                   |
|03  2204000.gpu     0      6   ||||||||||||                                   |
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
|                         10        20        30        40 ...      100  ...   |
|imx_th 0:[ 36][>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>      ... P95  C100 ...   |
+------------------------------------------------------------------------------+
+---------------------------------------------------------------- CONTROLS ----+
|PID gain: kp=0.36 ki=5.00 kd=0.19 Output 0.00                                 |
|Target Temp: 65.0C, Zone: 0, Control Device: None                             |
+------------------------------------------------------------------------------+

Additional info:

Building the fedora kernel source package with CONFIG_ARM_IMX6Q_CPUFREQ=y, CONFIG_IMX_THERMAL=y, CONFIG_NVMEM=y, CONFIG_NVMEM_IMX_OCOTP=y, i.e flipping the modules to build-in make it work for me. cat /sys/devices/system/cpu/cpufreq/policy0/stats/time_in_state reports proper frequency state usage and the by fuses provided trip points get used.

Comment 1 Peter Robinson 2017-09-19 16:20:43 UTC
> Additional info:
> 
> Building the fedora kernel source package with CONFIG_ARM_IMX6Q_CPUFREQ=y,
> CONFIG_IMX_THERMAL=y, CONFIG_NVMEM=y, CONFIG_NVMEM_IMX_OCOTP=y, i.e flipping
> the modules to build-in make it work for me. cat
> /sys/devices/system/cpu/cpufreq/policy0/stats/time_in_state reports proper
> frequency state usage and the by fuses provided trip points get used.

Which shouldn't be the case, it should work when built modular. We can't build everything in for a distro kernel or else we'd not have enough memory to run. This really needs to be fixed upstream

Comment 2 Peter Robinson 2018-02-10 18:20:52 UTC
This will be fixed in 4.15.3+

Comment 3 Peter Robinson 2018-02-14 11:23:25 UTC
Fixed in https://bodhi.fedoraproject.org/updates/FEDORA-2018-380eff4288