Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts()
@ 2026-08-18 21:51 Gabriel Rondon
  2026-08-18 21:51 ` [PATCH v2 1/2] iio: accel: kionix-kx022a: use scan struct for one-shot and trigger reads Gabriel Rondon
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Gabriel Rondon @ 2026-08-18 21:51 UTC (permalink / raw)
  To: Matti Vaittinen, Jonathan Cameron
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
	linux-kernel

v1 was a single patch converting the two push sites to
iio_push_to_buffers_with_ts(). Reviewing it, Jonathan pointed out that
the driver carries two separate staging areas holding the same thing
(buffer[8] and the scan struct), and asked to fold the cleanup into this
set.

So v2 is a two-patch series: patch 1 drops the redundant buffer and
routes the one-shot read and the triggered handler through scan, and
patch 2 does the deprecated-API conversion, now with a single buffer to
push at both sites.

Changes in v2:
- New patch 1: drop buffer[8], use scan for the one-shot read and the
  triggered handler, move IIO_DMA_MINALIGN onto scan (Jonathan)
- Patch 2 now pushes data->scan at both sites instead of data->buffer

v1: https://lore.kernel.org/linux-iio/20260818155635.8367-1-grondon@gmail.com/

Gabriel Rondon (2):
  iio: accel: kionix-kx022a: use scan struct for one-shot and trigger
    reads
  iio: accel: kionix-kx022a: use iio_push_to_buffers_with_ts()

 drivers/iio/accel/kionix-kx022a.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

-- 
2.50.1 (Apple Git-155)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 1/2] iio: accel: kionix-kx022a: use scan struct for one-shot and trigger reads
  2026-08-18 21:51 [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts() Gabriel Rondon
@ 2026-08-18 21:51 ` Gabriel Rondon
  2026-08-19  4:59   ` Matti Vaittinen
  2026-08-19  7:17   ` Andy Shevchenko
  2026-08-18 21:51 ` [PATCH v2 2/2] iio: accel: kionix-kx022a: use iio_push_to_buffers_with_ts() Gabriel Rondon
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Gabriel Rondon @ 2026-08-18 21:51 UTC (permalink / raw)
  To: Matti Vaittinen, Jonathan Cameron
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
	linux-kernel

The driver kept two separate staging areas that hold the same thing:
buffer[8], a DMA-aligned area used by the one-shot read in
kx022a_get_axis() and by the triggered handler, and the scan struct,
used by the FIFO flush path. Both are three __le16 channels plus room
for the timestamp.

Drop buffer and route the one-shot read and the triggered handler
through scan.channels, so the driver has a single staging area. Move the
IIO_DMA_MINALIGN alignment onto scan, since it now backs the regmap bulk
reads that buffer used to.

No functional change. get_axis() only runs via read_raw() under
iio_device_claim_direct(), so it cannot run while the triggered buffer is
active, and the triggered handler only runs while it is; the two never
touch scan concurrently, exactly as they previously shared buffer.

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
---
 drivers/iio/accel/kionix-kx022a.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c
index 02dd1db7a646..cf2cb751b4e8 100644
--- a/drivers/iio/accel/kionix-kx022a.c
+++ b/drivers/iio/accel/kionix-kx022a.c
@@ -301,11 +301,10 @@ struct kx022a_data {
 	__le16 *fifo_buffer;
 
 	/* 3 x 16bit accel data + timestamp */
-	__le16 buffer[8] __aligned(IIO_DMA_MINALIGN);
 	struct {
 		__le16 channels[3];
 		aligned_s64 ts;
-	} scan;
+	} scan __aligned(IIO_DMA_MINALIGN);
 };
 
 static const struct iio_mount_matrix *
@@ -613,12 +612,12 @@ static int kx022a_get_axis(struct kx022a_data *data,
 {
 	int ret;
 
-	ret = regmap_bulk_read(data->regmap, chan->address, &data->buffer[0],
-			       sizeof(__le16));
+	ret = regmap_bulk_read(data->regmap, chan->address,
+			       &data->scan.channels[0], sizeof(__le16));
 	if (ret)
 		return ret;
 
-	*val = (s16)le16_to_cpu(data->buffer[0]);
+	*val = (s16)le16_to_cpu(data->scan.channels[0]);
 
 	return IIO_VAL_INT;
 }
@@ -1029,12 +1028,12 @@ static irqreturn_t kx022a_trigger_handler(int irq, void *p)
 	struct kx022a_data *data = iio_priv(idev);
 	int ret;
 
-	ret = regmap_bulk_read(data->regmap, data->chip_info->xout_l, data->buffer,
-			       KX022A_FIFO_SAMPLES_SIZE_BYTES);
+	ret = regmap_bulk_read(data->regmap, data->chip_info->xout_l,
+			       data->scan.channels, KX022A_FIFO_SAMPLES_SIZE_BYTES);
 	if (ret < 0)
 		goto err_read;
 
-	iio_push_to_buffers_with_timestamp(idev, data->buffer, data->timestamp);
+	iio_push_to_buffers_with_timestamp(idev, &data->scan, data->timestamp);
 err_read:
 	iio_trigger_notify_done(idev->trig);
 
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 2/2] iio: accel: kionix-kx022a: use iio_push_to_buffers_with_ts()
  2026-08-18 21:51 [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts() Gabriel Rondon
  2026-08-18 21:51 ` [PATCH v2 1/2] iio: accel: kionix-kx022a: use scan struct for one-shot and trigger reads Gabriel Rondon
