* [PATCH v2] iio: chemical: bme680: Fix measurement wait duration calculation
@ 2026-02-04 13:36 Chris Spencer
2026-02-05 13:15 ` Markus Elfring
0 siblings, 1 reply; 4+ messages in thread
From: Chris Spencer @ 2026-02-04 13:36 UTC (permalink / raw)
To: jic23; +Cc: linux-iio, linux-kernel, vassilisamir, Chris Spencer
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.
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>
Acked-by: Vasileios Amoiridis <vassilisamir@gmail.com>
---
v2: add Acked-by: Vasileios
---
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
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] iio: chemical: bme680: Fix measurement wait duration calculation 2026-02-04 13:36 [PATCH v2] iio: chemical: bme680: Fix measurement wait duration calculation Chris Spencer @ 2026-02-05 13:15 ` Markus Elfring 2026-02-05 14:05 ` Chris Spencer 0 siblings, 1 reply; 4+ messages in thread From: Markus Elfring @ 2026-02-05 13:15 UTC (permalink / raw) To: Chris Spencer, linux-iio, Jonathan Cameron; +Cc: LKML, Vasileios Amoiridis … > resulting in a wait time that is too short. This can cause the following > 'device measurement cycle incomplete' check to occasionally fail. * Were any source code analysis tools involved here? * See also once more: + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.19-rc8#n94 + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v6.19-rc8#n34 Regards, Markus ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] iio: chemical: bme680: Fix measurement wait duration calculation 2026-02-05 13:15 ` Markus Elfring @ 2026-02-05 14:05 ` Chris Spencer 2026-02-05 14:43 ` [v2] " Markus Elfring 0 siblings, 1 reply; 4+ messages in thread From: Chris Spencer @ 2026-02-05 14:05 UTC (permalink / raw) To: Markus Elfring; +Cc: linux-iio, Jonathan Cameron, LKML, Vasileios Amoiridis Hi Markus, On Thu, 5 Feb 2026 at 13:15, Markus Elfring <Markus.Elfring@web.de> wrote: > > … > > resulting in a wait time that is too short. This can cause the following > > 'device measurement cycle incomplete' check to occasionally fail. > > * Were any source code analysis tools involved here? No. I identified this issue myself while investigating the aforementioned 'device measurement cycle incomplete' error by manually comparing the kernel implementation against the linked Bosch implementation. > * See also once more: > + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.19-rc8#n94 Can you please clarify what is wrong with the commit message? I have used the imperative mood in the subject, but the rest of the message is simply background information. How would you suggest rewording this? > + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v6.19-rc8#n34 Ok I will CC stable in the next revision. Thanks, Chris ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [v2] iio: chemical: bme680: Fix measurement wait duration calculation 2026-02-05 14:05 ` Chris Spencer @ 2026-02-05 14:43 ` Markus Elfring 0 siblings, 0 replies; 4+ messages in thread From: Markus Elfring @ 2026-02-05 14:43 UTC (permalink / raw) To: Chris Spencer, linux-iio, Jonathan Cameron; +Cc: LKML, Vasileios Amoiridis >> * See also once more: >> + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.19-rc8#n94 > > Can you please clarify what is wrong with the commit message? I have > used the imperative mood in the subject, but the rest of the message > is simply background information. How would you suggest rewording > this? I propose to mention another action in the change description. Possible wording: Thus adjust an inappropriate value. Regards, Markus ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-02-05 14:43 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-02-04 13:36 [PATCH v2] iio: chemical: bme680: Fix measurement wait duration calculation Chris Spencer 2026-02-05 13:15 ` Markus Elfring 2026-02-05 14:05 ` Chris Spencer 2026-02-05 14:43 ` [v2] " Markus Elfring
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®