Re: [PATCH v7 09/10] iio: pressure: dps310: implement .hwfifo_flush_to_buffer()
From: Rupesh Majhi
Date: Mon Sep 21 2026 - 15:01:14 EST
On Sun, 20 Sep 2026 19:32:13 +0100
Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
> As talked abotu above, I think iio_device_claim_buffer_mode()
> will do the job here as it stops the IIO core transitioning between
> modes until afte this is done with the active_scan_mask.
It does, but patch 10 then warns on it:
dps310.c:1233:2: warning: releasing mutex 'iio' that was not held
[-Wthread-safety-analysis]
clang 23.1.2, CONFIG_WARN_CONTEXT_ANALYSIS=y. There is a
DEFINE_GUARD_COND for direct mode but none for buffer mode, so clang
cannot follow the conditional claim. v8 holds the same lock over the
same span with IIO_DEV_GUARD_CURRENT_MODE() and the mode check that was
already there. If you would rather have the named API, say so and I
will add the buffer mode guard and ACQUIRE macro to the core first.
Rupesh