@ 2026-08-18 21:51 ` Gabriel Rondon
  2026-08-19  5:11   ` Matti Vaittinen
  2026-08-19  0:09 ` [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts() Jonathan Cameron
  2026-08-19  7:19 ` Andy Shevchenko
  3 siblings, 1 reply; 10+ messages in thread
From: Gabriel Rondon @ 2026-08-18 21:51 UTC (permalink / raw)
  To: Matti Vaittinen, Jonathan Cameron
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
	linux-kernel

Replace the deprecated iio_push_to_buffers_with_timestamp() with
iio_push_to_buffers_with_ts(), which takes the destination buffer size
and checks it against scan_bytes at runtime.

Both push sites now use data->scan ({ __le16 channels[3]; aligned_s64
ts; }, IIO_DMA_MINALIGN aligned), which is 16 bytes and matches
scan_bytes for the 3-axis plus s64 timestamp layout used by all
supported variants, so pass sizeof(data->scan).

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
---
 drivers/iio/accel/kionix-kx022a.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c
index cf2cb751b4e8..86f17431aa23 100644
--- a/drivers/iio/accel/kionix-kx022a.c
+++ b/drivers/iio/accel/kionix-kx022a.c
@@ -863,7 +863,8 @@ static int __kx022a_fifo_flush(struct iio_dev *idev, unsigned int samples,
 		for_each_set_bit(bit, idev->active_scan_mask, AXIS_MAX)
 			chs[bit] = sam[bit];
 
-		iio_push_to_buffers_with_timestamp(idev, &data->scan, tstamp);
+		iio_push_to_buffers_with_ts(idev, &data->scan,
+					    sizeof(data->scan), tstamp);
 
 		tstamp += sample_period;
 	}
@@ -1033,7 +1034,8 @@ static irqreturn_t kx022a_trigger_handler(int irq, void *p)
 	if (ret < 0)
 		goto err_read;
 
