Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Petre Rodan <petre.rodan@subdimension.ro>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Andreas Klinger <ak@it-klinger.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Angel Iglesias <ang.iglesiasg@gmail.com>,
	Matti Vaittinen <mazziesaccount@gmail.com>
Subject: Re: [PATCH v2 05/10] iio: pressure: mprls0025pa.c fix error flag check
Date: Tue, 26 Dec 2023 16:35:18 +0000	[thread overview]
Message-ID: <20231226163518.63a8690b@jic23-huawei> (raw)
In-Reply-To: <20231224143500.10940-6-petre.rodan@subdimension.ro>

On Sun, 24 Dec 2023 16:34:50 +0200
Petre Rodan <petre.rodan@subdimension.ro> wrote:

> Take into account all 3 error flags while interacting with the sensor.
> Based on the datasheet, in table 14 on page 14, the status byte
> contains:
>     bit 5 busy flag - 1 if device is busy
>     bit 2 memory integrity/error flag - 1 if integrity test failed
>     bit 0 math saturation - 1 if internal math saturation has occurred
> 
> Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
> Signed-off-by: Andreas Klinger <ak@it-klinger.de>
I've not problem with the patch, but the 'fix' in the titles means this should
have a fixes tag. I'm not sure that improving the resilience to device errors
is something we count as a fix however.  Maybe more of a feature or improvement
in which case don't say fix. 
Also, drop the .c in the patch title to be inline with similar patches in IIO.

Thanks,

Jonathan

> ---
>  drivers/iio/pressure/mprls0025pa.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/pressure/mprls0025pa.c b/drivers/iio/pressure/mprls0025pa.c
> index e3f0de020a40..233cc1dc38ad 100644
> --- a/drivers/iio/pressure/mprls0025pa.c
> +++ b/drivers/iio/pressure/mprls0025pa.c
> @@ -39,6 +39,8 @@
>  #define MPR_I2C_MEMORY	BIT(2)	/* integrity test passed */
>  #define MPR_I2C_MATH	BIT(0)	/* internal math saturation */
> 
> +#define MPR_I2C_ERR_FLAG  (MPR_I2C_BUSY | MPR_I2C_MEMORY | MPR_I2C_MATH)
> +
>  /*
>   * support _RAW sysfs interface:
>   *
> @@ -213,7 +215,7 @@ static int mpr_read_pressure(struct mpr_data *data, s32 *press)
>  					status);
>  				return status;
>  			}
> -			if (!(status & MPR_I2C_BUSY))
> +			if (!(status & MPR_I2C_ERR_FLAG))
>  				break;
>  		}
>  		if (i == nloops) {
> @@ -233,7 +235,7 @@ static int mpr_read_pressure(struct mpr_data *data, s32 *press)
>  		return -EIO;
>  	}
> 
> -	if (buf[0] & MPR_I2C_BUSY) {
> +	if (buf[0] & MPR_I2C_ERR_FLAG) {
>  		/*
>  		 * it should never be the case that status still indicates
>  		 * business
> --
> 2.41.0
> 
> 


  reply	other threads:[~2023-12-26 16:35 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-24 14:34 [PATCH v2 00/10] changes to mprls0025pa Petre Rodan
2023-12-24 14:34 ` [PATCH v2 01/10] dt-bindings: iio: pressure: honeywell,mprls0025pa.yaml fix Petre Rodan
2023-12-25 12:55   ` Krzysztof Kozlowski
2023-12-26 16:28   ` Jonathan Cameron
2023-12-26 16:31     ` Jonathan Cameron
2023-12-27  7:11     ` Petre Rodan
2023-12-30 11:28       ` Jonathan Cameron
2023-12-24 14:34 ` [PATCH v2 02/10] dt-bindings: iio: pressure: honeywell,mprls0025pa.yaml add pressure-triplet Petre Rodan
2023-12-25 12:57   ` Krzysztof Kozlowski
2023-12-25 13:23     ` Petre Rodan
2023-12-25 13:34       ` Krzysztof Kozlowski
2023-12-25 13:37         ` Krzysztof Kozlowski
2023-12-25 13:58         ` Petre Rodan
2023-12-24 14:34 ` [PATCH v2 03/10] dt-bindings: iio: pressure: honeywell,mprls0025pa.yaml add spi bus Petre Rodan
2023-12-25 12:59   ` Krzysztof Kozlowski
2023-12-25 15:13     ` Petre Rodan
2023-12-25 18:56       ` Krzysztof Kozlowski
2023-12-25 20:29         ` Petre Rodan
2023-12-26  9:38           ` Krzysztof Kozlowski
2023-12-24 14:34 ` [PATCH v2 04/10] iio: pressure: mprls0025pa.c fix off-by-one enum Petre Rodan
2023-12-26 16:33   ` Jonathan Cameron
2023-12-27 16:30   ` Andy Shevchenko
2023-12-24 14:34 ` [PATCH v2 05/10] iio: pressure: mprls0025pa.c fix error flag check Petre Rodan
2023-12-26 16:35   ` Jonathan Cameron [this message]
2023-12-24 14:34 ` [PATCH v2 06/10] iio: pressure: mprls0025pa.c remove dangerous defaults Petre Rodan
2023-12-26 16:39   ` Jonathan Cameron
2023-12-24 14:34 ` [PATCH v2 07/10] iio: pressure: mprls0025pa.c whitespace cleanup Petre Rodan
2023-12-27 16:34   ` Andy Shevchenko
2023-12-27 17:39     ` Petre Rodan
2023-12-30 11:33       ` Jonathan Cameron
2024-01-06 14:03       ` Andy Shevchenko
2023-12-24 14:34 ` [PATCH v2 08/10] iio: pressure: mprls0025pa.c refactor Petre Rodan
2023-12-26 16:49   ` Jonathan Cameron
2023-12-27 14:33     ` Petre Rodan
2023-12-27 16:37       ` Andy Shevchenko
2023-12-30 11:34         ` Jonathan Cameron
2023-12-24 14:34 ` [PATCH v2 09/10] iio: pressure: mprls0025pa.c add triplet property Petre Rodan
2023-12-24 14:34 ` [PATCH v2 10/10] iio: pressure: mprls0025pa.c add SPI driver Petre Rodan
2023-12-26 16:51   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231226163518.63a8690b@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=ak@it-klinger.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ang.iglesiasg@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mazziesaccount@gmail.com \
    --cc=petre.rodan@subdimension.ro \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox