Bug 212501

Summary: IPA governor always sets the cooling device state to zero when there is no mitigation
Product: Power Management Reporter: Daniel Lezcano (daniel.lezcano)
Component: ThermalAssignee: Zhang Rui (rui.zhang)
Status: RESOLVED CODE_FIX    
Severity: normal CC: lukasz.luba
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: v5.12 Subsystem:
Regression: No Bisected commit-id:

Description Daniel Lezcano 2021-03-31 11:54:51 UTC
The throttle function of the power allocator always calls allow_maximum_power() which in turns sets the cooling device state to zero.

As the cooling device state change generates an event, at each timer expiration for mitigation or monitoring, the event is generated for nothing as we set the set state to zero.

The function allow_maximum_power() should be called only when the mitigation switches off.
Comment 1 Lukasz Luba 2021-03-31 15:15:45 UTC
Hi Daniel,
I see your point that we shouldn't generate an event when the device state has not changed. I have to address another issue in there. We shouldn't just ignore calling allow_maximum_power(), the device should be checked, which is currently missing. I will implement the call to update cooling device only once, when for the first time temperature dropped below switch_on_temp, but I will loop through the cooling devices getting their state. If it's not done then the statistics are stale.
Comment 2 Lukasz Luba 2021-05-21 13:55:20 UTC
The issue is solved in mainline by:
commit 0952177f2a1f63b ("thermal/core/power_allocator: Update once cooling devices when temp is low")

So we can close this issue.