Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v1 0/1] iio: pressure: dps310: Adjust Timeout Settings
@ 2023-08-29 18:02 Lakshmi Yadlapati
  2023-08-29 18:02 ` [PATCH v1 1/1] " Lakshmi Yadlapati
  0 siblings, 1 reply; 5+ messages in thread
From: Lakshmi Yadlapati @ 2023-08-29 18:02 UTC (permalink / raw)
  To: eajames, jic23, lars, joel, andrew
  Cc: linux-iio, linux-kernel, Lakshmi Yadlapati

Adjust dps310 timeout settings as per specifications to resolve intermittent errors.

Lakshmi Yadlapati (1):
  iio: pressure: dps310: Adjust Timeout Settings

 drivers/iio/pressure/dps310.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.39.2


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

* [PATCH v1 1/1] iio: pressure: dps310: Adjust Timeout Settings
  2023-08-29 18:02 [PATCH v1 0/1] iio: pressure: dps310: Adjust Timeout Settings Lakshmi Yadlapati
@ 2023-08-29 18:02 ` Lakshmi Yadlapati
  2023-09-03 11:53   ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: Lakshmi Yadlapati @ 2023-08-29 18:02 UTC (permalink / raw)
  To: eajames, jic23, lars, joel, andrew
  Cc: linux-iio, linux-kernel, Lakshmi Yadlapati

The DPS310 sensor chip has been encountering intermittent errors while
reading the sensor device across various system designs. This issue causes
the chip to become "stuck," preventing the indication of "ready" status
for pressure and temperature measurements in the MEAS_CFG register.

To address this issue, this commit fixes the timeout settings to improve
sensor stability:
- After sending a reset command to the chip, the timeout has been extended
  from 2.5 ms to 15 ms, aligning with the DPS310 specification.
- The read timeout value of the MEAS_CFG register has been adjusted from
  20ms to 30ms to match the specification.

Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
---
 drivers/iio/pressure/dps310.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/pressure/dps310.c b/drivers/iio/pressure/dps310.c
index b10dbf5cf494..1ff091b2f764 100644
--- a/drivers/iio/pressure/dps310.c
+++ b/drivers/iio/pressure/dps310.c
@@ -57,8 +57,8 @@
 #define  DPS310_RESET_MAGIC	0x09
 #define DPS310_COEF_BASE	0x10
 
-/* Make sure sleep time is <= 20ms for usleep_range */
-#define DPS310_POLL_SLEEP_US(t)		min(20000, (t) / 8)
+/* Make sure sleep time is <= 30ms for usleep_range */
+#define DPS310_POLL_SLEEP_US(t)		min(30000, (t) / 8)
 /* Silently handle error in rate value here */
 #define DPS310_POLL_TIMEOUT_US(rc)	((rc) <= 0 ? 1000000 : 1000000 / (rc))
 
@@ -402,8 +402,8 @@ static int dps310_reset_wait(struct dps310_data *data)
 	if (rc)
 		return rc;
 
-	/* Wait for device chip access: 2.5ms in specification */
-	usleep_range(2500, 12000);
+	/* Wait for device chip access: 15ms in specification */
+	usleep_range(15000, 55000);
 	return 0;
 }
 
-- 
2.39.2


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

