Thread (4 messages) 4 messages, 2 authors, 2012-10-24

Re: [PATCH 1/5] Thermal: do bind operation after thermal zone or cooling device register returns.

From: Francesco Lavra <hidden>
Date: 2012-10-21 10:03:33
Also in: lkml

Hi,

On 10/16/2012 01:44 PM, hongbo.zhang wrote:
From: "hongbo.zhang" <redacted>

In the previous bind function, cdev->get_max_state(cdev, &max_state) is called
before the registration function finishes, but at this moment, the parameter
cdev at thermal driver layer isn't ready--it will get ready only after its
registration, so the the get_max_state callback cannot tell the max_state
according to the cdev input.
This problem can be fixed by separating the bind operation out of registration
and doing it when registration completely finished.
When thermal_cooling_device_register() is called, the thermal framework
assumes the cooling device is "ready", i.e. all of its ops callbacks
return meaningful results. If the cooling device is not ready at this
point, then this is a bug in the code that registers it.
Specifically, the faulty code in your case is in the cpufreq cooling
implementation, where the cooling device is registered before being
added to the internal list of cpufreq cooling devices. So, IMHO the fix
is needed there.

--
Francesco
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help