From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 29F6FC4332F for ; Tue, 18 Oct 2022 11:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MNlQ6nkaubexeMn8m3EL2WTni2rqzUO4TqnU3D8RmV0=; b=Y3RpKPx8li/yOHtyU0LeIKbri+ On5wSy5WsIKX2eLN7S5GWNhzsqfUmze6q7yROjSNpys7IuqBZgIIPlIOjX5NWJtvjrIipS3FFWSbs BB6BuUQ79dkJ9B3/PwoGNPUMJmhwO1aRufrgor8Uy8a/nYXCEPGV3+MFfYDfmM1m4EZH9sHpVz3bs xdvNnKB5WBkW4GRaciXsX5QLssGM2lbX3Z7v9mBJhpisWE66FgxGaPp0L4ZiVxxRAgSGz69KCUBzn cv0rnEOC2hvIuAEiKBcZFY/oB2ggUPnuSfVzEgjfGTnExM4nJGlorRs2GmIXDUoicqHrqTrnQt9CK 1BlBNifA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1okl4D-006EHL-5H; Tue, 18 Oct 2022 11:47:29 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1okl4A-006EB5-K0 for linux-arm-kernel@lists.infradead.org; Tue, 18 Oct 2022 11:47:27 +0000 Received: by mail-qk1-x734.google.com with SMTP id a18so8434900qko.0 for ; Tue, 18 Oct 2022 04:47:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=bsd5fpiiECl8GkpGndwni0gwXZ9Ol1u7EJ2OjmdejwQ=; b=hIuc7OIiVe9rdm5/L9WY7R+JlPSWaZSeEDydFnhRf9FRUgExwzch/y6yOecvKiX8n7 CAv3C019YCgSODUbQA4cRt1xw5gavlpTegHTJ0FTtJEceJWG8Ep49ZgrD9ZzkTzuTF7Z eKGHvjrJPx3bCAvvhHYUVMEG6qIdHGQxxnFLOufYvhk5IItwLtReKYwraq74/jPz8gsT 7qSIUh/slGV3VNn7c8RzLPUnN/KmoPdfPVcKvdo89IcAb+HL9Eg+lqQ9DBoFM1q1Q1/e 4JXv77kPZilR7fgPIPDsdcxPTWkZYUMkVx2v6HZ86pVVNkG9NO9jAjAdBrpqqgPODLQg KTfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=bsd5fpiiECl8GkpGndwni0gwXZ9Ol1u7EJ2OjmdejwQ=; b=XHbq4qFQelt8t+HAsI7AwwGggVCodQxqn5JIMGCJ4VbDQ/f/gZJBZFjH2C6cmPl9ch lu27ekRRxCBDqJO1oAbdWEdBeRoOCyymp07n+InNrlf3QZMtHvb9TvXK6CMoeXOo36PP UJ1k9sitIm3SsspY0ks5ymIf8n+dZ20mO5Dkle+/PKgg8SRcyx6D0iUXHbogUdKl+OBe yipUJqYYU75th/To3Zn/615lSbFbaZeNXOvcKPs9YYlzKth28kv33I1sKUN8FI4Q6HPO srbNnDXucF0oR74Ii8pEaTGlLXODqJzUMj0iZSlxupkrE6alF+VW/JjNjauMC5N3fkcL IajQ== X-Gm-Message-State: ACrzQf0DNHINGc2EHq8fp/KlcvyULrb/hDMlgimpcdrl6FuoiBly51lR rLD85Qklink32ggjR7eWby0/ZPrUe4cfoA== X-Google-Smtp-Source: AMsMyM45wI+u8adKJ5m31AvK3ziypY3lkj4vAfPsDp6HG5t06mNyedOqgAWBgW77MigzQbjGU61nPA== X-Received: by 2002:a05:620a:4385:b0:6ee:7b48:202e with SMTP id a5-20020a05620a438500b006ee7b48202emr1505033qkp.306.1666093643651; Tue, 18 Oct 2022 04:47:23 -0700 (PDT) Received: from fedora (69-109-179-158.lightspeed.dybhfl.sbcglobal.net. [69.109.179.158]) by smtp.gmail.com with ESMTPSA id dt27-20020a05620a479b00b006b9c9b7db8bsm2292195qkb.82.2022.10.18.04.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 04:47:22 -0700 (PDT) Date: Tue, 18 Oct 2022 07:47:20 -0400 From: William Breathitt Gray To: Kamel Bouhara Cc: linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org Subject: Re: Handling Signal1 in microchip-tcb-capture Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221018_044726_681348_ABF513A0 X-CRM114-Status: GOOD ( 22.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0999383067812766288==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0999383067812766288== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iGMyhWSEA3XDf/Z/" Content-Disposition: inline --iGMyhWSEA3XDf/Z/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 18, 2022 at 10:01:49AM +0200, Kamel Bouhara wrote: > On Mon, Oct 17, 2022 at 05:57:59PM -0400, William Breathitt Gray wrote: > > It might be nice to expose the channel 1 revolution value as Count1 at > > some point in the future. However, channel 1 seems unrelated to the > > current issue we're dicussing so we can avoid it for now. >=20 > OK do you suggest to read both count values in the same mchp_tc_count_rea= d() ? Yes, you can differentiate between the requested Count by checking count->id. So for id 0 return the channel 0 value, and for id 1 return the channel 1 value. > > By the way, I suspect there are race conditions present in > > mcho_tc_count_function_write() that could be resolved by adding a lock > > to the mchp_tc_data structure and acquiring it before accessing the > > device state and registers. It's unrelated to the Signal1 issues so I > > haven't looked any further into it, but it's something you might want to > > investigate to make sure you don't get weird behavior from the driver. > > >=20 > You mean between function_write() and action_write() ? Those are the callbacks that stood out immediately. For example, it's possible that these functions are called concurrently, resulting in a race where qdec_mode is initially evaluated as true but changes to false before action_write() completes; or similarly, the regmap operations in function_write() could be clobbered by if another call is happening at the same time. William Breathitt Gray --iGMyhWSEA3XDf/Z/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQSNN83d4NIlKPjon7a1SFbKvhIjKwUCY06SSAAKCRC1SFbKvhIj K3FeAQDrKsnuKzIaclPrjEvb2n3pl5Mu1nCtW5SuMup7sJBZOQD+JxxoZb2rU91K 2+KOyXv5zK2cXwLZ2A86IvoqhNRBpwE= =vwhC -----END PGP SIGNATURE----- --iGMyhWSEA3XDf/Z/-- --===============0999383067812766288== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============0999383067812766288==--