* Re: [PATCH v1 1/1] iio: pressure: dps310: Adjust Timeout Settings
  2023-08-29 18:02 ` [PATCH v1 1/1] " Lakshmi Yadlapati
@ 2023-09-03 11:53   ` Jonathan Cameron
  2023-09-06 14:55     ` Lakshmi Yadlapati
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Cameron @ 2023-09-03 11:53 UTC (permalink / raw)
  To: Lakshmi Yadlapati; +Cc: eajames, lars, joel, andrew, linux-iio, linux-kernel

On Tue, 29 Aug 2023 13:02:22 -0500
Lakshmi Yadlapati <lakshmiy@us.ibm.com> wrote:

> The DPS310 sensor chip has been encountering intermittent errors while
> reading the sensor device across various system designs. This issue causes
> the chip to become "stuck," preventing the indication of "ready" status
> for pressure and temperature measurements in the MEAS_CFG register.
> 
> To address this issue, this commit fixes the timeout settings to improve
> sensor stability:
> - After sending a reset command to the chip, the timeout has been extended
>   from 2.5 ms to 15 ms, aligning with the DPS310 specification.
> - The read timeout value of the MEAS_CFG register has been adjusted from
>   20ms to 30ms to match the specification.
> 
> Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
Hi Lakshmi,

This seems reasonable to me, but as we probably want to backport it to
stable kernels, please could you figure out an appropriate Fixes tag.

Fine to just reply to this email with the tag rather than resend.

Thanks

Jonathan
 
> ---
>  drivers/iio/pressure/dps310.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/pressure/dps310.c b/drivers/iio/pressure/dps310.c
> index b10dbf5cf494..1ff091b2f764 100644
> --- a/drivers/iio/pressure/dps310.c
> +++ b/drivers/iio/pressure/dps310.c
> @@ -57,8 +57,8 @@
>  #define  DPS310_RESET_MAGIC	0x09
>  #define DPS310_COEF_BASE	0x10
>  
> -/* Make sure sleep time is <= 20ms for usleep_range */
> -#define DPS310_POLL_SLEEP_US(t)		min(20000, (t) / 8)
> +/* Make sure sleep time is <= 30ms for usleep_range */
> +#define DPS310_POLL_SLEEP_US(t)		min(30000, (t) / 8)
>  /* Silently handle error in rate value here */
>  #define DPS310_POLL_TIMEOUT_US(rc)	((rc) <= 0 ? 1000000 : 1000000 / (rc))
>  
> @@ -402,8 +402,8 @@ static int dps310_reset_wait(struct dps310_data *data)
>  	if (rc)
>  		return rc;
>  
> -	/* Wait for device chip access: 2.5ms in specification */
> -	usleep_range(2500, 12000);
> +	/* Wait for device chip access: 15ms in specification */
> +	usleep_range(15000, 55000);
>  	return 0;
>  }
>  


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

* RE: [PATCH v1 1/1] iio: pressure: dps310: Adjust Timeout Settings
  2023-09-03 11:53   ` Jonathan Cameron
@ 2023-09-06 14:55     ` Lakshmi Yadlapati
  2023-09-10 13:50       ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: Lakshmi Yadlapati @ 2023-09-06 14:55 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: eajames@linux.ibm.com, lars@metafoo.de, joel@jms.id.au,
	andrew@aj.id.au, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org

Fixes: 7b4ab4abcea4 ("iio: pressure: dps310: Reset chip after timeout")

Thanks,
Lakshmi

On 9/3/23, 6:52 AM, "Jonathan Cameron" <jic23@kernel.org <mailto:jic23@kernel.org>> wrote:


On Tue, 29 Aug 2023 13:02:22 -0500
Lakshmi Yadlapati <lakshmiy@us.ibm.com <mailto:lakshmiy@us.ibm.com>> wrote:


> The DPS310 sensor chip has been encountering intermittent errors while
> reading the sensor device across various system designs. This issue causes
> the chip to become "stuck," preventing the indication of "ready" status
> for pressure and temperature measurements in the MEAS_CFG register.
> 
> To address this issue, this commit fixes the timeout settings to improve
> sensor stability:
> - After sending a reset command to the chip, the timeout has been extended
> from 2.5 ms to 15 ms, aligning with the DPS310 specification.
> - The read timeout value of the MEAS_CFG register has been adjusted from
> 20ms to 30ms to match the specification.
> 
> Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com <mailto:lakshmiy@us.ibm.com>>
Hi Lakshmi,


This seems reasonable to me, but as we probably want to backport it to
stable kernels, please could you figure out an appropriate Fixes tag.


Fine to just reply to this email with the tag rather than resend.


Thanks


Jonathan


> ---
> drivers/iio/pressure/dps310.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/pressure/dps310.c b/drivers/iio/pressure/dps310.c
> index b10dbf5cf494..1ff091b2f764 100644
> --- a/drivers/iio/pressure/dps310.c
> +++ b/drivers/iio/pressure/dps310.c
> @@ -57,8 +57,8 @@
> #define DPS310_RESET_MAGIC 0x09
> #define DPS310_COEF_BASE 0x10
> 
> -/* Make sure sleep time is <= 20ms for usleep_range */
> -#define DPS310_POLL_SLEEP_US(t) min(20000, (t) / 8)
> +/* Make sure sleep time is <= 30ms for usleep_range */
> +#define DPS310_POLL_SLEEP_US(t) min(30000, (t) / 8)
> /* Silently handle error in rate value here */
> #define DPS310_POLL_TIMEOUT_US(rc) ((rc) <= 0 ? 1000000 : 1000000 / (rc))
> 
> @@ -402,8 +402,8 @@ static int dps310_reset_wait(struct dps310_data *data)
> if (rc)
> return rc;
> 
> - /* Wait for device chip access: 2.5ms in specification */
> - usleep_range(2500, 12000);
> + /* Wait for device chip access: 15ms in specification */
> + usleep_range(15000, 55000);
> return 0;
> }
> 






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

* Re: [PATCH v1 1/1] iio: pressure: dps310: Adjust Timeout Settings
  2023-09-06 14:55     ` Lakshmi Yadlapati
