Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel config default HWMON THERMAL. Build both into kernel. Or both as module. #2182

Closed
chris001 opened this issue Aug 30, 2017 · 25 comments
Closed
Labels
Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator.

Comments

@chris001
Copy link

chris001 commented Aug 30, 2017

From: lm-sensors/lm-sensors#30

The raspberry pi kernel is being built with config defaults which prevent the lm-sensors package from using the thermal-hwmon bridge to read the CPU temperature from the RPi Broadcom SoC ARM CPU's built-in thermal sensor.

This is causing issues in Webmin, which has been unable to see the RPi CPU temp. Webmin relies on the lm-sensors package to obtain the CPU temp from whichever CPU sensor lm-sensors is able to automatically detect on the RPi server.
Also: webmin/webmin#625

This issue should be easily fixed by modifying the default kernel build config settings used to build the released RPi Foundation kernel, to enable the lm-sensors package running on the released kernel to be able to obtain the CPU temperature data thru the thermal-hwmon bridge, saving the user having to do further work, such as learn how to manually recompile the kernel, and wait a long time for it to complete.

From @groeck :
"The thermal-hwmon bridge only works if THERMAL and HWMON are both configured to be built as module, or if both are configured to be built into the kernel. Based on the above, it appears that THERMAL is built into the kernel, and HWMON is built as module. With this configuration, the bridge does not work since code built into the kernel can not call functions declared in a module. On top of that, it is necessary to enable THERMAL_HWMON."

@jonsnow1357
Copy link

jonsnow1357 commented Aug 30, 2017

this also causes issues with sysstat which uses lm-sensors as back-end for reading sensors information.

I think the following kernel config options are necessary (as you can see from the lm-sensors issue referenced above), but I cannot figure where to enable them :(
CONFIG_THERMAL
CONFIG_HWMON
CONFIG_THERMAL_HWMON

Thanks

@kukabu
Copy link

kukabu commented Aug 31, 2017

It's cool feature and I use it. But I have bad new for you, it's not working with the upstream thermal driver. I wrote the trivial fix but it's still pending in the upstream :(.
https://patchwork.kernel.org/patch/9832799/

@groeck
Copy link
Contributor

groeck commented Aug 31, 2017 via email

@JamesH65
Copy link
Contributor

JamesH65 commented Dec 5, 2017

Any progress on this issue? Should it be closed?

@JamesH65 JamesH65 added the Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator. label Dec 5, 2017
@groeck
Copy link
Contributor

groeck commented Dec 5, 2017

I never heard back from the thermal maintainers.

Edit: I did hear back. Thermal maintainers are ok with an internal property, but ask for approval from DT maintainers.

@pelwell
Copy link
Contributor

pelwell commented Dec 5, 2017

Have you tried with CONFIG_THERMAL=m? There would be small increase in overall kernel size, but we would consider it if everything still works as expected.

@groeck
Copy link
Contributor

groeck commented Dec 5, 2017 via email

@pelwell
Copy link
Contributor

pelwell commented Dec 5, 2017

Why not? The issue title says "Build both into kernel. Or both as module."

@groeck
Copy link
Contributor

groeck commented Dec 5, 2017

See kukabu's comment. Note that I was wrong re thermal maintainers - I did hear back. Only, as mentioned above, a kernel-internal property does not work, or at least not easily. I'll be happy to stand corrected, though, and I'll be more that happy to accept respective patches.

@JamesH65
Copy link
Contributor

Was there any news? Did this stuff make it in to the upstream kernel?

This issue will be closed within 30 days unless further interactions are posted. If you wish this issue to remain open, please add a comment. A closed issue may be reopened if requested.

@JamesH65 JamesH65 added the Close within 30 days Issue will be closed within 30 days unless requested to stay open label Jun 27, 2018
@Ferroin
Copy link
Contributor

Ferroin commented Jul 10, 2018

Based on what I can tell, this did not make it upstream.

Unfortunately, this is also making Netdata's sensor monitoring plugin not work correctly (as it too relies on lm_sensors for data collection).

@JamesH65
Copy link
Contributor

So, what needs to be done to progress this, or should it be closed?

@JamesH65 JamesH65 removed the Close within 30 days Issue will be closed within 30 days unless requested to stay open label Aug 31, 2018
@groeck
Copy link
Contributor

groeck commented Aug 31, 2018

drivers/thermal/rcar_thermal.c provides an example how to implement this. It does look kind of messy, but it may work. Someone with an affected system would have to try and make it work.

@lategoodbye
Copy link
Contributor

Matthias Brugger send a patch to fix this issue:
https://patchwork.kernel.org/patch/10651645/

@pssc
Copy link

pssc commented Feb 14, 2019

has this landed in a kernel people can use?

Matthias Brugger send a patch to fix this issue:
https://patchwork.kernel.org/patch/10651645/

@lategoodbye
Copy link
Contributor

lategoodbye commented Feb 15, 2019

This has been merged in current mainline and will be available in Linux 5.0.

@kukabu
Copy link

kukabu commented Feb 16, 2019

... in 4.20.8 already

@JamesH65
Copy link
Contributor

This will be released when we move to the next kernel bump. Closing issue.

@chris001
Copy link
Author

It looks like Brugger patched only for BCM2835, which powers only the older hardware: RPi 1A, 1A+, 2A, 2A+, Compute 1, Zero v1.2, Zero v1.3, Zero W?
What about all the other Broadcom system on chip models running the newer RPi 2B, 3A, 3A+, 3B, 3B+, Compute 3, 4B and newer hardware?
https://en.wikipedia.org/wiki/Raspberry_Pi
BCM2835: RPi 1A, 1A+, 2A, 2A+, Compute 1, Zero v1.2, Zero v1.3, Zero W.
BCM2836: RPi 2B.
BCM2837: RPi 2Bv1.2, 3B, Compute 3, Compute 3 Lite.
BCM2837b0: RPi 3A+, 3B+, Compute 3+, Compute 3+ Lite.
BCM2711: RPi 4B.

@lategoodbye
Copy link
Contributor

Except of the RPi 4B all Raspberries use the same thermal driver. The BCM2835 stands for the architecture not for the SoC. Yes, this can be very confusing.

@chris001
Copy link
Author

Thanks. What would need to be done to enable hwmon by default on thermal_zone for RPi 4B ?

@lategoodbye
Copy link
Contributor

Need to take a look ...

@konistehrad
Copy link

Sorry to necro an old thread, but has there been progress on bringing the RPi 4 into the fold?

@lategoodbye
Copy link
Contributor

I plan to make a backport of Linux 5.6 which contains the new thermal driver. But just for 5.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator.
Projects
None yet
Development

No branches or pull requests