mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lakshay Piplani <lakshay.piplani@nxp.com>
To: Guenter Roeck <linux@roeck-us.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"jic23@kernel.org" <jic23@kernel.org>,
	"dlechner@baylibre.com" <dlechner@baylibre.com>,
	"nuno.sa@analog.com" <nuno.sa@analog.com>,
	"andy@kernel.org" <andy@kernel.org>,
	"marcelo.schmitt1@gmail.com" <marcelo.schmitt1@gmail.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"jstephan@baylibre.com" <jstephan@baylibre.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Cc: "jdelvare@suse.com" <jdelvare@suse.com>,
	Vikash Bansal <vikash.bansal@nxp.com>,
	Priyanka Jain <priyanka.jain@nxp.com>,
	Shashank Rebbapragada <shashank.rebbapragada@nxp.com>
Subject: RE: [EXT] Re: [PATCH v4 0/2] iio: temperature: Add support for NXP P3T175x temperature sensors
Date: Thu, 9 Oct 2025 05:56:14 +0000	[thread overview]
Message-ID: <AS4PR04MB9362FDA1FE35AD06C99B85E3FBEEA@AS4PR04MB9362.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <96f5443f-5b40-4d05-b350-78d55a1d841d@roeck-us.net>


> -----Original Message-----
> From: Guenter Roeck <groeck7@gmail.com> On Behalf Of Guenter Roeck
> Sent: Wednesday, October 8, 2025 7:41 PM
> To: Lakshay Piplani <lakshay.piplani@nxp.com>; linux-kernel@vger.kernel.org;
> linux-iio@vger.kernel.org; jic23@kernel.org; dlechner@baylibre.com;
> nuno.sa@analog.com; andy@kernel.org; marcelo.schmitt1@gmail.com;
> gregkh@linuxfoundation.org; viro@zeniv.linux.org.uk; peterz@infradead.org;
> jstephan@baylibre.com; robh@kernel.org; krzk+dt@kernel.org;
> conor+dt@kernel.org; devicetree@vger.kernel.org
> Cc: jdelvare@suse.com; Vikash Bansal <vikash.bansal@nxp.com>; Priyanka
> Jain <priyanka.jain@nxp.com>; Shashank Rebbapragada
> <shashank.rebbapragada@nxp.com>
> Subject: [EXT] Re: [PATCH v4 0/2] iio: temperature: Add support for NXP
> P3T175x temperature sensors
> 
> [You don't often get email from linux@roeck-us.net. Learn why this is
> important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
> 
> 
> On 10/8/25 03:07, Lakshay Piplani wrote:
> > This patch adds support for the P3T1750/P3T1755 temperature sensors
> under the IIO subsystem.
> >
> > P3T1750/P3T1755 support two operational modes:
> > 1. Comparator Mode
> > 2. Interrupt (Latched) Mode
> >
> > The HWMON subsystem is more suitable for implementing drivers for
> comparator mode operations.
> > Reason:
> >    - Temperature thresholds can be polled and exposed via sysfs.
> >    - Register reads do not clear status, allowing safe alarm state derivation.
> >    - Matches existing drivers under hwmon.
> >
> > The IIO subsystem is more suitable for implementing drivers for interrupt
> (latched) mode operations.
> > Reason:
> >    - Interrupt mode uses edge-triggered ALERT/IBI signal interrupts, which
> can be pushed to user space using iio_push_event.
> >    - IIO's event API (IIO_EV_TYPE_THRESH) supports timestamped
> rising/falling edge events.
> >    - I3C IBI integration maps naturally to IIO's event push model.
> >    - No persistent alarm bits are available; so polling in HWMON may result in
> missing events.
> >
> 
> This is just wrong. Interrupt support can just as well be implemented in a
> hwmon driver.
> 
> Guenter

Hi Guenter,

Thanks - agreed, hwmon drivers can support interrupts.
The distinction I meant to highlight is about semantic alignment.
Both P3T1750 and P3T1755 does not provide alarm/status bits. In TM=1 (interrupt mode), the alert is latched
but cleared on register read, with no way to query alarm state afterward.

HWMON typically polls alarm flags via IRQs, expecting them to remain asserted during threshold violations.
Without persistent bits, supporting interrupts in hwmon would require emulating state in software, which diverges
from its ABI and could mislead userspace expecting stable *_alarm files.
IIO's event API, being edge-triggered and timestamped, aligns more naturally with
this transient behavior and with I3C IBI signaling.

I'll reword the cover letter to clarify that this is a design choice based on ABI semantics, not a limitation of hwmon.
Thanks again for the review.

Best regards,
Lakshay


  reply	other threads:[~2025-10-09  5:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-08 10:07 Lakshay Piplani
2025-10-08 10:07 ` [PATCH v4 1/2] dt-bindings: iio: temperature: Add NXP P3T175x support Lakshay Piplani
2025-10-08 21:01   ` Conor Dooley
2025-10-12 17:10   ` Jonathan Cameron
2025-10-08 10:07 ` [PATCH v4 2/2] iio: temperature: Add driver for NXP P3T175x temperature sensor Lakshay Piplani
2025-10-08 14:10 ` [PATCH v4 0/2] iio: temperature: Add support for NXP P3T175x temperature sensors Guenter Roeck
2025-10-09  5:56   ` Lakshay Piplani [this message]
2025-10-09 22:37     ` [EXT] " Guenter Roeck
2025-10-12 17:15       ` Jonathan Cameron

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=AS4PR04MB9362FDA1FE35AD06C99B85E3FBEEA@AS4PR04MB9362.eurprd04.prod.outlook.com \
    --to=lakshay.piplani@nxp.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jdelvare@suse.com \
    --cc=jic23@kernel.org \
    --cc=jstephan@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=peterz@infradead.org \
    --cc=priyanka.jain@nxp.com \
    --cc=robh@kernel.org \
    --cc=shashank.rebbapragada@nxp.com \
    --cc=vikash.bansal@nxp.com \
    --cc=viro@zeniv.linux.org.uk \
    /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®