Skip to content

iio: accel: bmc150: fix event-enable race, then use guard(mutex)

Gabriel Rondon linux-iio lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest3 patches 6 repliesIn review

Changes in v4 from the cover letter

- Turned into a series: prep and fix first, conversion last (Jonathan, v3 review)
- Sorted header inclusions (Andy)
- Fixed the ev_enable_state race under the lock, with Fixes: tag and
Cc: stable
- The unaligned-timestamp problem raised in the v3 review is fixed by
[2] rather than by a patch here; the series is rebased on top of [2]

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3iio: accel: bmc150: sort header inclusions alphabeticallydrivers/iio/accel/bmc150-accel-core.c+10 -101 reply
2/3iio: accel: bmc150: take the lock before checking ev_enable_statedrivers/iio/accel/bmc150-accel-core.c+5 -30 replies
3/3iio: accel: bmc150: use guard(mutex) for mutex handlingdrivers/iio/accel/bmc150-accel-core.c+23 -514 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchStepan IonichevAndy Shevchenko
1/3R-b
2/3
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/3] iio: accel: bmc150: fix event-enable race, then use guard(mutex)

This series addresses what came out of the v3 review of the guard(mutex) conversion [1]: the pre-existing bugs had to be fixed before the conversion could go in.

The unaligned-timestamp / DMA-safety problem in the trigger path is no longer part of this series: it is fixed by Yash Suthar's "iio: accel: bmc150: DMA-safe buffers and use iio_push_to_buffers_with_ts()" v2 series [2], which this series is rebased on top of.

Patch 1 sorts the header inclusions (suggested by Andy in the v3 thread) so the cleanup.h include added later lands in order. Patch 2 fixes the event-enable race in write_event_config(), where ev_enable_state was checked outside the lock. Patch 3 is the guard(mutex)/scoped_guard() conversion itself, now applying on top of the fixes.

[1] https://lore.kernel.org/linux-iio/[email protected]/
[2] https://lore.kernel.org/linux-iio/[email protected]/

Changes in v4:
- Turned into a series: prep and fix first, conversion last (Jonathan, v3 review)
- Sorted header inclusions (Andy)
- Fixed the ev_enable_state race under the lock, with Fixes: tag and
Cc: stable
- The unaligned-timestamp problem raised in the v3 review is fixed by
[2] rather than by a patch here; the series is rebased on top of [2]

Gabriel Rondon (3):
iio: accel: bmc150: sort header inclusions alphabetically
iio: accel: bmc150: take the lock before checking ev_enable_state
iio: accel: bmc150: use guard(mutex) for mutex handling

 drivers/iio/accel/bmc150-accel-core.c | 92 ++++++++++-----------------
 1 file changed, 33 insertions(+), 59 deletions(-)
Signature · 1 line
2.50.1 (Apple Git-155)