* [PATCH] iio: pressure: bmp280: fix bmp580 buffer channel order
@ 2026-12-04 3:45 Eric Westphal
2026-12-04 6:53 ` Joshua Crofts
2026-12-04 16:58 ` Andy Shevchenko
0 siblings, 2 replies; 3+ messages in thread
From: Eric Westphal @ 2026-12-04 3:45 UTC (permalink / raw)
To: linux-iio, jic23; +Cc: nuno.sa, dlechner, andy, linux-kernel, stable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
bmp580_channels[] declares pressure at scan_index 0 and temperature at
scan_index 1, matching enum bmp280_scan. The original triggered-buffer
support filled data->sensor_data[] in that order: pressure at offset 0,
then temperature.
Commit 872c8014e05e replaced the array with a stack-local scan struct,
but declared the fields as temperature then pressure. The memcpy
targets stayed correct, so the pushed buffer has the samples swapped
relative to scan_index. Userspace therefore sees temperature counts in
the pressure slot and vice versa.
On a BMP581 this was observed as buffered values of about 26,800 Pa and
98 °C while the sysfs in_*_input attributes correctly reported about
100,601 Pa and 26.2 °C.
Reorder the struct fields to match the scan_index mapping, as the
bmp280, bme280, bmp380, and bmp180 trigger handlers already do.
Fixes: 872c8014e05e ("iio: pressure: bmp280: drop sensor_data array")
Cc: stable@vger.kernel.org
# Replace the placeholder Signed-off-by before sending (do not use
# Eric Westphal unless he is the submitter and agrees to the DCO):
Signed-off-by: [Your Name] <your.email@example.com>
---
drivers/iio/pressure/bmp280-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/pressure/bmp280-core.c
b/drivers/iio/pressure/bmp280-core.c
index 3940b8e..6f3c3a8 100644
--- a/drivers/iio/pressure/bmp280-core.c
+++ b/drivers/iio/pressure/bmp280-core.c
@@ -2625,8 +2625,8 @@ static irqreturn_t bmp580_trigger_handler(int
irq, void *p)
struct iio_dev *indio_dev = pf->indio_dev;
struct bmp280_data *data = iio_priv(indio_dev);
struct {
- __le32 comp_temp;
__le32 comp_press;
+ __le32 comp_temp;
aligned_s64 timestamp;
} buffer = { };
int ret;
--
2.47.3
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] iio: pressure: bmp280: fix bmp580 buffer channel order
2026-12-04 3:45 [PATCH] iio: pressure: bmp280: fix bmp580 buffer channel order Eric Westphal
@ 2026-12-04 6:53 ` Joshua Crofts
2026-12-04 16:58 ` Andy Shevchenko
1 sibling, 0 replies; 3+ messages in thread
From: Joshua Crofts @ 2026-12-04 6:53 UTC (permalink / raw)
To: Eric Westphal, linux-iio, jic23
Cc: nuno.sa, dlechner, andy, linux-kernel, stable
On 04-Dec-26 4:45, Eric Westphal wrote:
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
What's this doing here?
> bmp580_channels[] declares pressure at scan_index 0 and temperature at
> scan_index 1, matching enum bmp280_scan. The original triggered-buffer
> support filled data->sensor_data[] in that order: pressure at offset 0,
> then temperature.
> Commit 872c8014e05e replaced the array with a stack-local scan struct,
> but declared the fields as temperature then pressure. The memcpy
> targets stayed correct, so the pushed buffer has the samples swapped
> relative to scan_index. Userspace therefore sees temperature counts in
> the pressure slot and vice versa.
> On a BMP581 this was observed as buffered values of about 26,800 Pa and
> 98 °C while the sysfs in_*_input attributes correctly reported about
> 100,601 Pa and 26.2 °C.
> Reorder the struct fields to match the scan_index mapping, as the
> bmp280, bme280, bmp380, and bmp180 trigger handlers already do.
> Fixes: 872c8014e05e ("iio: pressure: bmp280: drop sensor_data array")
> Cc: stable@vger.kernel.org
> # Replace the placeholder Signed-off-by before sending (do not use
> # Eric Westphal unless he is the submitter and agrees to the DCO):
> Signed-off-by: [Your Name] <your.email@example.com>
I don't mean to be harsh, but have you read the output from your LLM?
Please don't blindly copy patches. We can't accept patches without a
valid Signed-off-by tag.
> ---
> drivers/iio/pressure/bmp280-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/drivers/iio/pressure/bmp280-core.c
> b/drivers/iio/pressure/bmp280-core.c
I assume the LLM generated the entirety of this patch and git was not
used in the process, as the diff --git line is split into two, hence
the patch fails to apply. Or option 2 - you pasted this directly into
the compose window in Gmail, which malforms messages.
This patch is unacceptable. Please read
Documentation/process/submitting-patches.rst and go from there.
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] iio: pressure: bmp280: fix bmp580 buffer channel order
2026-12-04 3:45 [PATCH] iio: pressure: bmp280: fix bmp580 buffer channel order Eric Westphal
2026-12-04 6:53 ` Joshua Crofts
@ 2026-12-04 16:58 ` Andy Shevchenko
1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-12-04 16:58 UTC (permalink / raw)
To: Eric Westphal
Cc: linux-iio, jic23, nuno.sa, dlechner, andy, linux-kernel, stable
On Thu, Dec 03, 2026 at 09:45:17PM -0600, Eric Westphal wrote:
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> bmp580_channels[] declares pressure at scan_index 0 and temperature at
> scan_index 1, matching enum bmp280_scan. The original triggered-buffer
> support filled data->sensor_data[] in that order: pressure at offset 0,
> then temperature.
> Commit 872c8014e05e replaced the array with a stack-local scan struct,
> but declared the fields as temperature then pressure. The memcpy
> targets stayed correct, so the pushed buffer has the samples swapped
> relative to scan_index. Userspace therefore sees temperature counts in
> the pressure slot and vice versa.
> On a BMP581 this was observed as buffered values of about 26,800 Pa and
> 98 °C while the sysfs in_*_input attributes correctly reported about
> 100,601 Pa and 26.2 °C.
> Reorder the struct fields to match the scan_index mapping, as the
> bmp280, bme280, bmp380, and bmp180 trigger handlers already do.
> Fixes: 872c8014e05e ("iio: pressure: bmp280: drop sensor_data array")
> Cc: stable@vger.kernel.org
> # Replace the placeholder Signed-off-by before sending (do not use
> # Eric Westphal unless he is the submitter and agrees to the DCO):
> Signed-off-by: [Your Name] <your.email@example.com>
NAK. This is a complete mess. Take your time to understand the process, tools,
and format of how properly send patches to the Linux kernel project.
The main issue, that you haven't even read what you had sent. This is
unacceptable.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-04 16:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-04 3:45 [PATCH] iio: pressure: bmp280: fix bmp580 buffer channel order Eric Westphal
2026-12-04 6:53 ` Joshua Crofts
2026-12-04 16:58 ` Andy Shevchenko
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®