Regression in lm90 driver regarding GMT g781
Hello,
I have a Wyse C00X thin client which is apparently equipped with GMT g781. It is (or used to be) supported by lm90 driver. (I have a log from 2020 where it was simply working fine; it was kernel version 5.6.0 then.) Now, with 6.8.7, I get following error:
Quoted 1 line
lm90 0-004c: Failed to enable regulator:
-ENODEV
However, when I just turned this message into a warning and let the driver continue, it seems to work fine, providing temp1 and temp2 as previously.
Do you have an idea what could cause such a regression, and if this change (I
mean: simply not returning error from devm_regulator_get_enable) is safe?
Signature · 1 line
Aleksander Mazur
Guenter Roeck
maintainerQuoted 7 lines · Aleksander Mazur
Hello,
I have a Wyse C00X thin client which is apparently equipped with GMT g781. It is (or used to be) supported by lm90 driver. (I have a log from 2020 where it was simply working fine; it was kernel version 5.6.0 then.) Now, with 6.8.7, I get following error:
Quoted 8 lines
Quoted 1 line
lm90 0-004c: Failed to enable regulator:
-ENODEVHowever, when I just turned this message into a warning and let the driver continue, it seems to work fine, providing temp1 and temp2 as previously.
Do you have an idea what could cause such a regression, and if this change (I
mean: simply not returning error fromdevm_regulator_get_enable) is safe?
Do you have CONFIG_REGULATOR enabled in your system ?
Guenter
Dnia 2024-04-20, o godz. 11:14:06
Guenter Roeck <[email protected]> napisał(a):
Quoted 13 lines · Aleksander Mazur
Quoted 12 lines
Hello,
I have a Wyse C00X thin client which is apparently equipped with GMT g781. It is (or used to be) supported by lm90 driver. (I have a log from 2020 where it was simply working fine; it was kernel version 5.6.0 then.) Now, with 6.8.7, I get following error:
Quoted 1 line
lm90 0-004c: Failed to enable regulator:
-ENODEVHowever, when I just turned this message into a warning and let the driver continue, it seems to work fine, providing temp1 and temp2 as previously.
Quoted 7 lines
Quoted 3 lines
Do you have an idea what could cause such a regression, and if this change (I mean: simply not returning error from
devm_regulator_get_enable) is safe?Do you have
CONFIG_REGULATORenabled in your system ?Guenter
No, it's disabled (and it was disabled in 5.6.0 as well).
Shouldn't devm_regulator_get_enable*() stubs return success instead of -ENODEV?
Signature · 1 line
Aleksander Mazur
Guenter Roeck
maintainerQuoted 20 lines · Aleksander Mazur
Dnia 2024-04-20, o godz. 11:14:06
Guenter Roeck <[email protected]> napisał(a):Quoted 17 lines · Aleksander Mazur
Quoted 15 lines
Hello,
I have a Wyse C00X thin client which is apparently equipped with GMT g781. It is (or used to be) supported by lm90 driver. (I have a log from 2020 where it was simply working fine; it was kernel version 5.6.0 then.) Now, with 6.8.7, I get following error:
Quoted 1 line
lm90 0-004c: Failed to enable regulator:
-ENODEVHowever, when I just turned this message into a warning and let the driver continue, it seems to work fine, providing temp1 and temp2 as previously.
Do you have an idea what could cause such a regression, and if this change (I mean: simply not returning error from
devm_regulator_get_enable) is safe?
Quoted 6 lines
Quoted 3 lines
Do you have
CONFIG_REGULATORenabled in your system ?Guenter
No, it's disabled (and it was disabled in 5.6.0 as well).
I thought so. It works in v6.1 and earlier kernels because devm_regulator_get() returns NULL if CONFIG_REGULATOR=n. The driver used that function prior to commit ad804a4d82fc ("hwmon: (lm90) simplify using devm_regulator_get_enable()").
Quoted 2 lines
Shouldn't devm_regulator_get_enable*() stubs return success instead of
-ENODEV?
One might think so, but apparently the author thought otherwise. It looks like the function can not be used for drivers which have to work with CONFIG_REGULATOR=n. The only option I can see is to revert commit ad804a4d82fc because that commit doesn't just simplify the code but also make regulator support mandatory. Matti, do you have a better idea ? Other hwmon drivers are affected as well, so we'll need a common solution.
Aleksander, for your use case, you can just drop the offending code until the fix (or revert) makes it upstream. Sorry for the trouble.
Thanks,
Guenter
Quoted 32 lines · Guenter Roeck
Quoted 20 lines · Aleksander Mazur
Dnia 2024-04-20, o godz. 11:14:06
Guenter Roeck <[email protected]> napisał(a):Quoted 17 lines · Aleksander Mazur
Quoted 15 lines
Hello,
I have a Wyse C00X thin client which is apparently equipped with GMT g781. It is (or used to be) supported by lm90 driver. (I have a log from 2020 where it was simply working fine; it was kernel version 5.6.0 then.) Now, with 6.8.7, I get following error:
Quoted 1 line
lm90 0-004c: Failed to enable regulator:
-ENODEVHowever, when I just turned this message into a warning and let the driver continue, it seems to work fine, providing temp1 and temp2 as previously.
Do you have an idea what could cause such a regression, and if this change (I mean: simply not returning error from
devm_regulator_get_enable) is safe?Quoted 6 lines
Quoted 3 lines
Do you have
CONFIG_REGULATORenabled in your system ?Guenter
No, it's disabled (and it was disabled in 5.6.0 as well).
I thought so. It works in v6.1 and earlier kernels because
devm_regulator_get()returns NULL ifCONFIG_REGULATOR=n. The driver used that function prior to commitad804a4d82fc("hwmon: (lm90) simplify usingdevm_regulator_get_enable()").
Quoted 4 lines
Quoted 2 lines
Shouldn't devm_regulator_get_enable*() stubs return success instead of
-ENODEV?One might think so, but apparently the author thought otherwise.
Apparently the author has not known what he is doing :)
I have a faint memory that I chose to return an error because some of the other stubs did that. Looking at the header, it seems the variants of *_regulator_get_optional() and *_regulator_get_exclusive() return an error, which may be where I picked the return value.
Now, thinking of the use-cases and the comment in the stub of the regulator_get() - I think we should just return success from the stub. I'll send a patch and let's see what Mark says.
Sorry for the hassle.
-- Matti
Quoted 12 lines
It looks
like the function can not be used for drivers which have to work withCONFIG_REGULATOR=n. The only option I can see is to revert commitad804a4d82fcbecause that commit doesn't just simplify the code but also make regulator support mandatory. Matti, do you have a better idea ? Other hwmon drivers are affected as well, so we'll need a common solution.Aleksander, for your use case, you can just drop the offending code until the fix (or revert) makes it upstream. Sorry for the trouble.
Thanks,
Guenter
Signature · 5 lines
Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~