Re: [PATCH] iio: pressure: dps310: read the first temperature in probe
From: Andy Shevchenko
Date: Thu Nov 19 2026 - 14:33:45 EST
On Thu, Nov 19, 2026 at 09:08:27PM +0200, Rupesh Majhi wrote:
> The first temperature read is in dps310_fifo_interval() instead of
> probe. That function is called with data->lock held and takes it
> again, so enabling the buffer without a trigger deadlocks.
>
> Move the read to probe.
...
> + /* Pressure compensation needs a temperature from the start */
> + scoped_guard(mutex, &data->lock)
> + rc = dps310_read_temp_raw_locked(data);
> + if (rc)
> + return rc;
While at it, making branch in scope
scoped_guard(mutex, &data->lock) {
rc = dps310_read_temp_raw_locked(data);
if (rc)
return rc;
}
helps to avoid potential issues later on.
--
With Best Regards,
Andy Shevchenko