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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51490C433F5 for ; Mon, 27 Sep 2021 10:23:34 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 16CE060F6D for ; Mon, 27 Sep 2021 10:23:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 16CE060F6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=f36YabsBX4sLWFFxERgpLVsNzMqwDovFoHYl8mG9wUI=; b=W28LhShbg6Xd0o5diNVKo7wPR+ O+ELntmCpLjptOH7YPiPnOAkTnT5qTzL2zmi/lnnjPRTILmaKAHBdOARJMV/IB8vrr0rrrWMAwND+ tik4oPJoU1hhbtulgJuSaQCZzZTLao2PXs+524jzVFODtRp+6J+SNb+oGizfZU0szpuwnOgYaSGlw C+7cUK3I04/BqkTdQhYDa2w5Q6/aIv7wMee/a8LST7YQ7kcPbnbxFyFHyVs67TRqw1a/3kQAnONfZ TLUkBSi6AGHDHh5B0t+UaNB2dwUyjCDPlALUhmJD1/jUIgczAfZzLVSS3OuVfAh4WWwbmV2eFRwcD LKRUX+tQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUnlN-002HIw-Qz; Mon, 27 Sep 2021 10:21:34 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUnlJ-002HHj-Tv for linux-arm-kernel@lists.infradead.org; Mon, 27 Sep 2021 10:21:31 +0000 Received: by mail-pl1-x62a.google.com with SMTP id bb10so11460237plb.2 for ; Mon, 27 Sep 2021 03:21:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=G41HQyC4+WAMCW41WRWgfTs873BjVCWlDt89o58/vJo=; b=nBvTmXHxczG2DYg0EHyY/hzUWZIDU3s2oS4w+YfnM+0pIir8EFPTbTo82sCJT8PfjN jyamCnBGef6XaxzAhChbONRX7Drov0h3n5mUyw8nfTVLdm3BJGQnvcJx5oSbG0nKJpS7 cbas5jd76l09vVxaBrm3RRUmdCn/amsS7Ml/stTzMVFsuKqo2A2d7aRT1LKR6EEFQTA7 NhBknNwmgEf8cgZpDEDY2AwaFU8A5leRTWGWaMBeAaldoTk9qlghzAoKob0iHQzRjOae Lyxa4o42bKdxCCcDM5wDkziUcQ+qcruKSKOiSq1k87EUAjRJ542XOrfqtTDELEyLhz0v ZZgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=G41HQyC4+WAMCW41WRWgfTs873BjVCWlDt89o58/vJo=; b=I3n+cBFsZA39ThnjzWZIDebu4zxx7WqdnL6krEEZzGgFKGYE3FxAI9UalmFtxDypmq +TRYn4HZpBDaO1fWV1pSh5ZAY/hm0hokuoS1NYf1HGzOU0inr9nNpk2wkh97JioEcOHm Mgk8sLP+3jpwus0r8Lg7bEV+YuPTnW8jE6VYdMwCQxH/HmFAZl/4WdEy++4iL9cufMUX Bk85NSXnFQreR6WcQh7FpqZbjlvoUyWDNsAPHr1bYlihesDSRNtgagfvpOiyGuDSOuK7 CTVhqpIBZJl3ql8UI1blD7tXGohLV1rRnypB0p2Wq9w1tB1VDIVw3RRqFN3MhS20lAG1 gWOQ== X-Gm-Message-State: AOAM530l+6Z5TxoSI9tffSgTHGgCQoadl6UaTlrAmlDD7VCf8fTS+FhO BTN3Mu2yyP5rBFG4fzudqAQnNyuSGws= X-Google-Smtp-Source: ABdhPJxK/GBjVs9Jg8V3mVZtN087n4n1ZFvm9LTibJZB6JAYGORREsIdHZXnK4+rdlB/+gNpTqGQaQ== X-Received: by 2002:a17:902:7783:b0:13d:fee6:8095 with SMTP id o3-20020a170902778300b0013dfee68095mr12083247pll.7.1632738087193; Mon, 27 Sep 2021 03:21:27 -0700 (PDT) Received: from shinobu (113x37x72x25.ap113.ftth.ucom.ne.jp. [113.37.72.25]) by smtp.gmail.com with ESMTPSA id q18sm16574471pfh.170.2021.09.27.03.21.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 03:21:26 -0700 (PDT) Date: Mon, 27 Sep 2021 19:21:17 +0900 From: William Breathitt Gray To: Jonathan Cameron Cc: linux-stm32@st-md-mailman.stormreply.com, kernel@pengutronix.de, a.fatoum@pengutronix.de, kamel.bouhara@bootlin.com, gwendal@chromium.org, alexandre.belloni@bootlin.com, david@lechnology.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, syednwaris@gmail.com, patrick.havelange@essensium.com, fabrice.gasnier@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, o.rempel@pengutronix.de, jarkko.nikula@linux.intel.com, Dan Carpenter Subject: Re: [PATCH v16 07/14] counter: Add character device interface Message-ID: References: <422c765c91d060cdebc4f17f7aeb255d9c1a4e16.1630031207.git.vilhelm.gray@gmail.com> <20210912171821.54af145b@jic23-huawei> <20210926161542.5cf99b58@jic23-huawei> MIME-Version: 1.0 In-Reply-To: <20210926161542.5cf99b58@jic23-huawei> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210927_032129_997798_58EF8E36 X-CRM114-Status: GOOD ( 28.02 ) 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="===============1401671771668004107==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============1401671771668004107== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="H/MVuzPDD/iGErPz" Content-Disposition: inline --H/MVuzPDD/iGErPz Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 26, 2021 at 04:15:42PM +0100, Jonathan Cameron wrote: > On Mon, 20 Sep 2021 19:09:13 +0900 > William Breathitt Gray wrote: >=20 > > On Sun, Sep 12, 2021 at 05:18:42PM +0100, Jonathan Cameron wrote: > > > On Fri, 27 Aug 2021 12:47:51 +0900 > > > William Breathitt Gray wrote: > > > =20 > > > > This patch introduces a character device interface for the Counter > > > > subsystem. Device data is exposed through standard character device= read > > > > operations. Device data is gathered when a Counter event is pushed = by > > > > the respective Counter device driver. Configuration is handled via = ioctl > > > > operations on the respective Counter character device node. > > > >=20 > > > > Cc: David Lechner > > > > Cc: Gwendal Grignou > > > > Cc: Dan Carpenter > > > > Cc: Oleksij Rempel > > > > Signed-off-by: William Breathitt Gray =20 > > >=20 > > > Hi William, > > >=20 > > > Why the bit based lock? It feels like a mutex_trylock() type approac= h or > > > spinlock_trylock() would be a more common solution to this problem. > > > There is precedence for doing what you have here though so I'm not th= at > > > worried about it. =20 > >=20 > > Hi Jonathan, > >=20 > > We originally used a mutex for this, but Jarkko discovered that this > > produced a warning because chrdev_lock would be held when returning to > > user space: > > https://lore.kernel.org/linux-arm-kernel/YOq19zTsOzKA8v7c@shinobu/T/#m6= 072133d418d598a5f368bb942c945e46cfab9a5 > >=20 > > Following David Lechner's suggestion, I decided to reimplement > > chrdev_lock as a bitmap using an atomic flag. >=20 > Ok. I'm not sure bit lock was quite what was intended (as there is only = one of them) > but I suppose it doesn't greatly matter. It didn't cross my mind before, but would declaring chrdev_lock as an atomic_t be a more appropriate solution here because we have only one flag? William Breathitt Gray --H/MVuzPDD/iGErPz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEk5I4PDJ2w1cDf/bghvpINdm7VJIFAmFRmx0ACgkQhvpINdm7 VJIHsxAA4vgQ2N9AG3JBKZ4fdy5G0HIRCQcAbW8p4y0pfsCmeJnK4A5gwyqDpE12 YZRactHayYy1wjbSUfNTV1cToHiN3XI4QXe+VcY8ybHEXHxuUxr9CH9edEXb22YQ 9r3SgyCNgK4f9duQ+gdFxtihSJPgTyQA3v8x2h5aR74AgLh2tLTaFIDS18Tc8/4A sdp+3CfRTQ5/fxKhACQ9XgHt1qq8chNt9Fxd9UumXNv6x+ppesRx3+mcmP/SEtAd Zx7TIRc837fgv6lWrY2x8EEkJXcOgMdJDAhTyHNZTG6/FqxZf9X83T0GekBFufz2 p1HjBNxHQNxwMG9A8MDT2vTH7AqBoWWeatmYnW43uPC38ADX3x/hsNBPOp3zoKPR MjQIq2dJbVUAf5QOjpLxHYQYBw8tC668Bc76n7ut321CIVvv4/TVsqKpLN6zWnTW bPhqMuzM3fNyMC9+q5tdHefns3yVBHWS10xoneRGYE/h7LrF8qjrFsL/ZVnrT8IB RefwoLUEXS4+3Gt7pygyzLOuJE/ZciRUGzT5//UAP/D2hMp4oU5VxVCL7pQSMwVE dLbp6+DbAZMMpNs87fNMUloxN4sRcwttunlaBChWslme1+0flWpfgFyMIbJI9fi8 31xRbk8ixMsFInEmjC9tNeD45FvMVNg8MoPUPtu8ZbzTvimD6Sw= =Tugq -----END PGP SIGNATURE----- --H/MVuzPDD/iGErPz-- --===============1401671771668004107== 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 --===============1401671771668004107==--