Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2898735rdb; Tue, 26 Dec 2023 08:35:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJ3TWe51aQTYJ2H0OfYutoRmt4PJmFp2CKeW4lgR9W2bUy/5Dklf4DHkfuARYNTzaLCjID X-Received: by 2002:a05:6808:3009:b0:3ba:205d:452 with SMTP id ay9-20020a056808300900b003ba205d0452mr3366881oib.92.1703608534117; Tue, 26 Dec 2023 08:35:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703608534; cv=none; d=google.com; s=arc-20160816; b=jGg+1q283ehhj4FbI+5uqpFFzzJFRxRupw/TOpEUcG6N3E1uHzFRtWCJuZo06rjoXx Hqs70AJ2E9L6Qec91i431acVRn1GzrqjWQ1OG6jEY9XcJKFu8Z2RoKBOWqLx8h+Tv5l3 MZRcfogkzjv+0C1Vf3qeXsULB1Z9UN9tEpV4mToTXEmQ/djevY5OI20aJJVl1NSONP/v 7M4D87ZxlAuw6Bu6+5EAXgpe5n0MpCax1H+YjYDjbXJw0rQocEoWgjkr/3IjC9s38E19 V9YARXUUn7qQu02AD86ndE+DKVWzCysHQB7DcS+ylztIifiY7nKOvVv0B9DbkaCgKoOx qXfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=TvpbEhBVa+Ng3uJXbVtmOqnvITLF76s970/0nec0ruk=; fh=IZEyg1r7+rdpYIMPOyKgmlT60DbvHqug0Qte+ho+yjw=; b=LRLl2hSNDrKGt28vyLWaDxUSHsxJPeEeQUVOL5LCEn5ca7cfGZkUEJcimVjLjOmIr+ O93yn4yCO4St1kgmQzk1C3S/VBCV83b7StU3frgYPBTjkaHLj4ZkEuCMsSx9GrvvmNcW 73ZPnPXhJKFY9FPguY36i5B8DuV7vDPQIBUToszT4sd9UeG0cFpi4y6rGQqj6T38f6zl Ksc+j31vf0M782D/DvBECnERfQgMkZtgHR1muo0RA4ilRBuEU+X8XujZiXzQ0VFWIDIX jsBVIfklNsrxYNxsIpUPpzWuX0SneC2cTZcAAdIun52j73CLlcM1h9N7GGAGr1D+EDZt kriw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qU0afQX2; spf=pass (google.com: domain of linux-kernel+bounces-11580-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11580-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i8-20020a0cf388000000b0067f05c6db51si12929191qvk.8.2023.12.26.08.35.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 08:35:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11580-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qU0afQX2; spf=pass (google.com: domain of linux-kernel+bounces-11580-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11580-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CA2B61C21E64 for ; Tue, 26 Dec 2023 16:35:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B12874F61A; Tue, 26 Dec 2023 16:35:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qU0afQX2" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3CF84E62B; Tue, 26 Dec 2023 16:35:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AE6BC433C8; Tue, 26 Dec 2023 16:35:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703608526; bh=eQYBKPZRfkap6n/EQtNAG9M1zkBqA9OiFJTqFAY3ArA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qU0afQX2PMLo95iQO9fa66xXjP/sQosCpZy+I4nl+iPs+ga2C0TQBcUM0/ohGlq/k Jy/efDmCJMK71LAJRulxFv2cZutOAIQs9D6p2w/CuMCsWmpeP2vjR3zTmSo22HBWUw PzRPIYLm7gbK5u670fPac03bsWVvpCTc72JRcNtINiAX4hdIAE/PTxG/UcdoQM24l4 jsHH1ucT/lxVzTcaw5kwzdXK0X6r1ISFdjRVmjUKkKdh6tIkoEo99JigI0tCKX+4e+ erCWjGUnbynpdXUMVw9n6Nfqo/Lu2yCUSdMywbTMtMoBAqkoksNg32SVXs3/615AQs km5cy71umj/ew== Date: Tue, 26 Dec 2023 16:35:18 +0000 From: Jonathan Cameron To: Petre Rodan Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Andreas Klinger , Lars-Peter Clausen , Andy Shevchenko , Angel Iglesias , Matti Vaittinen Subject: Re: [PATCH v2 05/10] iio: pressure: mprls0025pa.c fix error flag check Message-ID: <20231226163518.63a8690b@jic23-huawei> In-Reply-To: <20231224143500.10940-6-petre.rodan@subdimension.ro> References: <20231224143500.10940-1-petre.rodan@subdimension.ro> <20231224143500.10940-6-petre.rodan@subdimension.ro> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 24 Dec 2023 16:34:50 +0200 Petre Rodan 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 > Signed-off-by: Andreas Klinger 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 > >