From: Guy Boldon <gb@guyboldon.com>
To: linux-hwmon@vger.kernel.org
Cc: gb@guyboldon.com, W_Armin@gmx.de, linux@roeck-us.net,
jan.claussen10@web.de
Subject: Re: Weird Dell SMM bug since 6.18
Date: Thu, 19 Mar 2026 10:49:41 +0100 [thread overview]
Message-ID: <20260319094944.239871-1-gb@guyboldon.com> (raw)
In-Reply-To: <fd277150-af4b-4bd5-af7e-868c9678eb1e@gmx.de>
From: gb@guyboldon.com
Hi, I'm the CoolerControl maintainer, a few notes from the userspace side.
On Mon, Mar 16, 2026 at 17:55:01 -0700, Guenter Roeck wrote:
> Not really. -ENODATA seems to be the correct response if the current pwm
> value is not readable. Returning 0 or any other number would be misleading
> and trigger other problems (such as some userspace code believing that it
> can write the value back with no impact, which would be worse).
For context: thinkpad_acpi has long returned 255 as a dummy value for pwmX
when in auto mode (pwmX_enable=2), since it similarly cannot retrieve the
real PWM value during BIOS control. This was likely motivated by fancontrol
compatibility, which AFAIR requires a readable pwmX. CoolerControl reads pwmX to
confirm a channel is functional and to track data values over time, hence why we
need it readable. We can however adapt our handling for -ENODATA.
On the write concern: several drivers I'm familiar with (e.g. nct67xx, it87,
thinkpad_acpi) do not implicitly switch to manual mode on a pwmX write.
Writing pwmX having no effect when pwmX_enable != 1 is expected, normal
behavior from our perspective.
On Tue, Mar 17, 2026 at 02:29:39 +0100, Armin Wolf wrote:
> I suspect that the successful reads happen after the pwmX attribute has
> been set manually using "cat". The driver will enter manual fan control
> mode automatically in such a case to keep compatibility with legacy
> userspace applications.
That makes sense. Might be worth noting in the docs either way.
As a related point: gpd_fan returns -EOPNOTSUPP rather than -ENODATA
when in auto mode, and documents that behavior in the kernel docs. The
inconsistency between drivers, different errors for the same condition,
means userspace ends up needing per-driver handling for the same use case.
Not ideal, but at least documentation helps.
Thanks,
Guy
next prev parent reply other threads:[~2026-03-19 9:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 12:39 Weird Dell SMM bug since 6.18 Jan Claußen
2026-03-13 16:43 ` Guenter Roeck
2026-03-13 19:06 ` Jan Claußen
2026-03-13 23:10 ` Armin Wolf
2026-03-16 15:52 ` Guenter Roeck
2026-03-16 20:10 ` Jan Claußen
2026-03-17 0:55 ` Guenter Roeck
2026-03-17 1:29 ` Armin Wolf
2026-03-19 9:49 ` Guy Boldon [this message]
2026-03-19 15:52 ` Guenter Roeck
2026-03-22 10:18 ` Guy Boldon
2026-03-23 10:25 ` Armin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260319094944.239871-1-gb@guyboldon.com \
--to=gb@guyboldon.com \
--cc=W_Armin@gmx.de \
--cc=jan.claussen10@web.de \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox