Tmon test case failed - max_state is 0 - common issue for all platforms

Bug #2017971 reported by quanxian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
intel
Fix Committed
Undecided
Unassigned
Ubuntu
New
Undecided
Unassigned

Bug Description

Description:

Platform:ADLN02
BIOS:5.25
Processor:Genuine Intel(R) 0000
Kernel:Linux 6.2.0+
OS:UBUNTU2304-PRE-ALPHA

Tmon max_state show 0 and can't change with user guide.
This is a regression.

> Starting from commit c408b3d1d9bb("thermal: Validate new state in
> cur_state_store()") and commit a365105c685c("thermal: sysfs: Reuse
> cdev->max_state"), the cdev->get_max_state() is evaluated only once
> during cooling device registration.
>
> This is done to fix the below Smatch static checker warning:
> drivers/thermal/thermal_sysfs.c:656
> thermal_cooling_device_stats_update()
> warn: potential integer overflow from user 'stats->state *
> stats->max_states + new_state'
> reported here https://lore.kernel.org/all/Y0ltRJRjO7AkawvE@kili/.
>
> But this actually breaks cooling devices which could have dynamic max
> cooling state, like ACPI processor cooling device.
>
> acpi_processor_driver_init
> driver_register(&acpi_processor_driver);
> acpi_processor_start
> acpi_processor_thermal_init
> thermal_cooling_device_register
> processor_get_max_state
> acpi_processor_cpufreq_init = true
> The driver doesn't count cpufreq as cooling state until
> acpi_processor_cpufreq_init is set later.
>
> As a result, without the commits above,
> /sys/class/thermal/cooling_device10/cur_state:0
> /sys/class/thermal/cooling_device10/max_state:3
> /sys/class/thermal/cooling_device10/type:Processor
> after the commits above,
> /sys/class/thermal/cooling_device10/cur_state:0
> /sys/class/thermal/cooling_device10/max_state:0
> /sys/class/thermal/cooling_device10/type:Processor

Reproduce steps:
1.tmon
2.max_state is 0
3. press tab to set max_state
no work

[HW/SW Information]
Target Kernel: 6.3
Target Release: 23.10
Commit ids: 22c52fa5155a2f48aedb0f675903b20457285a27 790930f44289c8209c57461b2db499fcc702e0b3 b57841fb0b564c61508222e885ac8f30a2811089 c0e0421a60bf468e88cf569fbd727346b138ed04 c43198af05cffa5de8d4f356c40ce4bdca066272

Platform Independent

[Business Justification]
Bug Fix

quanxian (quanxian-wang)
Changed in intel:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.