ram_temp: add jc42 for DDR4#1945
Conversation
This should not be necessary, the jc42 driver does not use any ACPI resources. It talks to the memory over i2c, but perhaps there's an issue with the i2c driver on your motherboard. I'd have to see the error message generated when you're not running that param, to know. I deal with this driver quite a lot, and I've never once seen a board that needs this param for jc42 to load. In any case, the param is required when the motherboard reserves ACPI memory and the driver will not load because it wants to use them, so it's always motherboard-specific whether it is needed. This module was updated in November '24, so in most cases with a kernel from the last year or so, it will load automatically. Most users with DDR4 ram have working temperature sensors already and don't even know it :) Anyway thanks OP! I saw mention of this config option in a goverlay commit and was like "why no jc42? I might go fix that" and here you are beat me to it :) |
|
The module itself does load indeed, but i2c is missing the buses. I'm running Fedora kernel 6.18 with jc42@rhelversion 10.99 🤷♀️ My board also has some other quirks, so probably it's the one to blame. Googling around for But anyhow, great to hear that it should work out of the box. Just left the comment to make sure future users are able to use it if they stumble upon the same. |
Signed-off-by: morph027 <stefan.heitmueller@gmx.com>
7b741e5 to
6ef1c2e
Compare
| auto dirs = ls(path.c_str(), "hwmon", LS_DIRS); | ||
| for (auto &dir : dirs) { | ||
| if (read_line(path + dir + "/name") == "spd5118") | ||
| if (read_line(path + dir + "/name") == "spd5118" or read_line(path + dir + "/name") == "jc42") |
There was a problem hiding this comment.
Every call to read_line reads the file (although it's in RAM)
We should read once and then compare all instead
There was a problem hiding this comment.
Yes, tried it but i've never been into C++ and did not figured it out how to do.
I was trying something like a list comprehension in python if .... in ["spd5118", "jc42"].
Help is appreciated.
There was a problem hiding this comment.
const auto aaa = ...;
if (aaa == "bbb" || aaa == "ccc")
...It's not convenient to do in like Python in C++ so we usually just compare one by one 😂
There was a problem hiding this comment.
Well actually we could do something like
static const std::set<std::string> SET{"bbb", "ccc"};
if (SET.contains(aaa)) ...but I doubt whether it's better in performance
Note that constructing a std::set is expensive so it's not good to construct one every time
Steps taken (on my Gigabyte Aorus B550 Pro V2 with G.Skill Ripjaws F4-3600C14Q @ Samsung B-Dies):
modprobe jc42❯ grep jc42 /sys/class/hwmon/hwmon*/name /sys/class/hwmon/hwmon8/name:jc42 /sys/class/hwmon/hwmon9/name:jc42 ❯ cat /sys/class/hwmon/hwmon8/temp1_input 28437On my board,
sudo i2cdetect -ldoes not list any SMBus for the sensors, so i needed to perform the following step (might be optional):acpi_enforce_resources=laxto kernel commandline and reboot