mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Shih-Yuan Lee <fourdollars@debian.org>
Cc: Henrik Rydberg <rydberg@bitmath.org>, Armin Wolf <W_Armin@gmx.de>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 3/3] hwmon: (applesmc) Convert to hwmon_device_register_with_info
Date: Sun, 19 Jul 2026 07:40:13 -0700	[thread overview]
Message-ID: <8323060d-afeb-48fd-a0be-892fdef8a844@roeck-us.net> (raw)
In-Reply-To: <20260711093323.14529-4-fourdollars@debian.org>

On Sat, Jul 11, 2026 at 05:33:23PM +0800, Shih-Yuan Lee wrote:
> The legacy hwmon_device_register() function is deprecated and triggers
> warnings in dmesg. Convert the driver to the modern
> hwmon_device_register_with_info() API.
> 
> This conversion does the following:
> - Dynamically allocates standard HWMON temp, fan, and pwm channels.
> - Configures HWMON ops callbacks (.is_visible, .read, .read_string, .write).
> - Standardizes attribute naming to match the HWMON ABI:
>   - fanX_output -> fanX_target (HWMON_F_TARGET)
>   - fanX_manual -> pwmX_enable (HWMON_PWM_ENABLE)
> - Dynamically registers non-standard fanX_safe attributes under the HWMON
>   class directory via extra_groups.
> - Cleans up legacy sysfs nodes, groups, and unused show/store static functions
>   to avoid unused symbol compiler warnings.
> - Avoids recursive mutex deadlocks when writing to pwmX_enable by locklessly
>   resolving the entry and invoking the underlying raw SMC read/write calls.
> - Avoids UAF race condition on module exit by using unmanaged registration and
>   explicitly calling hwmon_device_unregister() as the first step of applesmc_exit(),
>   guaranteeing that HWMON nodes are destroyed before static structures are freed.
> 
> Signed-off-by: Shih-Yuan Lee <fourdollars@debian.org>

Applied.

Thanks,
Guenter

      reply	other threads:[~2026-07-19 14:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10 12:32 [PATCH 0/1] " Shih-Yuan Lee
2026-07-10 12:32 ` [PATCH 1/1] " Shih-Yuan Lee
2026-07-10 14:01   ` Guenter Roeck
2026-07-10 21:10     ` Armin Wolf
2026-07-10 22:28       ` Guenter Roeck
2026-07-11  2:51         ` Shih-Yuan Lee (FourDollars)
2026-07-11  3:36 ` [PATCH v2 0/1] " Shih-Yuan Lee
2026-07-11  3:37   ` [PATCH v2 1/1] " Shih-Yuan Lee
2026-07-11  5:39 ` [PATCH v3 0/1] " Shih-Yuan Lee
2026-07-11  5:39   ` [PATCH v3 1/1] " Shih-Yuan Lee
2026-07-11  6:06 ` [PATCH v4 0/1] " Shih-Yuan Lee
2026-07-11  6:06   ` [PATCH v4 1/1] " Shih-Yuan Lee
2026-07-11  7:57 ` [PATCH v5 0/3] " Shih-Yuan Lee
2026-07-11  7:57   ` [PATCH v5 1/3] hwmon: (applesmc) Cache fan positions during register initialization Shih-Yuan Lee
2026-07-11  7:57   ` [PATCH v5 2/3] hwmon: (applesmc) Fix lockless cache validation data race Shih-Yuan Lee
2026-07-11  7:57   ` [PATCH v5 3/3] hwmon: (applesmc) Convert to hwmon_device_register_with_info Shih-Yuan Lee
2026-07-11  9:33 ` [PATCH v6 0/3] " Shih-Yuan Lee
2026-07-11  9:33   ` [PATCH v6 1/3] hwmon: (applesmc) Cache fan positions during register initialization Shih-Yuan Lee
2026-07-19 14:37     ` Guenter Roeck
2026-07-11  9:33   ` [PATCH v6 2/3] hwmon: (applesmc) Fix lockless cache validation data race Shih-Yuan Lee
2026-07-19 14:38     ` Guenter Roeck
2026-07-11  9:33   ` [PATCH v6 3/3] hwmon: (applesmc) Convert to hwmon_device_register_with_info Shih-Yuan Lee
2026-07-19 14:40     ` 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=8323060d-afeb-48fd-a0be-892fdef8a844@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=W_Armin@gmx.de \
    --cc=fourdollars@debian.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rydberg@bitmath.org \
    /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®