lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 5 May 2024 20:34:56 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Vasileios Amoiridis <vassilisamir@...il.com>
Cc: lars@...afoo.de, andriy.shevchenko@...ux.intel.com,
 ang.iglesiasg@...il.com, mazziesaccount@...il.com, ak@...klinger.de,
 petre.rodan@...dimension.ro, phil@...pberrypi.com, 579lpy@...il.com,
 linus.walleij@...aro.org, semen.protsenko@...aro.org,
 linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 10/10] iio: pressure: bmp280: Add triggered buffer
 support

On Mon, 29 Apr 2024 21:00:46 +0200
Vasileios Amoiridis <vassilisamir@...il.com> wrote:

> BMP2xx, BME280, BMP3xx, and BMP5xx use continuous buffers for their
> temperature, pressure and humidity readings. This facilitates the
> use of burst/bulk reads in order to acquire data faster. The
> approach is different from the one used in oneshot captures.
> 
> BMP085 & BMP1xx devices use a completely different measurement
> process that is well defined and is used in their buffer_handler().
> 
> Suggested-by: Angel Iglesias <ang.iglesiasg@...il.com>
> Signed-off-by: Vasileios Amoiridis <vassilisamir@...il.com>
Hi Vasileois,

Just one question on this inline. (patches 8 and 9 look good to me)

For v6, only need to send the patches that I haven't already applied.

Thanks,

Jonathan

>  
> +static irqreturn_t bmp180_buffer_handler(int irq, void *p)
> +{
> +	struct iio_poll_func *pf = p;
> +	struct iio_dev *indio_dev = pf->indio_dev;
> +	struct bmp280_data *data = iio_priv(indio_dev);
> +	int ret, chan_value;
> +
> +	guard(mutex)(&data->lock);
> +
> +	ret = bmp180_read_temp(data, &chan_value);
> +	if (ret < 0)
> +		return IRQ_HANDLED;
> +
> +	data->sensor_data[1] = chan_value;
> +
> +	ret = bmp180_read_press(data, &chan_value);

So I 'think' that after all the refactoring you end up reading the temperature
twice.  To avoid that you need to pull the read_temp() and read_press()
function implementations here and only do the (currently duplicated) steps once.

You seem to have done this for the other case, but missed the bmp180?
Maybe I'm missing some reason it doesn't work for this one!

> +	if (ret < 0)
> +		return IRQ_HANDLED;
> +
> +	data->sensor_data[0] = chan_value;
> +
> +	iio_push_to_buffers_with_timestamp(indio_dev, &data->sensor_data,
> +					   iio_get_time_ns(indio_dev));
> +
> +	iio_trigger_notify_done(indio_dev->trig);
> +
> +	return IRQ_HANDLED;
> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