Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1365596 > unrolled thread

[PATCH 1/1] iio: gyro: bmg160: fix buffer read values

Started byIrina Tirdea <irina.tirdea@intel.com>
First post2016-03-28 19:20 +0200
Last post2016-04-07 09:00 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] iio: gyro: bmg160: fix buffer read values Irina Tirdea <irina.tirdea@intel.com> - 2016-03-28 19:20 +0200
    Re: [PATCH 1/1] iio: gyro: bmg160: fix buffer read values Jonathan Cameron <jic23@kernel.org> - 2016-04-03 12:30 +0200
    Re: [PATCH 1/1] iio: gyro: bmg160: fix buffer read values Markus Pargmann <mpa@pengutronix.de> - 2016-04-07 09:00 +0200

#1365596 — [PATCH 1/1] iio: gyro: bmg160: fix buffer read values

FromIrina Tirdea <irina.tirdea@intel.com>
Date2016-03-28 19:20 +0200
Subject[PATCH 1/1] iio: gyro: bmg160: fix buffer read values
Message-ID<rhIZA-1I8-23@gated-at.bofh.it>
When reading gyroscope axes using iio buffers, the values
returned are always 0. In the interrupt handler, the return
value of the read operation is returned to the user instead
of the value read. Return the value read to the user.

This is also fixed in commit 82d8e5da1a33 ("iio:
accel: bmg160: optimize transfers in trigger handler").

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
---
 drivers/iio/gyro/bmg160_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c
index 295cf1d..e165ce9 100644
--- a/drivers/iio/gyro/bmg160_core.c
+++ b/drivers/iio/gyro/bmg160_core.c
@@ -781,7 +781,7 @@ static irqreturn_t bmg160_trigger_handler(int irq, void *p)
 			mutex_unlock(&data->mutex);
 			goto err;
 		}
-		data->buffer[i++] = ret;
+		data->buffer[i++] = val;
 	}
 	mutex_unlock(&data->mutex);
 
-- 
1.9.1

[toc] | [next] | [standalone]


#1370185

FromJonathan Cameron <jic23@kernel.org>
Date2016-04-03 12:30 +0200
Message-ID<rjNs6-1W9-5@gated-at.bofh.it>
In reply to#1365596
On 28/03/16 18:15, Irina Tirdea wrote:
> When reading gyroscope axes using iio buffers, the values
> returned are always 0. In the interrupt handler, the return
> value of the read operation is returned to the user instead
> of the value read. Return the value read to the user.
> 
> This is also fixed in commit 82d8e5da1a33 ("iio:
> accel: bmg160: optimize transfers in trigger handler").
> 
> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Ouch.  Applied and marked for stable.

Jonathan
> ---
>  drivers/iio/gyro/bmg160_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c
> index 295cf1d..e165ce9 100644
> --- a/drivers/iio/gyro/bmg160_core.c
> +++ b/drivers/iio/gyro/bmg160_core.c
> @@ -781,7 +781,7 @@ static irqreturn_t bmg160_trigger_handler(int irq, void *p)
>  			mutex_unlock(&data->mutex);
>  			goto err;
>  		}
> -		data->buffer[i++] = ret;
> +		data->buffer[i++] = val;
>  	}
>  	mutex_unlock(&data->mutex);
>  
> 

[toc] | [prev] | [next] | [standalone]


#1373112

FromMarkus Pargmann <mpa@pengutronix.de>
Date2016-04-07 09:00 +0200
Message-ID<rlc53-8lR-5@gated-at.bofh.it>
In reply to#1365596

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Monday 28 March 2016 20:15:46 Irina Tirdea wrote:
> When reading gyroscope axes using iio buffers, the values
> returned are always 0. In the interrupt handler, the return
> value of the read operation is returned to the user instead
> of the value read. Return the value read to the user.
> 
> This is also fixed in commit 82d8e5da1a33 ("iio:
> accel: bmg160: optimize transfers in trigger handler").
> 
> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>

Thanks a lot for fixing all the bugs I introduced.

Best Regards,

Markus

> ---
>  drivers/iio/gyro/bmg160_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c
> index 295cf1d..e165ce9 100644
> --- a/drivers/iio/gyro/bmg160_core.c
> +++ b/drivers/iio/gyro/bmg160_core.c
> @@ -781,7 +781,7 @@ static irqreturn_t bmg160_trigger_handler(int irq, void *p)
>  			mutex_unlock(&data->mutex);
>  			goto err;
>  		}
> -		data->buffer[i++] = ret;
> +		data->buffer[i++] = val;
>  	}
>  	mutex_unlock(&data->mutex);
>  
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web