Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1204834imm; Tue, 3 Jul 2018 07:17:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdu+tg8NUQ38B8LLElzjVeJqboHyiG8ostdfSWPg2AT6gfqX6F+gKW9B0WQR1m+rySCNTyw X-Received: by 2002:aa7:86d7:: with SMTP id h23-v6mr26168895pfo.132.1530627462325; Tue, 03 Jul 2018 07:17:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530627462; cv=none; d=google.com; s=arc-20160816; b=ooQ/AcBe5kZt8yDLDZw1hxj96tGTZuGDo4kLEwZgqmHIxTy8pnRPbTAOSpd+/ZaYe1 bWgvOFrzLdcmNVhXJhSEYpVSIkveb2T76G+OU9uTmCz+2/5lb+DWz6EmPjcbCc2dOLFS bRxRzsT7ZATqkNMOeughIArNS7zjWl+b608IPpeGusj5e820TMd1Q/zp1xXIkaabxJ+9 X88m/WA8+LoD2K68YRhRQE/7XGy0fEPBWhCjw/XMeaWZZIAWp90HaQ7x9ky1nSt1oPT+ uh88i3CbQfUtwpXQspKSsMa8XTp0mIFFAZwge3OUMdgZ3nmYJo+0HZRtDQuju3ctG+D5 y4Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=zwjRBK5MRajJOPz/DAY0e8UnXxTHqH1J+OHPgFmBt9g=; b=eYnvop/MUfDnwRKPZ7mz39Jpo+eJEHZPyQ/EYwpQxq6G6704vWHsoeQSjtJxSxeSyV 5QnwIrAhIch6F0lMojDqc3w1XF9nwPfehRqDCd6V6/uOqkM7hofthxFn5yKrVHXboUoF fT0+UupvrDE2IGYqJ6aQT6jfzVuaPJxLbUHp+UhxI0KFiQfXN7WWlFYUeU4YQYvPOSX+ YY4EWqsV2v5HA4pGmbkvTOsucDYtC7JeKVMp6ylxBY9IHZ0gMLU7+LUPrJtr3kvMGlhN gcVhrz8vDwly/sRC3QtV9yVUfwf6AWfpt8Ps+PvZ4nvrwf7Er9Wl/GMWcIQ3BuXeTQGy NFig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HfGrpCbA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5-v6si1208663pfo.54.2018.07.03.07.17.28; Tue, 03 Jul 2018 07:17:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HfGrpCbA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932537AbeGCOQZ (ORCPT + 99 others); Tue, 3 Jul 2018 10:16:25 -0400 Received: from mail-yb0-f194.google.com ([209.85.213.194]:38515 "EHLO mail-yb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932146AbeGCOQX (ORCPT ); Tue, 3 Jul 2018 10:16:23 -0400 Received: by mail-yb0-f194.google.com with SMTP id i9-v6so780513ybo.5; Tue, 03 Jul 2018 07:16:23 -0700 (PDT) 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:user-agent; bh=zwjRBK5MRajJOPz/DAY0e8UnXxTHqH1J+OHPgFmBt9g=; b=HfGrpCbATR2uU3ineZnG8Z6ufb5+rFWSMPYCH9fZSleqhTbiugfziIsxEzaI1ALfqz 4IQubnt3rOMcj8Z939vkjyoaAIqlWDtN/oPRUbpaOV3++uVn18glDPrNFiVKb+teuP4z /0cr5+DbbqdGtzD2teCBxLwKk802HEmbRJ7OHAWOH0cwxTBY5rJm43SOm/WbsnzhPEuz rHiM+myd/XQ/V2lCUJDGmny1ZaWhg/u2MXCtHpPaw0iV9xybmicK4Lw2P5cQUegtk19n WzJQ2iYIEPjmZAzgMV03TsgUTMjoZOXYAZ+rPp9mDhF05nD9zfdZ1saf1F8ke7YMFK+S ECzA== 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:user-agent; bh=zwjRBK5MRajJOPz/DAY0e8UnXxTHqH1J+OHPgFmBt9g=; b=GJS4AQyM6prQRrV2nwFylb6KW+Hg15cw2nfcHNUv3fn7TalXX75VsXqGcHhY7A6aG/ JxPTaA2tsmjn6JlY59kauvo5Wys0A50gMtHzbEkiFynymxdpSv0hf06l++uIjPYO79D+ ZnmYEN9Kk8bYScJ3KRUbCevwmP0xN20Npn4pMmj6zH3psTiOQh6celp2FF78R0vkAX5C skL09kMmJeHPY8MHhEMtcDuuyj2sk8o15hnpVhFp/pWVPr5a+Js3+ntDYUJgy9mx4xnx i2KkrfTkUfRJfSwgRIreL1AkEdWyJsvD4yYxHAuMMNLFYFyI+ussvD3nR5mutAu8Doww BYKg== X-Gm-Message-State: APt69E2JrkYxPhCv9b4Gdo/KUgRu5TBuOvuLRrp5xLHVfKwbjCFxtqoK Pbx4Odgm3qcYxMHReRvu/ZQ= X-Received: by 2002:a25:6ac6:: with SMTP id f189-v6mr15808070ybc.499.1530627382711; Tue, 03 Jul 2018 07:16:22 -0700 (PDT) Received: from sophia ([72.188.97.40]) by smtp.gmail.com with ESMTPSA id s125-v6sm467345yws.49.2018.07.03.07.16.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 07:16:22 -0700 (PDT) Date: Tue, 3 Jul 2018 10:16:20 -0400 From: William Breathitt Gray To: David Lechner Cc: gregkh@linuxfoundation.org, linus.walleij@linaro.org, jic23@kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, fabrice.gasnier@st.com, benjamin.gaignard@st.com, robh+dt@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, mark.rutland@arm.com Subject: Re: [v7,03/10] docs: Add Generic Counter interface documentation Message-ID: <20180703141620.GB14958@sophia> References: <7606bdc53c26c332b2bbff0f865380fb0e874b56.1529607879.git.vilhelm.gray@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 02, 2018 at 02:37:53PM -0500, David Lechner wrote: >On 06/21/2018 04:07 PM, William Breathitt Gray wrote: >> +Userspace Interface >> +=================== >> + >> +Several sysfs attributes are generated by the Generic Counter interface, >> +and reside under the /sys/bus/counter/devices/counterX directory, where >> +counterX refers to the respective counter device. Please see >> +Documentation/ABI/testing/sys-bus-counter-generic-sysfs for detailed >> +information on each Generic Counter interface sysfs attribute. >> + >> +Through these sysfs attributes, programs and scripts may interact with >> +the Generic Counter paradigm Counts, Signals, and Synapses of respective >> +counter devices. >> + > >Have you considered a character device in addition to the sysfs interface? > >I basically have many of the same concerns that resulted in a char dev for >gpio[1]. > >- With sysfs, you *can* technically poll for events, but then you have to > seek and read or re-open the file. >- File permissions are annoying if you want a non root user to be able to > use the device. >- A single program can't claim exclusive access to a device. >- There is no automatic cleanup if a userspace program accessing the device > crashes. > >[1]: https://www.elinux.org/images/7/74/Elce2017_new_GPIO_interface.pdf Those look like good technical reasons for implementing a character device for the Generic Counter interface. I chose to implement the sysfs interface because I was using the IIO code as a reference, but I personally don't have much opposition to a character device in addition. I'd like to get Jonathan's opinion on this as well if possible -- I vaguely recall us considering this option briefly last year when the Generic Counter interface was still in its beginnings. I've CC'd Linus Walleij as well for input as the GPIO maintainer. William Breathitt Gray