-	iio_push_to_buffers_with_timestamp(idev, &data->scan, data->timestamp);
+	iio_push_to_buffers_with_ts(idev, &data->scan, sizeof(data->scan),
+				    data->timestamp);
 err_read:
 	iio_trigger_notify_done(idev->trig);
 
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts()
  2026-08-18 21:51 [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts() Gabriel Rondon
  2026-08-18 21:51 ` [PATCH v2 1/2] iio: accel: kionix-kx022a: use scan struct for one-shot and trigger reads Gabriel Rondon
  2026-08-18 21:51 ` [PATCH v2 2/2] iio: accel: kionix-kx022a: use iio_push_to_buffers_with_ts() Gabriel Rondon
@ 2026-08-19  0:09 ` Jonathan Cameron
  2026-08-19  5:15   ` Matti Vaittinen
  2026-08-19  7:19 ` Andy Shevchenko
  3 siblings, 1 reply; 10+ messages in thread
From: Jonathan Cameron @ 2026-08-19  0:09 UTC (permalink / raw)
  To: Gabriel Rondon
  Cc: Matti Vaittinen, David Lechner, Nuno Sá, Andy Shevchenko,
	linux-iio, linux-kernel

On Tue, 18 Aug 2026 22:51:20 +0100
Gabriel Rondon <grondon@gmail.com> wrote:

> v1 was a single patch converting the two push sites to
> iio_push_to_buffers_with_ts(). Reviewing it, Jonathan pointed out that
> the driver carries two separate staging areas holding the same thing
> (buffer[8] and the scan struct), and asked to fold the cleanup into this
> set.
> 
> So v2 is a two-patch series: patch 1 drops the redundant buffer and
> routes the one-shot read and the triggered handler through scan, and
> patch 2 does the deprecated-API conversion, now with a single buffer to
> push at both sites.
> 
> Changes in v2:
> - New patch 1: drop buffer[8], use scan for the one-shot read and the
>   triggered handler, move IIO_DMA_MINALIGN onto scan (Jonathan)
> - Patch 2 now pushes data->scan at both sites instead of data->buffer
> 
Nice.  All looks good to me, so I'll queue it up.

Applied to the testing branch of iio.git which will be rebased on rc1 once
available.

Note that there is plenty of time for additional feedback, tags or indeed
me to drop it again if someone spots something I missed.

Thanks,

Jonathan

> v1: https://lore.kernel.org/linux-iio/20260818155635.8367-1-grondon@gmail.com/
> 
> Gabriel Rondon (2):
>   iio: accel: kionix-kx022a: use scan struct for one-shot and trigger
>     reads
>   iio: accel: kionix-kx022a: use iio_push_to_buffers_with_ts()
> 
>  drivers/iio/accel/kionix-kx022a.c | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/2] iio: accel: kionix-kx022a: use scan struct for one-shot and trigger reads
  2026-08-18 21:51 ` [PATCH v2 1/2] iio: accel: kionix-kx022a: use scan struct for one-shot and trigger reads Gabriel Rondon
@ 2026-08-19  4:59   ` Matti Vaittinen
  2026-08-19  7:17   ` Andy Shevchenko
  1 sibling, 0 replies; 10+ messages in thread
From: Matti Vaittinen @ 2026-08-19  4:59 UTC (permalink / raw)
  To: Gabriel Rondon, Jonathan Cameron
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
	linux-kernel

On 19/08/2026 00:51, Gabriel Rondon wrote:
> The driver kept two separate staging areas that hold the same thing:
> buffer[8], a DMA-aligned area used by the one-shot read in
> kx022a_get_axis() and by the triggered handler, and the scan struct,
> used by the FIFO flush path. Both are three __le16 channels plus room
> for the timestamp.
> 
> Drop buffer and route the one-shot read and the triggered handler
> through scan.channels, so the driver has a single staging area. Move the
> IIO_DMA_MINALIGN alignment onto scan, since it now backs the regmap bulk
> reads that buffer used to.
> 
> No functional change. get_axis() only runs via read_raw() under
> iio_device_claim_direct(), so it cannot run while the triggered buffer is
> active, and the triggered handler only runs while it is; the two never
> touch scan concurrently, exactly as they previously shared buffer.
> 
> Signed-off-by: Gabriel Rondon <grondon@gmail.com>

Suggested-by?

Other than that - looks good to me.

Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>

> ---
>   drivers/iio/accel/kionix-kx022a.c | 15 +++++++--------
>   1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c
> index 02dd1db7a646..cf2cb751b4e8 100644
> --- a/drivers/iio/accel/kionix-kx022a.c
> +++ b/drivers/iio/accel/kionix-kx022a.c
> @@ -301,11 +301,10 @@ struct kx022a_data {
>   	__le16 *fifo_buffer;
>   
>   	/* 3 x 16bit accel data + timestamp */
> -	__le16 buffer[8] __aligned(IIO_DMA_MINALIGN);
>   	struct {
>   		__le16 channels[3];
>   		aligned_s64 ts;
> -	} scan;
> +	} scan __aligned(IIO_DMA_MINALIGN);
>   };
>   
>   static const struct iio_mount_matrix *
> @@ -613,12 +612,12 @@ static int kx022a_get_axis(struct kx022a_data *data,
>   {
>   	int ret;
>   
> -	ret = regmap_bulk_read(data->regmap, chan->address, &data->buffer[0],
> -			       sizeof(__le16));
> +	ret = regmap_bulk_read(data->regmap, chan->address,
> +			       &data->scan.channels[0], sizeof(__le16));
>   	if (ret)
>   		return ret;
>   
> -	*val = (s16)le16_to_cpu(data->buffer[0]);
> +	*val = (s16)le16_to_cpu(data->scan.channels[0]);
>   
>   	return IIO_VAL_INT;
>   }
> @@ -1029,12 +1028,12 @@ static irqreturn_t kx022a_trigger_handler(int irq, void *p)
>   	struct kx022a_data *data = iio_priv(idev);
>   	int ret;
>   
> -	ret = regmap_bulk_read(data->regmap, data->chip_info->xout_l, data->buffer,
> -			       KX022A_FIFO_SAMPLES_SIZE_BYTES);
> +	ret = regmap_bulk_read(data->regmap, data->chip_info->xout_l,
> +			       data->scan.channels, KX022A_FIFO_SAMPLES_SIZE_BYTES);
>   	if (ret < 0)
>   		goto err_read;
>   
> -	iio_push_to_buffers_with_timestamp(idev, data->buffer, data->timestamp);
> +	iio_push_to_buffers_with_timestamp(idev, &data->scan, data->timestamp);
>   err_read:
>   	iio_trigger_notify_done(idev->trig);
>   


-- 
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 2/2] iio: accel: kionix-kx022a: use iio_push_to_buffers_with_ts()
  2026-08-18 21:51 ` [PATCH v2 2/2] iio: accel: kionix-kx022a: use iio_push_to_buffers_with_ts() Gabriel Rondon
@ 2026-08-19  5:11   ` Matti Vaittinen
  0 siblings, 0 replies; 10+ messages in thread
