Linux RTC
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Eric Liu" <liuer@nvidia.com>
Cc: linux-rtc@vger.kernel.org,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] rtc: nct3018y: report chassis intrusion through hwmon
Date: Thu, 01 Oct 2026 05:48:21 +0000	[thread overview]
Message-ID: <20261001054821.AEF6E1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261001054108.3346426-1-liuer@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] rtc: nct3018y: hwmon device registration violates layering guidelines
--

commit 12bf4b0b27866f7565ebcc7b10db8faf4943fb10
Author: Eric Liu <liuer@nvidia.com>

rtc: nct3018y: report chassis intrusion through hwmon

This patch adds an hwmon intrusion alarm for the chip's chassis intrusion
latch. Reading it says whether the chassis has been opened since the latch was
last cleared; writing 0 clears it and re-arms.

> diff --git a/drivers/rtc/rtc-nct3018y.c b/drivers/rtc/rtc-nct3018y.c
> index 2f7ad57057a4b..194ba077363aa 100644
> --- a/drivers/rtc/rtc-nct3018y.c
> +++ b/drivers/rtc/rtc-nct3018y.c

[ ... ]

> @@ -491,6 +494,95 @@ static const struct rtc_class_ops nct3018y_rtc_ops = {
>  	.ioctl		= nct3018y_ioctl,
>  };
>  
> +#if IS_REACHABLE(CONFIG_HWMON)

[ ... ]

> +static void nct3018y_hwmon_register(struct nct3018y *nct3018y)
> +{
> +	struct device *dev;
> +
> +	dev = devm_hwmon_device_register_with_info(&nct3018y->client->dev,
> +						   "nct3018y", nct3018y,
> +						   &nct3018y_hwmon_chip_info,
> +						   NULL);
[Severity: Medium]
Does this violate the hardware monitoring subsystem architecture rules?

Registering a hardware monitoring device directly from within
nct3018y_hwmon_register() in drivers/rtc/rtc-nct3018y.c bypasses hwmon
maintainer review and pollutes the RTC driver with secondary hardware
monitoring code.

Could this hwmon functionality be decoupled via an auxiliary device driver
located in the hwmon subsystem directory instead?

> +	if (IS_ERR(dev))
> +		dev_warn(&nct3018y->client->dev,
> +			 "unable to register hwmon device %ld\n", PTR_ERR(dev));
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261001054108.3346426-1-liuer@nvidia.com?part=1

  reply	other threads:[~2026-10-01  5:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01  5:41 [PATCH] rtc: nct3018y: report chassis intrusion through hwmon Eric Liu
2026-10-01  5:48 ` sashiko-bot [this message]
2026-10-01  7:29   ` Alexandre Belloni
2026-10-01 12:29     ` 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=20261001054821.AEF6E1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=liuer@nvidia.com \
    --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