mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vasileios Amoiridis <vassilisamir@gmail.com>
To: Chris Spencer <spencercw@gmail.com>
Cc: jic23@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: chemical: bme680: Fix measurement wait duration calculation
Date: Tue, 3 Feb 2026 22:27:16 +0100	[thread overview]
Message-ID: <aYJoNO1SffHnsSxV@vamoirid-laptop> (raw)
In-Reply-To: <20260202073843.11225-1-spencercw@gmail.com>

On Mon, Feb 02, 2026 at 07:38:42AM +0000, Chris Spencer wrote:
> This function refers to the Bosch BME680 API as the source of the
> calculation, but one of the constants does not match the Bosch
> implementation. This appears to be a simple transposition of two digits,
> resulting in a wait time that is too short. This can cause the following
> 'device measurement cycle incomplete' check to occasionally fail.
> 

Hi Chris,

This is a good catch! I didn't have problems with measurements in the
past but that is also because of the entropy of the sensor plus there
were some series with "buggy" sensors that were behaving a bit
differently. In any case, thanks for finding this!

Here is my tag, in case it is of any worth:

Acked-by: Vasileios Amoiridis <vassilisamir@gmail.com>

Cheers,
Vasilis

> Fixes: 4241665e6ea0 ("iio: chemical: bme680: Fix sensor data read operation")
> Link: https://github.com/boschsensortec/BME68x_SensorAPI/blob/v4.4.8/bme68x.c#L521
> Signed-off-by: Chris Spencer <spencercw@gmail.com>
> ---
>  drivers/iio/chemical/bme680_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/chemical/bme680_core.c b/drivers/iio/chemical/bme680_core.c
> index 70f81c4a96ba..24e0b59e2fdf 100644
> --- a/drivers/iio/chemical/bme680_core.c
> +++ b/drivers/iio/chemical/bme680_core.c
> @@ -613,7 +613,7 @@ static int bme680_wait_for_eoc(struct bme680_data *data)
>  	 * + heater duration
>  	 */
>  	int wait_eoc_us = ((data->oversampling_temp + data->oversampling_press +
> -			   data->oversampling_humid) * 1936) + (477 * 4) +
> +			   data->oversampling_humid) * 1963) + (477 * 4) +
>  			   (477 * 5) + 1000 + (data->heater_dur * 1000);
>  
>  	fsleep(wait_eoc_us);
> -- 
> 2.43.0
> 

      reply	other threads:[~2026-02-03 21:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02  7:38 Chris Spencer
2026-02-03 21:27 ` Vasileios Amoiridis [this message]

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=aYJoNO1SffHnsSxV@vamoirid-laptop \
    --to=vassilisamir@gmail.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spencercw@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®