mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Rupesh Majhi <zoone.rupert@gmail.com>
Cc: "Andy Shevchenko" <andy@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Eddie James" <eajames@linux.ibm.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Nuno Sá" <nuno.sa@analog.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 1/3] iio: pressure: dps310: read buffered samples from the hardware FIFO
Date: Tue, 29 Sep 2026 00:55:22 +0300	[thread overview]
Message-ID: <arriSm8L567yqOjV@ashevche-desk.local> (raw)
In-Reply-To: <20260928211127.641828-2-zoone.rupert@gmail.com>

On Tue, Sep 29, 2026 at 12:11:25AM +0300, Rupesh Majhi wrote:
> The DPS310 has a 32-entry FIFO shared by both measurements. Drain it from
> a work item and push what it held, so a buffered capture needs no
> trigger. Nothing in tree wires the interrupt pin, so the work rearms
> itself at half the time the FIFO takes to fill.
> 
> Entries carry one measurement each, so a pressure entry is compensated
> with the temperature ahead of it. Pressure read before the first
> temperature of a session is held until one arrives rather than dropped,
> so the first push can wait a temperature period.
> 
> FIFO entries are not timestamped, so postenable refuses the timestamp
> channel unless a trigger is attached.
> 
> Tested on a DPS310 on a BeagleBone Black.

...

> +#define DPS310_DRAIN_MAX_MS	(2 * MSEC_PER_SEC)

+ time.h

...

> +/* Returns which measurement the entry came from, or a negative error */
> +static int dps310_fifo_read_entry(struct dps310_data *data, s32 *value)
> +	__must_hold(&data->lock)

Hmm... Don't you want to also add lockdep annotations?

...

> +		if (kind[i] == DPS310_FIFO_TEMP) {
> +			data->fifo_temp_raw = raw[i];
> +			data->fifo_temp_valid = true;
> +
> +			if (!pressure_enabled) {
> +				if (!dps310_fifo_push_scan(data, raw[i], 0))
> +					pushed++;
> +				continue;
> +			}
> +
> +			pushed += dps310_fifo_push_held(data);
> +			continue;

You may deduplicate 'continue'.

> +		}

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-09-28 21:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 21:11 [PATCH v9 0/3] iio: pressure: dps310: hardware FIFO support Rupesh Majhi
2026-09-28 21:11 ` [PATCH v9 1/3] iio: pressure: dps310: read buffered samples from the hardware FIFO Rupesh Majhi
2026-09-28 21:55   ` Andy Shevchenko [this message]
2026-09-28 21:11 ` [PATCH v9 2/3] iio: pressure: dps310: derive the drain interval from the watermark Rupesh Majhi
2026-09-28 21:11 ` [PATCH v9 3/3] iio: pressure: dps310: implement .hwfifo_flush_to_buffer() Rupesh Majhi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=arriSm8L567yqOjV@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=eajames@linux.ibm.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=zoone.rupert@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®