@ 2023-09-10 13:50       ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2023-09-10 13:50 UTC (permalink / raw)
  To: Lakshmi Yadlapati
  Cc: eajames@linux.ibm.com, lars@metafoo.de, joel@jms.id.au,
	andrew@aj.id.au, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Wed, 6 Sep 2023 14:55:25 +0000
Lakshmi Yadlapati <lakshmiy@us.ibm.com> wrote:

> Fixes: 7b4ab4abcea4 ("iio: pressure: dps310: Reset chip after timeout")
> 
> Thanks,
> Lakshmi
> 
Applied to the fixes-togreg branch of iio.git
Note I'll probably rebase on rc1 before sending a pull request.

Thanks,

Jonathan

> On 9/3/23, 6:52 AM, "Jonathan Cameron" <jic23@kernel.org <mailto:jic23@kernel.org>> wrote:
> 
> 
> On Tue, 29 Aug 2023 13:02:22 -0500
> Lakshmi Yadlapati <lakshmiy@us.ibm.com <mailto:lakshmiy@us.ibm.com>> wrote:
> 
> 
> > The DPS310 sensor chip has been encountering intermittent errors while
> > reading the sensor device across various system designs. This issue causes
> > the chip to become "stuck," preventing the indication of "ready" status
> > for pressure and temperature measurements in the MEAS_CFG register.
> > 
> > To address this issue, this commit fixes the timeout settings to improve
> > sensor stability:
> > - After sending a reset command to the chip, the timeout has been extended
> > from 2.5 ms to 15 ms, aligning with the DPS310 specification.
> > - The read timeout value of the MEAS_CFG register has been adjusted from
> > 20ms to 30ms to match the specification.
> > 
> > Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com <mailto:lakshmiy@us.ibm.com>>  
> Hi Lakshmi,
> 
> 
> This seems reasonable to me, but as we probably want to backport it to
> stable kernels, please could you figure out an appropriate Fixes tag.
> 
> 
> Fine to just reply to this email with the tag rather than resend.
> 
> 
> Thanks
> 
> 
> Jonathan
> 
> 
> > ---
> > drivers/iio/pressure/dps310.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/iio/pressure/dps310.c b/drivers/iio/pressure/dps310.c
> > index b10dbf5cf494..1ff091b2f764 100644
> > --- a/drivers/iio/pressure/dps310.c
> > +++ b/drivers/iio/pressure/dps310.c
> > @@ -57,8 +57,8 @@
> > #define DPS310_RESET_MAGIC 0x09
> > #define DPS310_COEF_BASE 0x10
> > 
> > -/* Make sure sleep time is <= 20ms for usleep_range */
> > -#define DPS310_POLL_SLEEP_US(t) min(20000, (t) / 8)
> > +/* Make sure sleep time is <= 30ms for usleep_range */
> > +#define DPS310_POLL_SLEEP_US(t) min(30000, (t) / 8)
> > /* Silently handle error in rate value here */
> > #define DPS310_POLL_TIMEOUT_US(rc) ((rc) <= 0 ? 1000000 : 1000000 / (rc))
> > 
> > @@ -402,8 +402,8 @@ static int dps310_reset_wait(struct dps310_data *data)
> > if (rc)
> > return rc;
> > 
> > - /* Wait for device chip access: 2.5ms in specification */
> > - usleep_range(2500, 12000);
> > + /* Wait for device chip access: 15ms in specification */
> > + usleep_range(15000, 55000);
> > return 0;
> > }
> >   
> 
> 
> 
> 
> 


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

end of thread, other threads:[~2023-09-10 13:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-29 18:02 [PATCH v1 0/1] iio: pressure: dps310: Adjust Timeout Settings Lakshmi Yadlapati
2023-08-29 18:02 ` [PATCH v1 1/1] " Lakshmi Yadlapati
2023-09-03 11:53   ` Jonathan Cameron
2023-09-06 14:55     ` Lakshmi Yadlapati
2023-09-10 13:50       ` Jonathan Cameron

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