From: sashiko-bot@kernel.org
To: "Zinc Lim" <limzhineng2@gmail.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH net-next v3 3/6] eth: fbnic: cache hwmon sensor readings
Date: Wed, 09 Sep 2026 22:57:55 +0000 [thread overview]
Message-ID: <20260909225756.62C951F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260908225737.3034403-4-limzhineng2@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Hardware monitoring functionality is implemented directly within the network driver instead of as an auxiliary device in drivers/hwmon/.
--
commit 4fa7201fcb9ec899fe4c2586948bbac1ad1bc36d
Author: Zinc Lim <limzhineng2@gmail.com>
eth: fbnic: cache hwmon sensor readings
This commit adds a caching mechanism for hardware monitoring sensor readings
to reduce the number of firmware mailbox messages. It seeds the cache with
a sentinel value and caches both temperature and voltage readings returned by
a single firmware response.
> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c b/drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c
> index 38bb26cb8e6cb..c8e7ff1d36fc1 100644
> --- a/drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c
> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c
[ ... ]
> @@ -107,6 +118,10 @@ void fbnic_hwmon_register(struct fbnic_dev *fbd)
> if (!IS_REACHABLE(CONFIG_HWMON))
> return;
>
> + /* Seed cache with sentinel so the first read always refreshes. */
> + fbd->hwmon_cache.temp_mdeg = FBNIC_SENSOR_NO_DATA;
> + fbd->hwmon_cache.volt_mv = FBNIC_SENSOR_NO_DATA;
> +
> fbd->hwmon = hwmon_device_register_with_info(fbd->dev, "fbnic",
> fbd, &fbnic_chip_info,
> NULL);
[Severity: High]
This isn't a bug introduced by this patch, but is a pre-existing structural
issue that was explicitly flagged by the subsystem guidelines.
Should this hardware monitoring functionality be implemented as an auxiliary
device driver residing in drivers/hwmon/ instead of directly within the
network driver?
The hardware monitoring subsystem guidelines state that for devices where the
main functionality is not hardware monitoring (such as a network interface
controller), its hwmon functionality must be implemented as an auxiliary
device driver in drivers/hwmon/. Registering the hwmon device unconditionally
here in fbnic_hwmon_register() using hwmon_device_register_with_info()
bypasses hwmon maintainer review and breaks subsystem layering.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260908225737.3034403-1-limzhineng2@gmail.com?part=3
next prev parent reply other threads:[~2026-09-09 22:57 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 [this message]
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
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=20260909225756.62C951F000FF@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 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.