Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Zinc Lim" <limzhineng2@gmail.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH net-next v3 4/6] eth: fbnic: report temperature and voltage thresholds via hwmon
Date: Wed, 09 Sep 2026 22:57:56 +0000	[thread overview]
Message-ID: <20260909225757.250701F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260908225737.3034403-5-limzhineng2@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Unsupported threshold attributes are unconditionally exposed in sysfs, violating hwmon is_visible semantics.
--

commit 7ed3607652912ec9e3313daf244c76341872a2fc
Author: Zinc Lim <limzhineng2@gmail.com>

eth: fbnic: report temperature and voltage thresholds via hwmon

The firmware capability response carries per-board temperature
(min/max/crit) and voltage (min/max) thresholds. These are parsed and
exposed through the hwmon interface, returning -ENODATA if the firmware
did not report them.

> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c b/drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c
> index c8e7ff1d36fc1..7dc4d705f5662 100644
> --- a/drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c
> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c
> @@ -7,16 +7,6 @@
>  #include "fbnic.h"
>  #include "fbnic_mac.h"
>  
[ ... ]
>  static umode_t fbnic_hwmon_is_visible(const void *drvdata,
>  				      enum hwmon_sensor_types type,
>  				      u32 attr, int channel)
>  {
>  	return 0444;
>  }

[Severity: Medium]
Does this unconditionally expose sysfs attributes even when they are not
supported by the firmware?

Since this patch introduces threshold values that might be missing and
represented by FBNIC_SENSOR_NO_DATA, the hwmon is_visible callback should
return 0 for those unsupported attributes rather than having the read
callback unconditionally return -ENODATA. Creating sysfs entries that
cannot be read clutters sysfs and violates the expected hwmon API contract.

Could fbnic_hwmon_is_visible be updated to inspect the cached capabilities
via drvdata and return 0 when the corresponding threshold is set to
FBNIC_SENSOR_NO_DATA?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260908225737.3034403-1-limzhineng2@gmail.com?part=4

  reply	other threads:[~2026-09-09 22:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 22:57 [PATCH net-next v3 0/6] eth: fbnic: expand hwmon sensor support Zinc Lim
2026-09-08 22:57 ` [PATCH net-next v3 1/6] eth: fbnic: move sensor read logic out of fbnic_mac Zinc Lim
2026-09-09 22:57   ` sashiko-bot
2026-09-08 22:57 ` [PATCH net-next v3 2/6] eth: fbnic: expose all hwmon attributes unconditionally as read-only Zinc Lim
2026-09-09 22:57   ` sashiko-bot
2026-09-11  4:58   ` netdev-bot+sashiko
2026-09-08 22:57 ` [PATCH net-next v3 3/6] eth: fbnic: cache hwmon sensor readings Zinc Lim
2026-09-09 22:57   ` sashiko-bot
2026-09-11  4:58   ` netdev-bot+sashiko
2026-09-08 22:57 ` [PATCH net-next v3 4/6] eth: fbnic: report temperature and voltage thresholds via hwmon Zinc Lim
2026-09-09 22:57   ` sashiko-bot [this message]
2026-09-11  4:58   ` netdev-bot+sashiko
2026-09-08 22:57 ` [PATCH net-next v3 5/6] eth: fbnic: report temperature and voltage alarms " Zinc Lim
2026-09-09 22:57   ` sashiko-bot
2026-09-11  4:58   ` netdev-bot+sashiko
2026-09-08 22:57 ` [PATCH net-next v3 6/6] eth: fbnic: firmware notifies hwmon on sensor threshold events Zinc Lim
2026-09-09 22:58   ` sashiko-bot
2026-09-11  4:58   ` netdev-bot+sashiko

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=20260909225757.250701F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=limzhineng2@gmail.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.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