From: Guenter Roeck <linux@roeck-us.net>
To: Tomasz Bojanowski <tomasz@bojanowski.me>
Cc: linux-hwmon@vger.kernel.org,
Hamza Mahfooz <someguy@effective-light.com>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] hwmon: (nct6683) Make pwmN_auto_channels_temp of NCT6687D-R writable
Date: Sat, 28 Nov 2026 09:30:40 -0800 [thread overview]
Message-ID: <68a7dde4-5a62-47b5-9203-b892bb4a23bf@roeck-us.net> (raw)
In-Reply-To: <20261117071645.587863-1-tomasz@bojanowski.me>
On Tue, Nov 17, 2026 at 08:16:45AM +0100, Tomasz Bojanowski wrote:
> Allow selecting the temperature used by a fan curve on MSI boards with
> an NCT6687D-R (customer ID 0x20d), in manual and in automatic mode.
>
> On an MSI MAG B850M MORTAR WIFI, the BIOS setup offers four temperature
> sources for the fans: CPU Core, System, MOS and Chipset A. Reading the EC
> before and after selecting them shows that each sets a single bit in the
> lowest byte of the fan's source register, the bit of the monitoring
> channel of temp1, temp2, temp3 and temp4 respectively, and that nothing
> else in the fan curve registers changes. The other bytes were never seen
> in use, and how the EC would combine several bits is not known, so only
> a single temperature reported by the driver on the first eight monitoring
> channels can be selected; other values return -EINVAL. The range can be
> extended if a board needs it.
>
> The attribute is writable if, when the driver is loaded, the curve uses
> one such temperature. Before each write the driver checks that this is
> still the case and returns -EBUSY otherwise, so that it does not overwrite
> a source which could not be selected again.
>
> The source is written in a configuration phase and read back, as the
> curve points are. If that fails while the EC responds, the previous
> source is written again. Sources selected through sysfs are restored on
> resume, after the curves and before manual mode.
>
> Tested on an MSI MAG B850M MORTAR WIFI (MS-7E61) with pwm16 and a test
> curve rising by 10 per degree Celsius around the measured temperatures.
> After selecting temp2, temp3 and temp4 in turn in automatic mode, the
> duty cycle followed the curve for the newly selected temperature. Invalid
> values returned -EINVAL and left the source unchanged. A source selected
> in manual mode took effect after switching back to automatic mode. After
> suspend to RAM, the source and the curve were the same as before, and
> manual mode was still restored. With the driver unloaded during suspend,
> the BIOS restored its own curve but the EC kept the selected source, so
> restoring the source on resume could not be tested on this board.
>
> Signed-off-by: Tomasz Bojanowski <tomasz@bojanowski.me>
Applied.
Thanks,
Guenter
prev parent reply other threads:[~2026-11-28 17:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 7:16 Tomasz Bojanowski
2026-11-28 17:30 ` Guenter Roeck [this message]
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=68a7dde4-5a62-47b5-9203-b892bb4a23bf@roeck-us.net \
--to=linux@roeck-us.net \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
--cc=someguy@effective-light.com \
--cc=tomasz@bojanowski.me \
/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
all inboxes | Powered by JetHome®