Issue with upstream BCM2835 thermal and hwmon.

Stefan Wahren stefan.wahren at i2se.com
Mon Jul 10 02:11:51 PDT 2017


Am 10.07.2017 um 07:41 schrieb Michael Tatarinov:

> 2017-07-08 3:16 GMT+04:00, Stefan Wahren <stefan.wahren at i2se.com>:
>> Hi Michael,
>>
>>> Michael Tatarinov <kukabu at gmail.com> hat am 7. Juli 2017 um 13:59
>>> geschrieben:
>>>
>>>
>>> 2017-07-07 15:32 GMT+04:00, Stefan Wahren <stefan.wahren at i2se.com>:
>>>> Hi Michael,
>>>>
>>>> Am 07.07.2017 um 13:02 schrieb Michael Tatarinov:
>>>>> Hello
>>>>>
>>>>> I uses custom kernel based on downstream code (branch rpi-4.12.y now).
>>>>> My kernel builds with
>>>>> CONFIG_HWMON=y
>>>>> CONFIG_THERMAL=y
>>>>> CONFIG_THERMAL_HWMON=y
>>>>> The downstream thermal driver is registered in hwmon subsystem as
>>>>> virtual device but the upstream isn't.
>>>>> I'm not sure that the problem is in the upstream driver, maybe this is
>>>>> my issue.
>>>>> Does anybody can check it with upstream kernel?
>>>> i didn't know about the relation between hwmon and thermal.
>>> The thermal subsystem have helper for hwmon.
>>> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/thermal/Kconfig#n35
>>>
>>>> Could you please do me a favor and do the following steps:
>>>> 1. Check with your upstream kernel that the thermal_zone is
>>>> successfully
>>>> registered under /sys/class/thermal.
>>> Yes, /sys/class/thermal is exists and I see the current data.
>>>
>>>> 2. Please show me the (missing) hwmon sysfs entries on your downstream
>>>> kernel, because i won't trust some userspace program like sensors.
>>> mike at rpi ~ $ head /sys/class/hwmon/hwmon0/{name,temp1_input}
>>> ==> /sys/class/hwmon/hwmon0/name <==
>>> bcm2835_thermal
>>>
>>> ==> /sys/class/hwmon/hwmon0/temp1_input <==
>>> 59451
>>> mike at rpi ~ $
>> thanks. I can reproduce it with my Raspberry Pi Zero W. But this behavior is
>> desired and not an issue (since the driver has thermal_zone_params):
>>
>> https://github.com/torvalds/linux/commit/ccba4ffd9eff6120a20cc7656458ac554aec4b0c
>>
>> Please ask the thermal guys for a better explanation. Sorry
> It's part of the truth.
> The downstream driver uses thermal_zone_device_register() whereas the
> upstream - thermal_zone_of_sensor_register(). The
> thermal_zone_device_register() calls thermal_add_hwmon_sysfs() but
> thermal_zone_of_sensor_register() doesn't.

Correct, but of-thermal which is a dependency of the upstream driver 
calls thermal_zone_device_register().

Again, if you have a problem with the current of-thermal implementation 
please talk to the thermal guys. Sorry, if this sounds a bit harsh but 
it took us over a year to get this driver upstream.

Regards
Stefan



More information about the linux-rpi-kernel mailing list