Re: [PATCH] iio: pressure: dps310: don't wait for new temperature in trigger handler
From: Arnav Kapoor
Date: Thu Nov 12 2026 - 20:57:05 EST
On Wed, Nov 11, 2026 at 09:51:18PM +0200, Rupesh Majhi wrote:
> + if (test_bit(DPS310_SCAN_PRESSURE, scan_mask)) {
> + rc = dps310_read_pres_raw_locked(data);
> + if (rc)
> + return rc;
> +
> + /* Waiting here would hold scans to the temperature rate */
> + dps310_refresh_temp_locked(data);
Maybe I'm getting this wrong, but isn't there a case the new path
doesn't cover? Nothing reads a temperature at probe, so if a pressure
only buffer is enabled shortly after probe and the first pressure
result is ready before any temperature result,
dps310_refresh_temp_locked() finds TMP_RDY clear and the pressure is
compensated with temp_raw still 0.
I think the FIFO path handles this case by dps310_fifo_hold() keeping
pressure entries until fifo_temp_valid is set by the first
temperature. Would it make sense to do the same here with a flag set
when a temperature has been read, and wait for one temperature in
dps310_refresh_temp_locked() only while it's unset? That would cover
direct pressure reads and after the first sample the scans stay at the
pressure rate as your patch intends.
Thanks,
Arnav