From: Matti Vaittinen @ 2026-08-19  5:11 UTC (permalink / raw)
  To: Gabriel Rondon, Jonathan Cameron
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
	linux-kernel

On 19/08/2026 00:51, Gabriel Rondon wrote:
> Replace the deprecated iio_push_to_buffers_with_timestamp() with
> iio_push_to_buffers_with_ts(), which takes the destination buffer size
> and checks it against scan_bytes at runtime.
> 
> Both push sites now use data->scan ({ __le16 channels[3]; aligned_s64
> ts; }, IIO_DMA_MINALIGN aligned), which is 16 bytes and matches
> scan_bytes for the 3-axis plus s64 timestamp layout used by all
> supported variants, so pass sizeof(data->scan).

Eh, what is this explanation above? As far as I understand, the 
iio_push_to_buffers_with_ts() has a safety mechanism of checking the 
passed buffer size. So, size of the buffer must be passed, no matter 
what the buffer is designed to contain.

By the way, to my eye the commit message looks AI generated, which is 
perfectly fine. But AFAICS, AI generated patches should be tagged as AI 
generated. Hence, if you use AI to do the changes, please ask the AI to 
check the docs and also add necessary tags :)

> Signed-off-by: Gabriel Rondon <grondon@gmail.com>

Other than the commit message:
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>

> ---
>   drivers/iio/accel/kionix-kx022a.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c
> index cf2cb751b4e8..86f17431aa23 100644
> --- a/drivers/iio/accel/kionix-kx022a.c
> +++ b/drivers/iio/accel/kionix-kx022a.c
> @@ -863,7 +863,8 @@ static int __kx022a_fifo_flush(struct iio_dev *idev, unsigned int samples,
>   		for_each_set_bit(bit, idev->active_scan_mask, AXIS_MAX)
>   			chs[bit] = sam[bit];
>   
> -		iio_push_to_buffers_with_timestamp(idev, &data->scan, tstamp);
> +		iio_push_to_buffers_with_ts(idev, &data->scan,
> +					    sizeof(data->scan), tstamp);
>   
>   		tstamp += sample_period;
>   	}
> @@ -1033,7 +1034,8 @@ static irqreturn_t kx022a_trigger_handler(int irq, void *p)
>   	if (ret < 0)
>   		goto err_read;
>   
> -	iio_push_to_buffers_with_timestamp(idev, &data->scan, data->timestamp);
> +	iio_push_to_buffers_with_ts(idev, &data->scan, sizeof(data->scan),
> +				    data->timestamp);
>   err_read:
>   	iio_trigger_notify_done(idev->trig);
>   


