From: "Uwe Kleine-König" <ukleinek@kernel.org>
To: Richard Weinberger <richard@nod.at>
Cc: Guenter Roeck <linux@roeck-us.net>,
linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org,
linux-hwmon@vger.kernel.org, julian.friedrich@frequentis.com
Subject: Re: [PATCH] [RFC] hwmon: nct6775: Register fan PWMs as PWM chip
Date: Tue, 14 Apr 2026 11:48:48 +0200 [thread overview]
Message-ID: <ad4LRX3tkC7lKiZu@monoceros> (raw)
In-Reply-To: <9c733024-8ad6-459d-ae5a-a9825f85c506@roeck-us.net>
[-- Attachment #1: Type: text/plain, Size: 2705 bytes --]
Hello Richard,
On Thu, Feb 26, 2026 at 02:38:27PM -0800, Guenter Roeck wrote:
> On 2/25/26 04:51, Richard Weinberger wrote:
> > The Nuvoton 6775 chip family also offers PWM functionality to control
> > various fans. Depending on the hardware design, the PWM can also be
> > used for other purposes, such as controlling a display backlight.
> >
> > Historically, the driver implemented its own sysfs-based interface to
> > control the PWMs. This made it impossible to use the PWM as a backend
> > for other drivers, such as pwm-backlight.
> >
> > This patch registers the PWM functionality as a PWM chip within the
> > PWM subsystem. Since the Nuvoton chip has non-trivial control logic,
> > the following constraints exist:
> >
> > - Exporting a PWM for external use is only allowed when the fan mode
> > is set to manual or off.
> > - As soon as a PWM is exported, changing its configuration is no
> > longer possible through the hwmon sysfs interface, reading is
> > still allowed.
> > - Changing the PWM period is not supported. IMHO, it is too risky
> > since the PWMs usually control system fans and similar components.
> > - Reading and decoding the current PWM period is only supported for
> > one chip variant so far, for all other chips, a fixed period of
> > 100ms is assumed.
> >
>
> This is a good start, but I'll want to see stronger safeguards.
> - Creating a pwmchip entry for a pwm channel must be triggered by
> device property data, obtained either from devicetree or through
> DMI or through device properties embedded in ACPI data. For each
> channel, this must be confirmed by checking that the channel is
> not associated with a fan control channel.
I personally would be more lax here. root being able to change the
configuration at runtime is fine for me. IMHO this is in line with being
able to unload a driver or manually bind and unbind a driver or
dynamically creating an i2c device via sysfs.
> - If a pwm channel is configured as pwmchip, it must not be used for fan
> control, meaning the hwmon properties associated with that channel
> must not be created.
I fully agree here. At each point in time the hardware should either be
exposed as hwmon or as PWM channel. And if changing that during runtime
is possible, the old configuration must be completely gone before the
new one gets active.
This patch still was in the pwm patchwork as "action required". As is
both Guenter and me agree the patch isn't ready to be merged (though for
different reasons). I discarded the patch from my todo list and updated
the state to "changes requested" now.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2026-04-14 9:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 12:51 [PATCH] [RFC] hwmon: nct6775: Register fan PWMs as PWM chip Richard Weinberger
2026-02-26 17:54 ` Uwe Kleine-König
2026-02-26 18:36 ` Richard Weinberger
2026-02-27 19:57 ` Uwe Kleine-König
2026-02-26 22:38 ` Guenter Roeck
2026-02-27 7:46 ` Richard Weinberger
2026-02-27 8:17 ` Guenter Roeck
2026-02-27 20:02 ` Uwe Kleine-König
2026-02-27 20:59 ` Guenter Roeck
2026-04-14 9:48 ` Uwe Kleine-König [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=ad4LRX3tkC7lKiZu@monoceros \
--to=ukleinek@kernel.org \
--cc=julian.friedrich@frequentis.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=richard@nod.at \
/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