Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp508478rbb; Sat, 24 Feb 2024 09:55:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVKocaIfItLr2ppupu3bbvHEHXtNmEUufqKgj0E2/Z7ePr8b1CfVztjLxlRtgS2rgKi5s3i3Rvk+H8BtkNB9pH1i2P3hLF0Pi81XWXP3A== X-Google-Smtp-Source: AGHT+IGd25H0OfnkzQMM0cD+bJg+WzcnPWgJku/xtEQImIqp6tcsaYcAnhP7V7VLl6+HUx2HEnxv X-Received: by 2002:a05:620a:907:b0:785:ce02:4f82 with SMTP id v7-20020a05620a090700b00785ce024f82mr3245999qkv.17.1708797320371; Sat, 24 Feb 2024 09:55:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708797320; cv=pass; d=google.com; s=arc-20160816; b=GyZrYzSQ/IJoWvFcy8RDub9Be13Ng7nLIpFhnVXM07MP96gDI5oOUT2oNOSYTcPU6O F41wuEgYZGujkYlUYpzZILbfTlbSFcLR/HdEz+qZBrSG2oz0xsQD0KQHezEyatfQvUfy j+JNob4HEgafuWkIyA1XbQswMTHvQvYTCq3/rL1QsihKXu+hT7iG16IdIdgBooGVeYxI ElUQznv1Tm39J2xnpzTfXTPM5nL0yJ+0pImo+19FiXV+C8olLTGj+MYlN6EZ9CFnbEJA BV5xDzaQ2yKOe1mBe+7nabsb9VNSjZUdA/8IuB21N9fNJ+HM/KJLL5rlKmEVrqr9KuNA XQ1A== ARC-Message-Signature: i=2; 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=vC2stuS6i/eoeJlmyLUaabV4LH4Q0eEBYEzlIE/NhBI=; fh=tiWpGOWnvkBH5P4yX7C5Utk1xTotOznW//JUpMO1/OY=; b=Ayl3hN1YyUrRgSIMf+rXBdh38dTiFa8uRMCol/TYx2zHZA7IbmXvPW66gyFezG5Hiq CfwUqYP6d0wYkUHlUjDl8gchvsm3ztQ6uh+NGkaZvew8ZLVN9ZGUk86PeBJToT1LQkTv UJYzDz9p2YWksEsYbaXhxdnF0fU1kC+wOMr73M6L/sD+kQAvXQ+lhzqiFd6t9gnf/Z2a 1CTTQxJaV2Njoxxu+ND6AYe5xhaEnUAFJs2JnytO/Dtat0zasGHRxdbvtHzDXCNKesCd bLgj7rvx0V3dORDauIOwTYym5+595rLjlSM3mU/gcqeZieMk0STQ6e8gFd6BsmT45XSo ri1w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hfYKydJB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79774-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79774-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x13-20020a05620a0ecd00b007873e404d2dsi1480861qkm.348.2024.02.24.09.55.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 09:55:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79774-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hfYKydJB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79774-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79774-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 3E6DD1C20EB8 for ; Sat, 24 Feb 2024 17:55:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88718482DD; Sat, 24 Feb 2024 17:55:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hfYKydJB" 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 A907D45030; Sat, 24 Feb 2024 17:55:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708797306; cv=none; b=mSJ96atme+B7kcYTh6PK7E+n9m7Kv4hTYeLWXI4UJkMgthYmEgoIqFEpHJWj2bVO8yDu1voy8xFGF5rAbitlTOOJG+3ZaOXTjg9EqtUa8/KNM4Gh8+wSr7c1ZYipT+ccrlidvPOzbhlUS8b+lxbG0gOUlOMC93aW6nf9d3R/IDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708797306; c=relaxed/simple; bh=+U3p6XWhKPzjcH7Ryeh4baGD5MBCZbaDNuBKMlXSTiY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GexZAxFEipFhs8n6i4vnfOjg+YgxPsGzRiOqmiLmhrytfgvxlldKr+KQoaMqQs9eQB42/F9LQ+qooHwZ0IlCmEZCGdQemnm3Rq44FuWA9i1KVZI2jUzZs+SyTReBd5JmEkEl7W/5OkEDdEqkZbyK2cSWwrPxVpP1sJTgKWclSxU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hfYKydJB; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84DB7C433C7; Sat, 24 Feb 2024 17:55:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708797306; bh=+U3p6XWhKPzjcH7Ryeh4baGD5MBCZbaDNuBKMlXSTiY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hfYKydJBIyHctRmSVuD74MPe0Z6ZiutZnZUXuyuAY327y1buIlBjT8cAKXdzXrmYl KCpLlG2ySbaIcRPkgks+h0AjlvmwDWIAzqF1Va879cXgW9Tl4qSXYZwJYpyp2Sv5ls V6fLg4I5UAhjSGvxdhGsl1JfyxDrDBziiF9HwXrJmzXd0JOqG8TQWgpSc2nShKzaiJ PwWrby8wu2SKHAZZ47+OuRR77nMNAK6SQ3/ZinLrkpKC8JuTiVaUIYFxKmkKhWhvVp 1zPRshqqJszVHHNUFzmrm3A9mdOToAYP/USWka0v/1OPEHbtrQKQ5ZSX2t+FtGpM9e EiHoZ0g20o/CA== Date: Sat, 24 Feb 2024 17:54:48 +0000 From: Jonathan Cameron To: Nuno =?UTF-8?B?U8Oh?= Cc: Dumitru Ceclan , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Ceclan Dumitru Subject: Re: [PATCH v5 5/5] iio: amplifiers: hmc425a: add support for LTC6373 Instrumentation Amplifier Message-ID: <20240224175448.484ccd10@jic23-huawei> In-Reply-To: References: <20240220153553.2432-1-mitrutzceclan@gmail.com> <20240220153553.2432-6-mitrutzceclan@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; 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=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 21 Feb 2024 14:23:51 +0100 Nuno S=C3=A1 wrote: > On Tue, 2024-02-20 at 17:34 +0200, Dumitru Ceclan wrote: > > This adds support for LTC6373 36 V Fully-Differential Programmable-Gain > > Instrumentation Amplifier with 25 pA Input Bias Current. > > The user can program the gain to one of seven available settings through > > a 3-bit parallel interface (A2 to A0). > >=20 > > Signed-off-by: Dumitru Ceclan > > --- =20 >=20 > Just one minor comment. With that: >=20 > Reviewed-by: Nuno Sa >=20 > > =C2=A0drivers/iio/amplifiers/hmc425a.c | 124 ++++++++++++++++++++++++++= ++++- > > =C2=A01 file changed, 120 insertions(+), 4 deletions(-) > >=20 > > diff --git a/drivers/iio/amplifiers/hmc425a.c b/drivers/iio/amplifiers/= hmc425a.c > > index 77872e2dfdfe..50c86c2d28d7 100644 > > --- a/drivers/iio/amplifiers/hmc425a.c > > +++ b/drivers/iio/amplifiers/hmc425a.c > > @@ -2,9 +2,10 @@ > > =C2=A0/* > > =C2=A0 * HMC425A and similar Gain Amplifiers > > =C2=A0 * > > - * Copyright 2020 Analog Devices Inc. > > + * Copyright 2020, 2024 Analog Devices Inc. > > =C2=A0 */ =20 >=20 > ... >=20 > >=20 > > =C2=A0 > > +static ssize_t ltc6373_read_powerdown(struct iio_dev *indio_dev, > > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uintptr_t private, > > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 const struct iio_chan_spec *chan, > > + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 char *buf) > > +{ > > + struct hmc425a_state *st =3D iio_priv(indio_dev); > > + > > + return sysfs_emit(buf, "%d\n", st->powerdown); =20 >=20 > Well, in theory the read should also be protected with the lock... Only reason I can think of for that is potential read tearing. If that happens on a bool we are going to be in a mess so I think this is in practice fine without, though paranoia might suggest locking. It can race against it being powered down but that effectively happens even if we do have a lock as we either see the value before or after a racing power down event and we have no way of knowing which. Applied rest series to iio.git togreg branch and pushed out as testing. Duitru, if you can figure out what happened to your message thread before sending more patches that would be great. The IDs for patches 0-5 go 20240220153553.2432-1-mitrutzceclan@gmail.com 20240220153553.2432-3-mitrutzceclan@gmail.com 20240220153553.2432-5-mitrutzceclan@gmail.com 20240220153553.2432-2-mitrutzceclan@gmail.com 20240220153553.2432-4-mitrutzceclan@gmail.com 20240220153553.2432-6-mitrutzceclan@gmail.com Which really confuses my email client and patchwork. https://patchwork.kernel.org/project/linux-iio/list/?series=3D827901 >=20 > - Nuno S=C3=A1 >=20