Re: [PATCH v4 4/5] iio: adc: versal-sysmon: add threshold event support

From: Andy Shevchenko

Date: Wed Jun 10 2026 - 09:58:06 EST


On Wed, Jun 10, 2026 at 12:46:52PM +0100, Erim, Salih wrote:
> On 09/06/2026 18:31, Andy Shevchenko wrote:
> > On Sun, Jun 07, 2026 at 10:02:47PM +0100, Erim, Salih wrote:
> > > On 07/06/2026 08:31, Andy Shevchenko wrote:
> > > > On Sat, Jun 06, 2026 at 06:17:06AM +0100, Salih Erim wrote:

...

> > > > > + ret = regmap_read(sysmon->regmap, upper_off, &upper_reg);
> > > > > + if (ret)
> > > > > + return ret;
> > > > > +
> > > > > + ret = regmap_read(sysmon->regmap, lower_off, &lower_reg);
> > > > > + if (ret)
> > > > > + return ret;
> > > >
> > > > Half of the IO accessors have no error checks, these do.
> > > > Why is this inconsistency?
> > >
> > > The regmap calls in sysmon_unmask_worker and sysmon_iio_irq
> > > have no error checks because they run in contexts where errors
> > > cannot be propagated (workqueue, hardirq). The init path checks
> > > errors because it can return them to the caller. Will add a
> > > comment explaining this.
> >
> > But the error checks may be used to modify flow inside the respective functions.
>
> Accepted. Will add error checks in sysmon_unmask_worker and
> sysmon_iio_irq to bail out early on regmap failure instead of
> operating on undefined data.

Same comment as per v5, up to you as failing MMIO on HW level is a sign of
something bigger.

--
With Best Regards,
Andy Shevchenko