Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: "Torreno, Alexis Czezar" <alexisczezar.torreno@analog.com>
Cc: "sashiko-reviews@lists.linux.dev"
	<sashiko-reviews@lists.linux.dev>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"robh@kernel.org" <robh@kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>
Subject: Re: [PATCH 1/3] dt-bindings: hwmon: ltc4283: add ltc4284
Date: Thu, 5 Nov 2026 00:12:39 +0000	[thread overview]
Message-ID: <20261105-glitzy-uneatable-0eebf04012ec@spud> (raw)
In-Reply-To: <PH0PR03MB63510EDCF229B247474764C8F1682@PH0PR03MB6351.namprd03.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 3785 bytes --]

On Wed, Nov 04, 2026 at 04:06:13AM +0000, Torreno, Alexis Czezar wrote:
> > [External]
> > 
> > Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to
> > consider:
> > - [Medium] dt-bindings: hwmon: ltc4283: requiring rsense2 breaks single-driver
> > mode
> > - [Low] dt-bindings: hwmon: ltc4283: ltc4284 example sense resistors below min
> > 50000
> > --
> > 
> > commit 9676b294cf2ad1168e5ce0d8de5c0cd58e68d9ed
> > Author: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
> > 
> > dt-bindings: hwmon: ltc4283: add ltc4284
> > 
> > This commit adds device tree binding support for the Analog Devices LTC4284
> > negative voltage hot swap controller to the adi,ltc4283 schema, including new
> > properties for its second sense resistor and ADC resistance.
> > 
> 
> ...
> 
> > > +
> > > +  adi,rsense2-nano-ohms:
> > > +    description:
> > > +      Value of the SENSE2 current sense resistor. This resistor is connected
> > > +      between SENSE2+ and SENSE2- pins.
> > > +
> 
> ...
> 
> > >  allOf:
> > > +  - if:
> > > +      properties:
> > > +        compatible:
> > > +          contains:
> > > +            const: adi,ltc4284
> > > +    then:
> > > +      required:
> > > +        - adi,rsense2-nano-ohms
> > > +        - adi,radc-nano-ohms
> > > +    else:
> > > +      properties:
> > > +        adi,rsense2-nano-ohms: false
> > > +        adi,radc-nano-ohms: false
> > 
> > [Severity: Medium]
> > As noted in the binding description above, the LTC4284 supports four hardware
> > operating modes configured via the MODE pin, including single driver mode.
> > 
> > In single driver mode, only the first MOSFET path (GATE1 and SENSE1+/SENSE1-
> > ) is used, and no second sense resistor is populated between SENSE2+ and
> > SENSE2-.
> > 
> > If adi,rsense2-nano-ohms is unconditionally required in the allOf block for
> > adi,ltc4284, wouldn't boards wired in single driver mode fail schema validation
> > unless they specify a nonexistent adi,rsense2-nano-ohms property?
> > 
> 
> I suppose I can make rsense2 optional (+ corresponding driver code change)?
> Or can it be kept as is?

If it's actually optional, the dt should reflect that.

> 
> > > @@ -269,4 +303,19 @@ examples:
> > >              #gpio-cells = <2>;
> > >          };
> > >      };
> > > +
> > > +  - |
> > > +    i2c {
> > > +        #address-cells = <1>;
> > > +        #size-cells = <0>;
> > > +
> > > +        swap-controller@20 {
> > > +            compatible = "adi,ltc4284";
> > > +            reg = <0x20>;
> > > +
> > > +            adi,rsense-nano-ohms = <1000>;
> > > +            adi,rsense2-nano-ohms = <1000>;
> > > +            adi,radc-nano-ohms = <500>;
> > > +        };
> > 
> > [Severity: Low]
> > In drivers/hwmon/ltc4283.c, ltc4283_setup() validates the sense resistor
> > properties against [LTC4283_MIN_RSENSE, LTC4283_MAX_RSENSE], where
> > LTC4283_MIN_RSENSE is 50000 nano-ohms (50 micro-ohms) and
> > LTC4283_MAX_RSENSE is 1677721599 nano-ohms:
> > 
> >     if (st->rsense < LTC4283_MIN_RSENSE || st->rsense > LTC4283_MAX_RSENSE)
> >         return dev_err_probe(dev, -EINVAL,
> >                              "adi,rsense-nano-ohms(%u) too small or too large [%u %u]\n",
> >                              st->rsense, LTC4283_MIN_RSENSE, LTC4283_MAX_RSENSE);
> > 
> > The example above sets adi,rsense-nano-ohms = <1000>, adi,rsense2-nano-
> > ohms = <1000>, and adi,radc-nano-ohms = <500> (1 micro-ohm and 0.5 micro-
> > ohm), which will cause ltc4283_setup() to fail probe with -EINVAL.
> > 
> 
> This was just random numbers to show the example. I can change the values
> to a more realistic sample if preferred. 

Random numbers are fine.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-11-05  0:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  3:29 [PATCH 0/3] Supporting LTC4284 which is a negative voltage hotswap controller Alexis Czezar Torreno
2026-11-04  3:30 ` [PATCH 1/3] dt-bindings: hwmon: ltc4283: add ltc4284 Alexis Czezar Torreno
2026-11-04  3:39   ` sashiko-bot
2026-11-04  4:06     ` Torreno, Alexis Czezar
2026-11-05  0:12       ` Conor Dooley [this message]
2026-11-05  1:23         ` Torreno, Alexis Czezar
2026-11-05  4:06       ` Guenter Roeck
2026-11-05  5:26         ` Torreno, Alexis Czezar
2026-11-04  3:30 ` [PATCH 2/3] hwmon: ltc4283: Add support for the LTC4284 swap controller Alexis Czezar Torreno
2026-11-04  3:41   ` sashiko-bot
2026-11-04  4:58     ` Torreno, Alexis Czezar
2026-11-04  3:30 ` [PATCH 3/3] gpio: gpio-ltc4283: Add support for the LTC4284 Swap Controller Alexis Czezar Torreno
2026-11-04  3:35   ` sashiko-bot
2026-11-04 14:07   ` Bartosz Golaszewski
2026-11-05  1:23     ` Torreno, Alexis Czezar

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=20261105-glitzy-uneatable-0eebf04012ec@spud \
    --to=conor@kernel.org \
    --cc=alexisczezar.torreno@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=robh@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