-- 
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts()
  2026-08-19  0:09 ` [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts() Jonathan Cameron
@ 2026-08-19  5:15   ` Matti Vaittinen
  2026-08-19  7:18     ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Matti Vaittinen @ 2026-08-19  5:15 UTC (permalink / raw)
  To: Jonathan Cameron, Gabriel Rondon
  Cc: David Lechner, Nuno Sá, Andy Shevchenko, linux-iio,
	linux-kernel

On 19/08/2026 03:09, Jonathan Cameron wrote:
> On Tue, 18 Aug 2026 22:51:20 +0100
> Gabriel Rondon <grondon@gmail.com> wrote:
> 
>> v1 was a single patch converting the two push sites to
>> iio_push_to_buffers_with_ts(). Reviewing it, Jonathan pointed out that
>> the driver carries two separate staging areas holding the same thing
>> (buffer[8] and the scan struct), and asked to fold the cleanup into this
>> set.
>>
>> So v2 is a two-patch series: patch 1 drops the redundant buffer and
>> routes the one-shot read and the triggered handler through scan, and
>> patch 2 does the deprecated-API conversion, now with a single buffer to
>> push at both sites.
>>
>> Changes in v2:
>> - New patch 1: drop buffer[8], use scan for the one-shot read and the
>>    triggered handler, move IIO_DMA_MINALIGN onto scan (Jonathan)
>> - Patch 2 now pushes data->scan at both sites instead of data->buffer
>>
> Nice.  All looks good to me, so I'll queue it up.
> 
> Applied to the testing branch of iio.git which will be rebased on rc1 once
> available.
> 
> Note that there is plenty of time for additional feedback, tags or indeed
> me to drop it again if someone spots something I missed.

Ah, Jonathan was quick and efficient :)
I'll drop my comments to 'nits' in order to not generate more work for 
Jonathan. Hence, acting on my comments is not required.

-- Matti

-- 
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 1/2] iio: accel: kionix-kx022a: use scan struct for one-shot and trigger reads
  2026-08-18 21:51 ` [PATCH v2 1/2] iio: accel: kionix-kx022a: use scan struct for one-shot and trigger reads Gabriel Rondon
  2026-08-19  4:59   ` Matti Vaittinen
@ 2026-08-19  7:17   ` Andy Shevchenko
  1 sibling, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2026-08-19  7:17 UTC (permalink / raw)
  To: Gabriel Rondon
  Cc: Matti Vaittinen, Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, linux-iio, linux-kernel

On Tue, Aug 18, 2026 at 10:51:21PM +0100, Gabriel Rondon wrote:
> The driver kept two separate staging areas that hold the same thing:
> buffer[8], a DMA-aligned area used by the one-shot read in
> kx022a_get_axis() and by the triggered handler, and the scan struct,
> used by the FIFO flush path. Both are three __le16 channels plus room
> for the timestamp.
> 
> Drop buffer and route the one-shot read and the triggered handler
> through scan.channels, so the driver has a single staging area. Move the
> IIO_DMA_MINALIGN alignment onto scan, since it now backs the regmap bulk
> reads that buffer used to.
> 
> No functional change. get_axis() only runs via read_raw() under
> iio_device_claim_direct(), so it cannot run while the triggered buffer is
> active, and the triggered handler only runs while it is; the two never
> touch scan concurrently, exactly as they previously shared buffer.

...

> static int kx022a_get_axis(struct kx022a_data *data,

>  {

I would rather do this

	__le16 *buf = &data->scan.channels[0];

>  	int ret;
>  
> -	ret = regmap_bulk_read(data->regmap, chan->address, &data->buffer[0],
> -			       sizeof(__le16));
> +	ret = regmap_bulk_read(data->regmap, chan->address,
> +			       &data->scan.channels[0], sizeof(__le16));

	ret = regmap_bulk_read(data->regmap, chan->address, buf, sizeof(*buf));

>  	if (ret)
>  		return ret;
>  
> -	*val = (s16)le16_to_cpu(data->buffer[0]);
> +	*val = (s16)le16_to_cpu(data->scan.channels[0]);

	*val = (s16)le16_to_cpup(buf);

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts()
  2026-08-19  5:15   ` Matti Vaittinen
