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 X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC83CC433DB for ; Thu, 11 Feb 2021 23:57:33 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 6BF1964DEA for ; Thu, 11 Feb 2021 23:57:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6BF1964DEA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject: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=Fr/yx3oN7QrvpXexku7ptiweLmsY+mmPgBV5k9QjKow=; b=nRz+LAcJ7fHJp9WMusNK9ZTJd 4eDWPN+fV7DEeA9TsRqzZDGh2UfxPe74VoXT6qj9xSbzAFWtLOOUouPbuR3QLNVcdPJI1mzcwjnl/ ybzIwYBLzK9EPJbNzAWOj8TvYHQJd7WjVEDLLURaxuIFL3wGkH4E9jkAjwlCY5ynUiOSjL6adGhBF c/3b3hhvaC8PQd661D86rgVNZsZ3jSKj3rwBbEZlSk6KkpOJeletIKEdLc2NHTagGBIL6LlKS6oSy rXrFzRS5W33t9YzluBsG50WAxNlDm4qRs6Cl3LwcnGglAbsdVSpEBvtKf4eS/6Htn0DFO9Eg+hWgm G1CdEwwmg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lALor-0000To-7t; Thu, 11 Feb 2021 23:56:21 +0000 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lALop-0000Sy-34 for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2021 23:56:20 +0000 Received: by mail-qt1-x82f.google.com with SMTP id h16so5524301qth.11 for ; Thu, 11 Feb 2021 15:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Fn9ECLUi2tPSHi7X9/WE7UqWMZvrqWVcR0Z02vtxJFM=; b=REJNTNOWdXeu6f7LaWhf4cwIC55Mp0Qq8gBt7jCVoL6KCO1/EAgCoGXxCqBOqz0R7n ZGIOkeZwLsQiEcXJN2Mjl9w/ExaghyhnqMXFeteGj0ofoZc9cl0dBp/HPLIuA0aITzZp NhR175zCa86KTLhRczWqtxri9/wYrpL7n8PRcor6nF2/BlN7BPqG1ifNJnDSNEWI/NKw AWIfMLGk9ZbaEFUXj6jhTCoHD8zQ/Q+VyM53pYwVRHTpYUUOj72MMNQluSvV8JIif/HR FpWiVfomx1VKHmtNFqAOoClRumweAZLsUn4VsRl4Gt+VQkhkKM+F3FGHuexGnjTrdSGh PhaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Fn9ECLUi2tPSHi7X9/WE7UqWMZvrqWVcR0Z02vtxJFM=; b=qUM/QPaAOvNiCCZmjJ6yVgJpBQWuop04TPu8ptls/aJe5FLqbHGPFzIQdjeDOoohqB Te3QSyVSN7UQnaZIYs6z799Jjkef2nWDCpK5lMRgmqTLhkN5jFAzQrw54Y/lwBSxqi09 Vu2Ach3OXNjbMxcKQ8sq3mht5eVP5+HdXLL79+CrsukmavnfIDgNqGVLHKWo2yXUZXNE FG25e8jtX7+jPe57l/cHbmSvjsHoc4tGGwmF7HcrC7Lm0gt6bHBINbYqCWiYhSjGQO+T InKr/7jdI9GRvb3MVpYbHnIcb+5sxMnbj+nI5Ti6DrboukKjL4V2TGmnenyG/sT2XFhn Mi1g== X-Gm-Message-State: AOAM531YI1z3gSwCFZIfawTQwhxS7+yVcJBSsNTDJJRj66qOMdYlg4hm jG6bf9bG4m1HBSsxYywtPSU= X-Google-Smtp-Source: ABdhPJyuiD3jKQsR4lp7R1jCbPxoM1hsEvSszFs2HWKuwJSZ2Og5Sp0UmJRyNNsX1qJjFZf+0wYnTg== X-Received: by 2002:ac8:498e:: with SMTP id f14mr215580qtq.286.1613087775410; Thu, 11 Feb 2021 15:56:15 -0800 (PST) Received: from shinobu ([193.27.12.132]) by smtp.gmail.com with ESMTPSA id l66sm5143121qkd.21.2021.02.11.15.56.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 15:56:14 -0800 (PST) Date: Fri, 12 Feb 2021 08:56:04 +0900 From: William Breathitt Gray To: David Lechner Subject: Re: [PATCH v7 5/5] counter: 104-quad-8: Add IRQ support for the ACCES 104-QUAD-8 Message-ID: References: <7a78ad95-9eba-277d-25da-ddf68357b969@lechnology.com> MIME-Version: 1.0 In-Reply-To: <7a78ad95-9eba-277d-25da-ddf68357b969@lechnology.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210211_185619_173006_FE756D1A X-CRM114-Status: GOOD ( 20.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kamel.bouhara@bootlin.com, gwendal@chromium.org, a.fatoum@pengutronix.de, mcoquelin.stm32@gmail.com, linux-iio@vger.kernel.org, patrick.havelange@essensium.com, alexandre.belloni@bootlin.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, fabrice.gasnier@st.com, syednwaris@gmail.com, linux-stm32@st-md-mailman.stormreply.com, jic23@kernel.org, alexandre.torgue@st.com Content-Type: multipart/mixed; boundary="===============8103093883702985341==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============8103093883702985341== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="p7kKPpmXtdPwRZVn" Content-Disposition: inline --p7kKPpmXtdPwRZVn Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 30, 2020 at 11:36:45AM -0600, David Lechner wrote: > On 12/25/20 6:15 PM, William Breathitt Gray wrote: >=20 > > diff --git a/Documentation/ABI/testing/sysfs-bus-counter-104-quad-8 b/D= ocumentation/ABI/testing/sysfs-bus-counter-104-quad-8 > > index eac32180c40d..0ecba24d43aa 100644 > > --- a/Documentation/ABI/testing/sysfs-bus-counter-104-quad-8 > > +++ b/Documentation/ABI/testing/sysfs-bus-counter-104-quad-8 > > @@ -1,3 +1,28 @@ > > +What: /sys/bus/counter/devices/counterX/countY/irq_trigger >=20 > Do we really need this sysfs attribute? Shouldn't interrupts be configured > _only_ by the chrdev interface? I think this attribute can go away because we can implicitly figure out the correct IRQ configuration from the struct counter_watch data when a user executes a COUNTER_ADD_WATCH_IOCTL ioctl command. However, I need some help deciding on an appropriate behavior for conflicting counter_watch configurations. Let me give some context first. The 104-QUAD-8 features 8 channels (essentially 8 independent physical counters on the device). Each channel can independently issue an event, but any particular channel can only be set to a single kind of event (COUNTER_EVENT_INDEX, COUNTER_EVENT_OVERFLOW, etc.). The purpose of the irq_trigger sysfs attribute I introduced in this patch is to allow the user to select the event configuration they want for a particular channel. We can theoretically figure this out implicitly from the struct counter_watch request, so this sysfs attribute may not be necessary. However, how do we handle the case where a user executes two COUNTER_ADD_WATCH_IOCTL ioctl commands for the same channel but with different event selections? I'm considering three possible behaviors: * Fail the second ioctl call; event selection of the first struct counter_watch takes precedence and thus second is incompatible. * Issue a dev_warn() indicating that the second struct counter_watch event selection will now be the event configuration for that channel. * Don't notify the user, just silently reconfigure for the second struct counter_watch event selection. I'm suspecting the first behavior I listed here (ioctl returning failed) is the most appropriate as a user is explicitly made known of this particular device's inability to support more than one type of event per channel. What do you think? William Breathitt Gray --p7kKPpmXtdPwRZVn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEk5I4PDJ2w1cDf/bghvpINdm7VJIFAmAlxAMACgkQhvpINdm7 VJJejBAAzJHKhvvQx5+lsNzKsvoLOZi+R4kk9Amkh2HH90O+UyagdXEHac++XOto K9fWenvVvr9x4XVCxB62Z65YkRnQDNdWdrZ7WLNkk1L5a/RL7ePJiozsjuaWAXVQ j6/uKv7ho45A5d5vQsdhdwBxfwNIRDQDqYqrLo8NYsl9ScBGQ1Wq1cYDWKG1HGuJ Is72OgyL3Mf2U5JSHIv/jk5Ox9YMLnJwr8XSQCZKldS42ieddRxd7vyxYJ4ePr9m Z/jhjczp0TVuXw7Ika0G1IreRwEfxWHqNJ9mtqFRbRzxLblcHqmMLcrNG4AUIMWN doEozsnwAIldaAxDljw2f6ZPQ7b8hd0PK8bieb901oNvEFf7kv8G1cOwfsuHvzYs GH/08NBtwvAk0RFiNQhrm6OowZmgUO2KAjWr9PQdXXOjit+1mgsvW1BdBEjO0i3D DPDkb+I+ZrnB5VeRxqudTGakFmuE6YXGM2ubxtSx1otNi7TdZKJhsEUU9JzUkf1J /BmOikFg/8yv/YoodDqCzymjOgxqUWSriQSIretaHz+rQR3/PD5xbqVnTe3pMUiR LRUVcwil/5DIZV0NdHqzbip3DK2OIzoQjHp2sIH+evT5Z0XtWiSgiZAs1lX9vuT3 5KpsAcytNu5TUzaXnMZ9tAzAWZ3X0TQk4zc9KD+U3XdymZz97ys= =O8ar -----END PGP SIGNATURE----- --p7kKPpmXtdPwRZVn-- --===============8103093883702985341== 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 --===============8103093883702985341==--