[PATCH v2 0/3] iio: accel: bmc150: DMA-safe buffers and use iio_push_to_buffers_with_ts()

Yash Suthar posted 3 patches 1 month, 2 weeks ago
There is a newer version of this series
drivers/iio/accel/bmc150-accel-core.c | 24 +++++++++++-------------
drivers/iio/accel/bmc150-accel.h      | 19 ++++++++++---------
2 files changed, 21 insertions(+), 22 deletions(-)
[PATCH v2 0/3] iio: accel: bmc150: DMA-safe buffers and use iio_push_to_buffers_with_ts()
Posted by Yash Suthar 1 month, 2 weeks ago
The trigger path used a plain s16 buffer while the FIFO path already had
a properly typed scan member (__le16 + aligned timestamp). Those two
buffers did the same job, and s16 does not represent little-endian data.
Drop the duplicate, keep scan at the end of struct bmc150_accel_data with
IIO_DMA_MINALIGN, and use it for both the trigger and FIFO paths.

The FIFO and read_raw buffers are passed to regmap bulk/raw reads, which
is not DMA-safe. Move them into struct bmc150_accel_data after scan and
aligned to IIO_DMA_MINALIGN.

Finally, replace the deprecated iio_push_to_buffers_with_timestamp() with
iio_push_to_buffers_with_ts() so the push sites pass an explicit buffer
size.

This supersedes the earlier standalone patches:
Link: https://lore.kernel.org/linux-iio/20260808220236.421832-1-yashsuthar983@gmail.com/
Link: https://lore.kernel.org/linux-iio/20260809111303.496393-1-yashsuthar983@gmail.com/

Link to v1: https://lore.kernel.org/all/20260814101845.301769-1-yashsuthar983@gmail.com/

Changes in v2:
- patch 1: restore early error check flow
- patch 2: keep fifo_buff declaration in one line

Yash Suthar (3):
  iio: accel: bmc150: use aligned scan buffer for both trigger and fifo
  iio: accel: bmc150: use DMA-safe buffers for regmap bulk reads
  iio: accel: bmc150: use iio_push_to_buffers_with_ts()

 drivers/iio/accel/bmc150-accel-core.c | 24 +++++++++++-------------
 drivers/iio/accel/bmc150-accel.h      | 19 ++++++++++---------
 2 files changed, 21 insertions(+), 22 deletions(-)

-- 
2.43.0
Re: [PATCH v2 0/3] iio: accel: bmc150: DMA-safe buffers and use iio_push_to_buffers_with_ts()
Posted by Gabriel Rondon 1 month, 1 week ago
On Sat, 15 Aug 2026 23:27:25 +0530, Yash Suthar wrote:
> The trigger path used a plain s16 buffer while the FIFO path already had
> a properly typed scan member (__le16 + aligned timestamp). Those two
> buffers did the same job, and s16 does not represent little-endian data.

Built the series on top of current iio/togreg with gcc 13.3, x86_64
allmodconfig and W=1: the three bmc150 objects (core, i2c, spi) compile
cleanly with no new warnings.

I also used it as the base for v4 of my bmc150 series (event-enable
race fix + guard(mutex) conversion), which is rebased on top of these
patches:
https://lore.kernel.org/linux-iio/20260816234231.14168-1-grondon@gmail.com/

Gabriel