@ 2026-08-19  7:18     ` Andy Shevchenko
  0 siblings, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2026-08-19  7:18 UTC (permalink / raw)
  To: Matti Vaittinen
  Cc: Jonathan Cameron, Gabriel Rondon, David Lechner, Nuno Sá,
	Andy Shevchenko, linux-iio, linux-kernel

On Wed, Aug 19, 2026 at 08:15:40AM +0300, Matti Vaittinen wrote:
> On 19/08/2026 03:09, Jonathan Cameron wrote:
> > On Tue, 18 Aug 2026 22:51:20 +0100
> > Gabriel Rondon <grondon@gmail.com> wrote:
> > 
> > > v1 was a single patch converting the two push sites to
> > > iio_push_to_buffers_with_ts(). Reviewing it, Jonathan pointed out that
> > > the driver carries two separate staging areas holding the same thing
> > > (buffer[8] and the scan struct), and asked to fold the cleanup into this
> > > set.
> > > 
> > > So v2 is a two-patch series: patch 1 drops the redundant buffer and
> > > routes the one-shot read and the triggered handler through scan, and
> > > patch 2 does the deprecated-API conversion, now with a single buffer to
> > > push at both sites.
> > > 
> > > Changes in v2:
> > > - New patch 1: drop buffer[8], use scan for the one-shot read and the
> > >    triggered handler, move IIO_DMA_MINALIGN onto scan (Jonathan)
> > > - Patch 2 now pushes data->scan at both sites instead of data->buffer
> > > 
> > Nice.  All looks good to me, so I'll queue it up.
> > 
> > Applied to the testing branch of iio.git which will be rebased on rc1 once
> > available.
> > 
> > Note that there is plenty of time for additional feedback, tags or indeed
> > me to drop it again if someone spots something I missed.
> 
> Ah, Jonathan was quick and efficient :)
> I'll drop my comments to 'nits' in order to not generate more work for

And I, in the opposite, insist on mine against patch 1 as I consider that that
makes code easier to read and follow.

> Jonathan. Hence, acting on my comments is not required.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts()
  2026-08-18 21:51 [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts() Gabriel Rondon
                   ` (2 preceding siblings ...)
  2026-08-19  0:09 ` [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts() Jonathan Cameron
@ 2026-08-19  7:19 ` Andy Shevchenko
  3 siblings, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2026-08-19  7:19 UTC (permalink / raw)
  To: Gabriel Rondon
  Cc: Matti Vaittinen, Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, linux-iio, linux-kernel

On Tue, Aug 18, 2026 at 10:51:20PM +0100, Gabriel Rondon wrote:
> v1 was a single patch converting the two push sites to
> iio_push_to_buffers_with_ts(). Reviewing it, Jonathan pointed out that
> the driver carries two separate staging areas holding the same thing
> (buffer[8] and the scan struct), and asked to fold the cleanup into this
> set.
> 
> So v2 is a two-patch series: patch 1 drops the redundant buffer and
> routes the one-shot read and the triggered handler through scan, and
> patch 2 does the deprecated-API conversion, now with a single buffer to
> push at both sites.

Good job!
Assuming my comments are being addressed,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-08-19  7:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 21:51 [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts() Gabriel Rondon
2026-08-18 21:51 ` [PATCH v2 1/2] iio: accel: kionix-kx022a: use scan struct for one-shot and trigger reads Gabriel Rondon
2026-08-19  4:59   ` Matti Vaittinen
2026-08-19  7:17   ` Andy Shevchenko
2026-08-18 21:51 ` [PATCH v2 2/2] iio: accel: kionix-kx022a: use iio_push_to_buffers_with_ts() Gabriel Rondon
2026-08-19  5:11   ` Matti Vaittinen
2026-08-19  0:09 ` [PATCH v2 0/2] iio: accel: kionix-kx022a: unify staging buffer and convert to iio_push_to_buffers_with_ts() Jonathan Cameron
2026-08-19  5:15   ` Matti Vaittinen
2026-08-19  7:18     ` Andy Shevchenko
2026-08-19  7:19 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox