[cpusensor] pingTimer and creationTimer are conflict??

Jae Hyun Yoo jae.hyun.yoo at linux.intel.com
Wed Apr 3 06:22:36 AEDT 2019


On 4/2/2019 9:17 AM, Jae Hyun Yoo wrote:
> On 4/1/2019 11:14 PM, John Wang wrote:
>> Hi Jae,
>>
>> When two cpus are configured in the entity-manager and there is only 
>> one cpu on the motherboard, the cpusensor service cannot expose cpu 
>> sensor information to dbus.
>> Before [this 
>> change](https://gerrit.openbmc-project.xyz/c/openbmc/dbus-sensors/+/18963), 
>> cpu sensor information can be exposed to dbus.
>>
>> By checking the code,I found that pingTimer causes detectCpu to be 
>> executed every 1s, and the detectCpu function calls 
>> creationTimer.expires_from_now(3s/5s), which causes the callback of 
>> creationTimer to only enter the cancel 
>> state(boost::asio::error::operation_aborted).
>>
>> Only when all the cpu configured in the entity-mangaer are detected 
>> will stop pinging.
>>
>> Is this a bug ?
> 
> Hi John,
> 
> Ah, yeah, there is. That's a bug. In that case, detectCpu() will be
> repeatedly called every second and resets the 3s creationTimer so
> createSensors() will never be called.
> 
> Thanks for reporting the issue. I'll submit a patch soon.

I made a patch. Please try this patch:
https://gerrit.openbmc-project.xyz/c/openbmc/dbus-sensors/+/20056

Thanks,

Jae


More information about the openbmc mailing list