mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Cc: Alexandru Tachici <alexandru.tachici@analog.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	Guenter Roeck <groeck7@gmail.com>
Subject: Re: [PATCH v3 1/5] hwmon: (pmbus/adm1266) add firmware_revision debugfs entry
Date: Thu, 14 May 2026 21:48:07 -0700	[thread overview]
Message-ID: <53fa7ca2-a2d1-44a9-8d15-48ecae68d3c9@roeck-us.net> (raw)
In-Reply-To: <DIIXOTP9ML0G.RVVC1XIP3IF8@nexthop.ai>

On Thu, May 14, 2026 at 08:35:23PM -0700, Abdurrahman Hussain wrote:
> On Thu May 14, 2026 at 6:42 PM PDT, Guenter Roeck wrote:
> > On Tue, May 12, 2026 at 11:56:24AM -0700, Abdurrahman Hussain wrote:
> >> The ADM1266 reports its firmware revision via the IC_DEVICE_REV
> >> manufacturer-specific block-read command (0xAE, datasheet Rev. D
> >> Table 80). The first three returned bytes are the firmware
> >> major.minor.patch fields. This is useful when correlating field
> >> behaviour against ADI release notes; expose it through debugfs
> >> alongside the existing sequencer_state entry.
> >> 
> >> The standard PMBus MFR_REVISION (0x9B) register is already exposed
> >> by pmbus_core's debugfs auto-create path and reports the
> >> manufacturer revision, which is a separate thing from the firmware
> >> running on the device.
> >> 
> >> Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
> >
> > Applied to hwmon-next.
> >
> > Thanks,
> > Guenter
> 
> Thanks!
> 
> Status of the remaining three patches:
> 
>   - Patch 2 (clear_blackbox): v5 will extend the pmbus_lock guard
>     up to adm1266_nvmem_read() to cover the memset/refill/memcpy on
>     data->dev_mem as one critical section (per an automated review
>     of v3).
> 
>   - Patch 3 (powerup_counter): v5 will take pmbus_lock around the
>     block read, same reason.
> 
>   - Patch 4 (rtc_class): blocked on your reply to my "drop entirely
>     or loop in linux-rtc?" question [1].  rtc_class is out for v5
>     either way.
> 

My understanding is that there is no in-kernel API to inform drivers
about a rtc update. No other driver seems to need this.
I see a number of options:

1) Use ktime_get_real_seconds() in probe, just like every other Linux
   driver using the real time clock does without problems.
2) schedule a timer which updates the clock every hour ? day ?
3) Attach a sysfs attribute to the i2c device to trigger a time sync.

2) and 3) are a bit excessive, so you'll need to provide a specific
use case. "Because the datasheet says so" is not a use case.

> The same review on patch 2 also surfaced four pre-existing
> buffer-bound bugs in adm1266.c (stack overflow in
> adm1266_nvmem_read_blackbox(), undersized DMA read buffer in
> adm1266_pmbus_block_xfer(), an unbounded record_count loop, and an
> out-of-bounds memcpy() in pmbus_block_xfer() using a device-supplied
> length with no caller-side size knowledge).  None of them are
> introduced by this series.  My plan is to send them as a separate
> "hwmon: (pmbus/adm1266) fix ..." series with Fixes: tags first, then
> respin this feature series on top.  Let me know if you'd rather have
> them folded into v5.
> 
Separate series is ok.

Thanks,
Guenter

  reply	other threads:[~2026-05-15  4:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 18:56 [PATCH v3 0/5] hwmon: (pmbus/adm1266) blackbox, FW rev, rtc_class, GPIO label Abdurrahman Hussain
2026-05-12 18:56 ` [PATCH v3 1/5] hwmon: (pmbus/adm1266) add firmware_revision debugfs entry Abdurrahman Hussain
2026-05-15  1:42   ` Guenter Roeck
2026-05-15  3:35     ` Abdurrahman Hussain
2026-05-15  4:48       ` Guenter Roeck [this message]
2026-05-15  5:57         ` Abdurrahman Hussain
2026-05-12 18:56 ` [PATCH v3 2/5] hwmon: (pmbus/adm1266) add clear_blackbox " Abdurrahman Hussain
2026-05-12 18:56 ` [PATCH v3 3/5] hwmon: (pmbus/adm1266) add powerup_counter " Abdurrahman Hussain
2026-05-12 18:56 ` [PATCH v3 4/5] hwmon: (pmbus/adm1266) replace probe-time RTC seed with rtc_class device Abdurrahman Hussain
2026-05-14  2:14   ` Guenter Roeck
2026-05-14  4:25     ` Abdurrahman Hussain
2026-05-12 18:56 ` [PATCH v3 5/5] hwmon: (pmbus/adm1266) include adapter number in GPIO line label Abdurrahman Hussain
2026-05-15  1:45   ` 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=53fa7ca2-a2d1-44a9-8d15-48ecae68d3c9@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=abdurrahman@nexthop.ai \
    --cc=alexandru.tachici@analog.com \
    --cc=groeck7@gmail.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.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®