Re: [PATCH v3 0/5] iio: adc: add AMD/Xilinx Versal SysMon driver

From: Jonathan Cameron

Date: Fri May 29 2026 - 05:10:05 EST


On Thu, 28 May 2026 22:46:58 +0100
"Erim, Salih" <salih.erim@xxxxxxx> wrote:

> Hi Jonathan,
>
> On 28/05/2026 13:06, Jonathan Cameron wrote:
> >
> >
> > On Wed, 27 May 2026 12:42:06 +0100
> > Salih Erim <salih.erim@xxxxxxx> wrote:
> >
> >> This series adds a new IIO driver for the AMD/Xilinx Versal System
> >> Monitor (SysMon), providing on-chip voltage and temperature monitoring.
> >>
> >> The Versal SysMon measures up to 160 supply voltages and reads up to
> >> 64 temperature satellites distributed across the SoC. The hardware
> >> also provides aggregated device temperature registers: the current
> >> max and min across all active satellites, and peak/trough values
> >> recorded since last hardware reset. The device can be accessed via
> >> memory-mapped I/O or via an I2C interface.
> >>
> >> The driver is split into a bus-agnostic core module using the regmap
> >> API, an MMIO platform driver, and an I2C driver. This allows the
> >> same IIO logic to be shared across different bus transports.
> >>
> >> Previous submissions:
> >> v2: https://lore.kernel.org/all/cover.1746182670.git.salih.erim@xxxxxxx/
> >> v1: https://lore.kernel.org/all/cover.1757061697.git.michal.simek@xxxxxxx/
> >>
> > https://sashiko.dev/#/patchset/20260527114211.174288-1-salih.erim%40amd.com
> > Quite a bit of feedback. Some of which is clearly garbage, like the
> > ARCH_VERSAL suggestion, but take a close look as it does tend to pick up on
> > stuff that humans miss.
>
> Thanks Jonathan. I've gone through all the Sashiko findings.
Thanks,
>
> Reviewed but keeping as-is:
> - Left-shift of negative in millicelsius_to_q8p7: GCC defines
> this behavior and it's consistent with the read direction
> (right-shift); Andy asked for this symmetry in v2
> - Oversampling read without mutex: reading a single int is
> atomic on arm64; adding contention for no practical benefit

This is potentially a bit messier if the compiler gets creative
(see Will Deacon's various talks on this for instance). Still
we neglect this for most IIO drivers today. One day maybe we'll
fix all that up - lots of careful READ_ONCE()/WRITE_ONCE() markings.