Re: [PATCH v3 1/3] iio: accel: bmc150: use aligned scan buffer for both trigger and fifo
Andy Shevchenko <[email protected]>
| Newsgroups | org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel |
|---|---|
| Organization | Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo |
| Message-ID | <[email protected]> |
On Tue, Aug 25, 2026 at 02:21:54PM +0530, Yash Suthar wrote: > Drop buffer as duplicate and s16 is not correct we needed __le16 as little > endian, keep scan at the end of the bmc150_accel_data struct with > IIO_DMA_MINALIGN, and use it for both paths. > > In trigger handle, replaced AXIS_MAX with sizeof(data->scan.channels). > Additionally, ensure mutex is held across both read and push to get > DMA safety for the scan buffer. Reviewed-by: Andy Shevchenko <[email protected]> ... > mutex_lock(&data->mutex); > ret = regmap_bulk_read(data->regmap, BMC150_ACCEL_REG_XOUT_L, > - data->buffer, AXIS_MAX * 2); > - mutex_unlock(&data->mutex); > + data->scan.channels, > + sizeof(data->scan.channels)); I would put this on a single line (it is 81 characters only). > if (ret < 0) > goto err_read; > > - iio_push_to_buffers_with_timestamp(indio_dev, data->buffer, > + iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, > pf->timestamp); I would put this on a single line (it is 82 characters only). > err_read: > + mutex_unlock(&data->mutex); > iio_trigger_notify_done(indio_dev->trig); -- With Best Regards, Andy Shevchenko