All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sebastián Peyrott" <speyrott@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [RFC PATCH 1/1] hwmon: Add Minisforum UM780 XTX EC monitoring and fan control
Date: Sat,  8 Aug 2026 01:21:20 -0300	[thread overview]
Message-ID: <20260808042120.37299-1-speyrott@gmail.com> (raw)
In-Reply-To: <9005518b-98c1-4e78-83d5-c2493ad331d0@roeck-us.net>

Thanks for the review. I have prepared the following changes for v2.

> pwm[12]_enable can be implemented as standard attributes. Also,
> looking into the code, pwm2_enable always returns 2, can not be modified,
> and is therefore pointless.

Agreed. pwm1_enable now uses the standard hwmon callbacks, and I removed the
constant pwm2_enable attribute.

> On top of that, the different definitions for pwm1_enable and pwm2_enable
> are confusing. What is the "OEM B1" and "OEM B2" CPU profile, and what
> does it have to do with fan control enable status ?

The EC firmware implements two predefined automatic CPU fan curves. The EC
stores the selected profile as 0xb1 or 0xb2 in its profile register, which is
why I called them B1 and B2. In practice B1 is slightly less aggressive than
B2, although the difference between them is small.

I mapped them to pwm1_enable values 2 and 3 because both select automatic fan
control modes; Documentation/ABI/testing/sysfs-class-hwmon defines values 2+
that way and leaves the individual mode details to the driver documentation.
If B1 and B2 are not useful names for users, I am happy to document them under
more descriptive names instead.

> What is the point of this (constant) non-standard attribute ?

I removed pwm2_auto_channels_temp.

> The pwm2_auto_point[12]_pwm attributes are constant values and therefore
> pointless.

Agreed, I removed them.

> Use hwmon subsystem lock and guard().

Done. The standard attributes rely on the hwmon core serialization. The two
extra threshold attributes and the PM callbacks use guard(hwmon_lock), and the
private mutex is gone.

> clamp and round. We do not expect users to know exact ranges and values.

Done. Threshold values are rounded to whole degrees Celsius and clamped while
preserving strict ordering.

> Since UM780XTX_EC_SYS_POINT3 is never modified, why not read it once ?

It is now read once at probe.

> At least in the current code this is pointless. Just returning 0444 would do.

I simplified is_visible accordingly, with the additional 0644 case for the
standard pwm1_enable attribute.

> channel is always < 2

I removed both redundant channel checks and the redundant locks in the core
read callback.

> Drop "fan control temperature"
>
> Drop "fan". It is confusing that temperature and fan index values are
> reversed. Why is temp1 the SYS temperature, but fan1 the CPU fan speed ?

The labels are now simply "CPU" and "SYS", and the channels are aligned so
temp1/fan1 are CPU and temp2/fan2 are SYS.

> Pointless check. That is what is_visible is for.

Removed.

> Since those are cached states, how would this ever happen ?

I removed the redundant range check from the restore path. State is validated
when it is cached.

> Why those noisy warnings on errors, but no warning if sys_points_valid
> and/or profile_valid are false due to failed range checks ?

I removed the validity flags and runtime warnings. State caching now returns
an error for either transport or validation failures, and probe fails if the
initial state is not coherent.

> This is highly unusual. Normally suspend would save the state
> and resume would restore it. What is the point of _checking_ the state
> on resume ?
>
> Also, what is the point of the delay after resume ? The cached values
> could have been changed via sysfs attributes in the meantime, causing
> spurious warnings.

I replaced the delayed work and module parameter with the conventional
suspend/save and synchronous resume/restore pattern. On the target system I
verified that the selected CPU profile and 50/70 C SYS thresholds were correct
in the first userspace sample after s2idle resume and remained stable for 15
seconds.

I will give this some time for further feedback before sending v2.

Thanks,
Sebastian

      reply	other threads:[~2026-08-08  4:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07  0:38 [RFC PATCH 0/1] hwmon: Add Minisforum UM780 XTX EC monitoring and fan control Sebastián Peyrott
2026-08-07  0:38 ` [RFC PATCH 1/1] " Sebastián Peyrott
2026-08-07  0:47   ` sashiko-bot
2026-08-07  1:59   ` Guenter Roeck
2026-08-08  4:21     ` Sebastián Peyrott [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=20260808042120.37299-1-speyrott@gmail.com \
    --to=speyrott@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.