Re: [PATCH v2 08/14] iio: accel: bma220: migrate to regmap API

Jonathan Cameron
2025-09-13T12:22:50Z

On Fri, 12 Sep 2025 17:54:30 +0300
Petre Rodan <petre.rodan@subdimension.ro> wrote:

> Hi Jonathan,
>
> On Wed, Sep 10, 2025 at 07:12:25PM +0100, Jonathan Cameron wrote:
> > On Wed, 10 Sep 2025 10:57:13 +0300
> > Petre Rodan <petre.rodan@subdimension.ro> wrote:
> >
> > > Switch to regmap API.
> > >
> > There are a few things in here that seem unrelated to the regmap change
> > and should be in separate patches where we can review and discuss them more easily.
> >
> > Thanks,
> > Jonathan
> >
> > > diff --git a/drivers/iio/accel/bma220_core.c b/drivers/iio/accel/bma220_core.c
> > >> static irqreturn_t bma220_trigger_handler(int irq, void *p)
> > > {
> [..]
> > > iio_push_to_buffers_with_ts(indio_dev, &data->scan, sizeof(data->scan),
> > > - pf->timestamp);
> >
> > Why the move to grabbing timestamps in the thread rather than the top half?
> >
> > I don't necessarily mind that change but doesn't feel appropriate to have
> > it in the same patch as the regmap change.
>
> one of my unit tests [1] fails when using the original code (all timestamps are
> 0 when reading the IIO buffer with iio_generic_buffer)
>
> would be easier to just split modification into new patch instead of debugging
> the old code :)
>
> [1]: https://codeberg.org/subDIMENSION/lkm_sandbox/src/branch/main/bosch_bma220/unit-tests/permanent_latch/test.sh

Ah. So this is the problem we've had various attempts to fix of not all triggers
have a top half. Definitely wants to be a separate patch with an explanation of
why you are making the change. Hopefully someone will get time to finish of
fixing this up more generically but I don't mind papering over it in a particular
driver in the meantime because the generic fix is rather complex.

Jonathan

>
> best regards,
> peter