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=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 B0740C433DB for ; Fri, 12 Feb 2021 01:12:53 +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 6246364DEA for ; Fri, 12 Feb 2021 01:12:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6246364DEA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lechnology.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: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vK/vfQKNjbotMIoE4khDfIvK3I1S8OpW6MCnEZXJ9EA=; b=d1hV2eQmAJ01nPvigwxl3Gqul wx8shqXga3zBvMs3Dn7jo7TNBtx3UUSghdAxz108qSlZHOMwNRmGFLycOMZsvlELhLBEBeaJQ+76r kfCEFVEfmLBxI3gTgUjm5kwhvVl36sd4U2+Wy+MhaGyGk2VKkT/w6073FeIQg08ie8xp6hQFg3ygs s/3n6RxWKVYlsOFD5qYKrIX8AUKXl7lyXzLNRtPQ3J8RSQF77PEgknhY/+QQeRg/cbqtTwvEydu4P FN/hGa2XLpt8aTJvqwx6PtxNHGhiDun8NQK+6OfNXKsAueu6shVzMtj1ZyGh8Z4p2gjrMi8l4wa36 ABgY5PtMw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAMzt-0005T9-Kc; Fri, 12 Feb 2021 01:11:49 +0000 Received: from vern.gendns.com ([98.142.107.122]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lAMzq-0005MR-J6 for linux-arm-kernel@lists.infradead.org; Fri, 12 Feb 2021 01:11:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=F8f7LywDtKTmk9rZYp4IQgbKog4kMRZJjOcgsQe3LqI=; b=xxBJvN3oq/mEpgslNCzqZoWktf YJ0QYkvdGpElUtgNgkwXtP7+tEsxB0biJ3ZWbgHicnsF846uU6fcXixCtGd3jIUUfD8CC6IY3Y96P 6qWX9qXc9CXI85/JI2r+zF6nrgIbdGBM9eixwoYPbXOTUf5rW0DSSjK9D8MYzlcgG1cPcNQwXiZxO XHFez9U8PNdsv6grLAIl+atBuO5RLoPCMCJw4SOxF87+kYMQYPRLUVFe7uKOT6TUvt5UV9CYK6oFu 8dbpxcLq21lmZuz9YkBzZKRpACK89nYiYAxr+s/UEA+10lLrr9KvzCtzmh79lTKaqaw0Kc+M3FQoE kWs9fGLA==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:43618 helo=[192.168.0.134]) by vern.gendns.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lAMz7-0001We-0Y; Thu, 11 Feb 2021 20:11:01 -0500 Subject: Re: [PATCH v7 5/5] counter: 104-quad-8: Add IRQ support for the ACCES 104-QUAD-8 To: William Breathitt Gray References: <7a78ad95-9eba-277d-25da-ddf68357b969@lechnology.com> From: David Lechner Message-ID: Date: Thu, 11 Feb 2021 19:10:59 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210211_201146_776872_6BC9976E X-CRM114-Status: GOOD ( 24.40 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2/11/21 5:56 PM, William Breathitt Gray wrote: > On Wed, Dec 30, 2020 at 11:36:45AM -0600, David Lechner wrote: >> On 12/25/20 6:15 PM, William Breathitt Gray wrote: >> >>> diff --git a/Documentation/ABI/testing/sysfs-bus-counter-104-quad-8 b/Documentation/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 >> >> 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? > I agree that it should return an error instead of adding the watch. I'm pretty sure that is how I implemented the TI eQEP driver already. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel