Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3602975rwl; Sun, 2 Apr 2023 11:00:29 -0700 (PDT) X-Google-Smtp-Source: AKy350Yuxcrhesa3Vtf/omCGYgWdPTp0P0QAIaQkMvFuFteqoxYSA6QaegRoNc0IqH4W0W/6lral X-Received: by 2002:a17:90a:193:b0:23b:89df:4cf4 with SMTP id 19-20020a17090a019300b0023b89df4cf4mr37803320pjc.42.1680458429130; Sun, 02 Apr 2023 11:00:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680458429; cv=none; d=google.com; s=arc-20160816; b=kn5J6O+C/N+PAIfhnNlmVNfWkCl5A1DB8ZsCYIzZMt0mWjHLbBMv4XyCUte6rDDAmz hxsFNhFq+e1H+dCLydNOpcjIJ1abU1qo1eJDn8XyVQ8RmwZ9bTFUbyvMMK5akhR5q5d/ TiODq8mOL9BJIfmAOqOy7nYaXrDaYJuqHHmjzq5gRUueyncEviOBcpwK5MvrQ0n6Eu8n Jg0rt5ZC3hpzr35cI7/ACAZQNobQ34isqJRKAml6SuHMAOLZf+/7tLr8WuLQ2k18koS+ elXQejsv4V5Re8GTTBS7NcXCzJtq15e5d8Fg/J8/VIvbrc76j5U/iuzEzL3Nzd4mtj5t 4rFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NJpTsvE1EuL9/USYXCTsI8NfHm4n9LB4JRYujq1u5b8=; b=k7fDawOyplCQpVkXCFbL/E4LS2sJEWKprDYoov2EJHLtmEfAXsCOWxutVEp5KwFZFy GlvkAPfUnnBSL/kMueD+wlrs4Q7BAmdfQnyLxZ1zPqbE+U9FBYxM9ew2sn8WVKbuE/Rj bojTu427UxJQjB0+h/rEWT9wAFg4gQIgYXGV0Lbjkdne/I0Exp/NK6l2oiE1Fogbm8Mh yj9tM8CD2WkVZUASx3cChuQUQHPJObgrwpIj0Zn+Jdln5DDddwAHeArPh3TW/DzJZuZa wcz4d2GgOHUBnqQgrMkFbwf2hRgiwWPqjENi81hymbjGiDKEmLEqRWrzwTikhFok0zTg l6Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lIOyUIFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i11-20020a655b8b000000b00503015b772asi6780705pgr.743.2023.04.02.11.00.17; Sun, 02 Apr 2023 11:00:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lIOyUIFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229459AbjDBRkz (ORCPT + 99 others); Sun, 2 Apr 2023 13:40:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231160AbjDBRky (ORCPT ); Sun, 2 Apr 2023 13:40:54 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 866DBCC23 for ; Sun, 2 Apr 2023 10:40:52 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-5416698e889so512127857b3.2 for ; Sun, 02 Apr 2023 10:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680457251; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=NJpTsvE1EuL9/USYXCTsI8NfHm4n9LB4JRYujq1u5b8=; b=lIOyUIFZXVU085qpGi3Cz3gY+GJ4NrjN6YPjm6oq9gCAThs3IG45H1VZy/xisolQfc /QqAJZNvEe3cUufI8ec4AwifJnVvZ8pDglYS1mo23C6tTMmNfSCllM5T0816UtUmM74j cnjvM6NZonAR3oyQbksvqoLs1BxXtrS1iA3yX8/G7QO12wfsWjOyj/KWyl613R6RqS+P Afwmo0+nQaOh/iPDwMfPJiYhe1dDQxU9UVqcgYxKSUKsUfqwfjSUHzJ7zwm5ywnhLmtR 6R6sBCxkQ4IHzkxFtGQBjeh6H/CFw6liaiKutHmqw2l5sPvBc1KE2UFDhElGBnfnPZfS +YDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680457251; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NJpTsvE1EuL9/USYXCTsI8NfHm4n9LB4JRYujq1u5b8=; b=r8fPKvUq0tpjo7+6jA9v39YpdobQY7GaPIUsWebJfHGZ000rxLheYUQ0h1h9fA4Dq7 cdaqnwLM93YLl+z09CTSv+AHkns2tEC15fCRf+W/WFOBouCp+yarxEaXZjz5eV7ClNvl /ydgh6bbCfNDoSesG37FGqCkNzxfQWNt4FZ5hvaF4rOCzJVoevTvJEFGm1BlNMbtx6/M +fd6caKxmwm0S0nrogJZh8GqGBe0JmNc0seiTKamUVlv8lCP20RL1iXkizaNrD9ng9ej s9+vo8ph0LTEP8cGTu/zk8u1HUT6Q/KQxwoudpWUvetqQ8vz7MvJjWxe6PhiM4E6+u/J oPXg== X-Gm-Message-State: AAQBX9fmMv/RfeIgQtETvBlii0B8YV0fMO+nIgDzcvAlKHvsfYGS3r6s Q4qMcfZ2M2/3fEpTqPojVIRifQ== X-Received: by 2002:a0d:d505:0:b0:541:7193:e136 with SMTP id x5-20020a0dd505000000b005417193e136mr31935308ywd.23.1680457251476; Sun, 02 Apr 2023 10:40:51 -0700 (PDT) Received: from fedora (69-109-179-158.lightspeed.dybhfl.sbcglobal.net. [69.109.179.158]) by smtp.gmail.com with ESMTPSA id q65-20020a819944000000b0054601a8399csm2017755ywg.119.2023.04.02.10.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 10:40:50 -0700 (PDT) Date: Sun, 2 Apr 2023 10:51:19 -0400 From: William Breathitt Gray To: Jonathan Cameron Cc: Andy Shevchenko , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] iio: addac: stx104: Migrate to the regmap API Message-ID: References: <4ebc1b6b609a086846420954b893e914fd395384.1679867815.git.william.gray@linaro.org> <20230402174657.55159879@jic23-huawei> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yEXAaY2iei/+iClt" Content-Disposition: inline In-Reply-To: <20230402174657.55159879@jic23-huawei> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --yEXAaY2iei/+iClt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 02, 2023 at 05:46:57PM +0100, Jonathan Cameron wrote: >=20 > > > > + .wr_table =3D &aio_ctl_wr_table, > > > > + .rd_table =3D &aio_ctl_rd_table, > > > > + .volatile_table =3D &aio_ctl_volatile_table, > > > > + .cache_type =3D REGCACHE_FLAT, > > > > +}; =20 > > >=20 > > > Do we need regmap lock? =20 > >=20 > > I think the regmap lock is opt-out, so I don't think we need to set an > > custom lock callback for the regmaps in this driver. > >=20 > > Jonathan, do read_raw() and write_raw() require explicit locking? >=20 > The don't provide their own locking. Depending on the access pattern the > underlying bus locking may be sufficient. If you have read modify write > cycles though you'll want locking at the appropriate level for that > which might well be at the level of regmap. >=20 > Jonathan If read_raw() can be called concurrently multiple times then we risk changing the ADC channel while the analog-to-digital conversion is in progress, thus resulting in an incorrect reported value. Looks like we'll need an explicit lock for this after all, so I'll create a precursor patch addressing that. William Breathitt Gray --yEXAaY2iei/+iClt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQSNN83d4NIlKPjon7a1SFbKvhIjKwUCZCmWZwAKCRC1SFbKvhIj KwOXAQCxIk2C5V1TsQ/IO+hSQKNUJQofrl9yPD5Cj7Hqhm8krAD+LwqxOaNPKZ86 T4S/v73bD/2MaFkSBaC1sEQcyfSBqA4= =jsa1 -----END PGP SIGNATURE----- --yEXAaY2iei/+iClt--