public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: James Calligeros <jcalligeros99@gmail.com>
To: Hardware Monitoring <linux-hwmon@vger.kernel.org>,
	Guenter Roeck <linux@roeck-us.net>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Nathan Chancellor <nathan@kernel.org>,
	Neal Gompa <neal@gompa.dev>, Janne Grunau <j@jannau.net>
Subject: Re: [PATCH 1/2] hwmon: (macsmc) Fix regressions in Apple Silicon SMC hwmon driver
Date: Fri, 20 Feb 2026 20:20:37 +1000	[thread overview]
Message-ID: <3032259.e9J7NaK4W3@setsuna> (raw)
In-Reply-To: <20260129175112.3751907-2-linux@roeck-us.net>

On Friday, 30 January 2026 3:51:10 am Australian Eastern Standard Time
Guenter Roeck wrote:
> The recently added macsmc-hwmon driver contained several critical
> bugs in its sensor population logic and float conversion routines.
> 
> Specifically:
> - The voltage sensor population loop used the wrong prefix ("volt-"
>   instead of "voltage-") and incorrectly assigned sensors to the
>   temperature sensor array (hwmon->temp.sensors) instead of the
>   voltage sensor array (hwmon->volt.sensors). This would lead to
>   out-of-bounds memory access or data corruption when both temperature
>   and voltage sensors were present.
> - The float conversion in macsmc_hwmon_write_f32() had flawed exponent
>   logic for values >= 2^24 and lacked masking for the mantissa, which
>   could lead to incorrect values being written to the SMC.
> 
> Fix these issues to ensure correct sensor registration and reliable
> manual fan control.
> 
> Confirm that the reported overflow in FIELD_PREP is fixed by declaring
> macsmc_hwmon_write_f32() as __always_inline for a compile test.
> 
> Fixes: 785205fd8139 ("hwmon: Add Apple Silicon SMC hwmon driver")
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Closes: https://lore.kernel.org/linux-hwmon/20260119195817.GA1035354@ax162/
> Cc: James Calligeros <jcalligeros99@gmail.com>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: Neal Gompa <neal@gompa.dev>
> Cc: Janne Grunau <j@jannau.net>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  drivers/hwmon/macsmc-hwmon.c | 23 ++++++++++-------------
>  1 file changed, 10 insertions(+), 13 deletions(-)
> 

Reviewed-by: James Calligeros <jcalligeros99@gmail.com> for the series.

It would be helpful to Cc the Asahi list as per MAINTAINERS in the
future; any one of us could have reviewed and tested these two patches while
I had been unable to[1].

Regards,
James

[1] https://lore.kernel.org/asahi/CAHgNfTynZHNt3=JY82-WPR1b_1JyoJ=hnazcPwJtSStOZsA1=g@mail.gmail.com/



  parent reply	other threads:[~2026-02-20 10:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 17:51 [PATCH 0/2] hwmon: (macsmc) Various fixes hwmon driver Guenter Roeck
2026-01-29 17:51 ` [PATCH 1/2] hwmon: (macsmc) Fix regressions in Apple Silicon SMC " Guenter Roeck
2026-02-03  8:06   ` Nathan Chancellor
2026-02-12  6:18     ` Guenter Roeck
2026-02-20 10:20   ` James Calligeros [this message]
2026-01-29 17:51 ` [PATCH 2/2] hwmon: (macsmc) Fix overflows, underflows, and sign extension Guenter Roeck

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=3032259.e9J7NaK4W3@setsuna \
    --to=jcalligeros99@gmail.com \
    --cc=j@jannau.net \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nathan@kernel.org \
    --cc=neal@gompa.dev \
    /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