* [PATCH] iio: imu: inv_mpu6050: do not flush fifo when iio buffer is full
@ 2018-04-13 8:25 Jean-Baptiste Maneyrol
2018-04-14 18:00 ` Martin Kelly
0 siblings, 1 reply; 3+ messages in thread
From: Jean-Baptiste Maneyrol @ 2018-04-13 8:25 UTC (permalink / raw)
To: linux-iio; +Cc: Jean-Baptiste Maneyrol
There is no need to flush fifo and loose all data when the iio
buffer is full. Just drop the data by ignoring the error as
commonly done in other drivers.
Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
---
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
index ff81c6a..27c663c 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
@@ -170,10 +170,8 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
if (result == 0)
timestamp = 0;
- result = iio_push_to_buffers_with_timestamp(indio_dev, data,
- timestamp);
- if (result)
- goto flush_fifo;
+ iio_push_to_buffers_with_timestamp(indio_dev, data, timestamp);
+
fifo_count -= bytes_per_datum;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: imu: inv_mpu6050: do not flush fifo when iio buffer is full
2018-04-13 8:25 [PATCH] iio: imu: inv_mpu6050: do not flush fifo when iio buffer is full Jean-Baptiste Maneyrol
@ 2018-04-14 18:00 ` Martin Kelly
2018-04-15 17:07 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Martin Kelly @ 2018-04-14 18:00 UTC (permalink / raw)
To: Jean-Baptiste Maneyrol, linux-iio
On 04/13/2018 01:25 AM, Jean-Baptiste Maneyrol wrote:
> There is no need to flush fifo and loose all data when the iio
> buffer is full. Just drop the data by ignoring the error as
> commonly done in other drivers.
>
> Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
> ---
> drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
> index ff81c6a..27c663c 100644
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
> @@ -170,10 +170,8 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
> if (result == 0)
> timestamp = 0;
>
> - result = iio_push_to_buffers_with_timestamp(indio_dev, data,
> - timestamp);
> - if (result)
> - goto flush_fifo;
> + iio_push_to_buffers_with_timestamp(indio_dev, data, timestamp);
> +
> fifo_count -= bytes_per_datum;
> }
>
>
Reviewed-by: Martin Kelly <martin@martingkelly.com>
I wondered the same thing as I was reading this code :).
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: imu: inv_mpu6050: do not flush fifo when iio buffer is full
2018-04-14 18:00 ` Martin Kelly
@ 2018-04-15 17:07 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2018-04-15 17:07 UTC (permalink / raw)
To: Martin Kelly; +Cc: Jean-Baptiste Maneyrol, linux-iio
On Sat, 14 Apr 2018 11:00:07 -0700
Martin Kelly <martin@martingkelly.com> wrote:
> On 04/13/2018 01:25 AM, Jean-Baptiste Maneyrol wrote:
> > There is no need to flush fifo and loose all data when the iio
> > buffer is full. Just drop the data by ignoring the error as
> > commonly done in other drivers.
> >
> > Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
> > ---
> > drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
> > index ff81c6a..27c663c 100644
> > --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
> > +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
> > @@ -170,10 +170,8 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
> > if (result == 0)
> > timestamp = 0;
> >
> > - result = iio_push_to_buffers_with_timestamp(indio_dev, data,
> > - timestamp);
> > - if (result)
> > - goto flush_fifo;
> > + iio_push_to_buffers_with_timestamp(indio_dev, data, timestamp);
> > +
> > fifo_count -= bytes_per_datum;
> > }
> >
> >
>
> Reviewed-by: Martin Kelly <martin@martingkelly.com>
>
> I wondered the same thing as I was reading this code :).
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.
Thanks,
Jonathan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-15 17:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-13 8:25 [PATCH] iio: imu: inv_mpu6050: do not flush fifo when iio buffer is full Jean-Baptiste Maneyrol
2018-04-14 18:00 ` Martin Kelly
2018-04-15 17:07 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox