mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Alexey Charkov <alchark@flipper.net>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 2/2] hwmon: Add support for TI INA4230 power monitor
Date: Mon, 30 Mar 2026 11:39:18 -0700	[thread overview]
Message-ID: <3d3c7fdc-6e6b-4e39-a39b-76d1d9d9b828@roeck-us.net> (raw)
In-Reply-To: <20260330-ina4230-v5-2-eeb322d95b3a@flipper.net>

On 3/30/26 08:14, Alexey Charkov wrote:
> Add a driver for the TI INA4230, a 4-channel power monitor with I2C
> interface.
> 
> The driver supports voltage, current, power and energy measurements, but
> skips the alert functionality in this initial implementation.
> 
> Signed-off-by: Alexey Charkov <alchark@flipper.net>

Sashiko report is at

https://sashiko.dev/#/patchset/20260330-ina4230-v5-0-eeb322d95b3a%40flipper.net

Valid concerns, as far as I can see, are:

- There are various overflow issues. Please address, either by making sure that
   the operations can not overflow, or that all parameters such as the shunt
   resistor value or the interval are bound such that an overflow can not occur.
   This includes implicit conversions. For example, the interval passed to
   ina4230_interval_ms_to_conv_time() is int, but the parameter is actually long.
   There is not even a signed check, meaning the resulting interval can be pretty
   much anything.

- power is reported by the chip as unsigned value. Yet, it is converted via type
   cast to int16_t.

- Please add a comment to the energy reading to confirm that regmap_noinc_read()
   performs as expected.

- The definition of ina4230_curr_reg[] is wasteful. There is only an entry for
   hwmon_curr_input. Why specify an unnecessary two-dimensional array ?

- The dummy channel 0 for voltage is not acceptable. Make it 0-based as expected
   by the ABI. Yes, I know, but that is how the ABI was defined.


I can not comment on Saskiko's pm related feedback. PM is and has always been
a mystery to me, so I just assume that it is WAI and that there are no problems.
I do assume that you have tested the code thoroughly across suspend/resume cycles
to make sure that it works as intended.

Thanks,
Guenter


  reply	other threads:[~2026-03-30 18:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 15:14 [PATCH v5 0/2] Add support for Texas Instruments " Alexey Charkov
2026-03-30 15:14 ` [PATCH v5 1/2] dt-bindings: hwmon: Add TI INA4230 4-channel I2C " Alexey Charkov
2026-03-30 15:14 ` [PATCH v5 2/2] hwmon: Add support for TI INA4230 " Alexey Charkov
2026-03-30 18:39   ` Guenter Roeck [this message]
2026-03-30 16:07 ` [PATCH v5 0/2] Add support for Texas Instruments " Guenter Roeck
2026-03-31 15:52   ` Rob Herring
2026-03-31 16:10     ` Guenter Roeck
2026-03-31 16:46       ` Alexey Charkov
2026-04-01 14:03         ` Rob Herring
2026-04-01 14:50           ` 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=3d3c7fdc-6e6b-4e39-a39b-76d1d9d9b828@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=alchark@flipper.net \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /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®