Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2003412pxb; Sat, 27 Feb 2021 07:16:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhBlyq8f90ZwwHswfBydrVQ4vH6qRFQu/HSDumSdKfYhOEhvSjEiVUCEzXcToQ5q6Q7INE X-Received: by 2002:a50:fe08:: with SMTP id f8mr5863303edt.217.1614438995674; Sat, 27 Feb 2021 07:16:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614438995; cv=none; d=google.com; s=arc-20160816; b=j7NvahSjCt6pTii0oPyGyb+SHZBKxtvIqaMep7rfiKOSiaI+i1pAZRZZW763pLaaJj dyVAC4wPk53LsWQ0j6YBQh/sC+vrXaHACVhouRke53vTpUq4KHPBkbBHX9kKjKUQrwp/ gYeX++v27jwnFW5Wk5Cn0vh/KI1ENyN1ZfAR5iH5KOC7TiHzPsB2X8u2upggNrnQtk3Q TWCCapryRsYEGdva0+xQAh91AxZD0keQerp7JVUHoK5qmMDlPgT7Ht2bo0OknJXlMW5R LbN0HCFYoBTcVAysRqeYV4tRsTHC6Xnki1yxyRTIqHxnxtkPWf4I9pH8EdCTwUIylnNg DtfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=DGbi6U6AjCN5fLwVzY7YozMsWGbXSFiIrDDF6fgnNcA=; b=VLC7gnfzJdCSX6ehiqj1DIRInrl+ZItOgyQDv77OOlBednMGAPSn8+aYKu1525CEir Ks+EhiOHBQ6ZTAUWPnqBjtpv+FfYsjAFwWFsdKo8q6lpAN40uaMG3AM6NL/8R4PLy2n2 9YN9zFql/zQ9X/kp6W/iIsr8KmTYAOI7GC2qvwMuEQyUwld1TtNPuG4ss+FK3wHEDqSL aFC01MYRSaHDIs1/CrKgkm5wnQJD0+fpgSpbvVpDz8V+EVgInoMVKiBde8auVJBIV4ct S4Z5uXRuTMJU5hiCYEHBgJQpAy5kgwTdvuBvcSuzB+yP1ITXXHxZTeWBvWGiZynjTWFd DM0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t3si7850996eds.511.2021.02.27.07.16.13; Sat, 27 Feb 2021 07:16:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230084AbhB0POy (ORCPT + 99 others); Sat, 27 Feb 2021 10:14:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:45482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbhB0POw (ORCPT ); Sat, 27 Feb 2021 10:14:52 -0500 Received: from archlinux (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 09C0164D79; Sat, 27 Feb 2021 15:14:08 +0000 (UTC) Date: Sat, 27 Feb 2021 15:14:05 +0000 From: Jonathan Cameron To: William Breathitt Gray Cc: kernel@pengutronix.de, linux-stm32@st-md-mailman.stormreply.com, 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, Dan Carpenter Subject: Re: [PATCH v8 19/22] counter: Implement extension*_name sysfs attributes Message-ID: <20210227151405.0de48038@archlinux> In-Reply-To: References: <20210214180913.05bd3498@archlinux> <20210221140507.0a5ef57f@archlinux> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 26 Feb 2021 08:32:59 +0900 William Breathitt Gray wrote: > On Sun, Feb 21, 2021 at 02:05:07PM +0000, Jonathan Cameron wrote: > > On Fri, 19 Feb 2021 17:51:37 +0900 > > William Breathitt Gray wrote: > > > > > On Sun, Feb 14, 2021 at 06:09:13PM +0000, Jonathan Cameron wrote: > > > > On Fri, 12 Feb 2021 21:13:43 +0900 > > > > William Breathitt Gray wrote: > > > > > > > > > The Generic Counter chrdev interface expects users to supply extension > > > > > IDs in order to select extensions for requests. In order for users to > > > > > know what extension ID belongs to which extension this information must > > > > > be exposed. The extension*_name attribute provides a way for users to > > > > > discover what extension ID belongs to which extension by reading the > > > > > respective extension name for an extension ID. > > > > > > > > > > Cc: David Lechner > > > > > Cc: Gwendal Grignou > > > > > Cc: Dan Carpenter > > > > > Signed-off-by: William Breathitt Gray > > > > > --- > > > > > Documentation/ABI/testing/sysfs-bus-counter | 9 ++++ > > > > > drivers/counter/counter-sysfs.c | 51 +++++++++++++++++---- > > > > > 2 files changed, 50 insertions(+), 10 deletions(-) > > > > > > > > > > diff --git a/Documentation/ABI/testing/sysfs-bus-counter b/Documentation/ABI/testing/sysfs-bus-counter > > > > > index 6353f0a2f8f8..847e96f19d19 100644 > > > > > --- a/Documentation/ABI/testing/sysfs-bus-counter > > > > > +++ b/Documentation/ABI/testing/sysfs-bus-counter > > > > > @@ -100,6 +100,15 @@ Description: > > > > > Read-only attribute that indicates whether excessive noise is > > > > > present at the channel Y counter inputs. > > > > > > > > > > +What: /sys/bus/counter/devices/counterX/countY/extensionZ_name > > > > > +What: /sys/bus/counter/devices/counterX/extensionZ_name > > > > > +What: /sys/bus/counter/devices/counterX/signalY/extensionZ_name > > > > > +KernelVersion: 5.13 > > > > > +Contact: linux-iio@vger.kernel.org > > > > > +Description: > > > > > + Read-only attribute that indicates the component name of > > > > > + Extension Z. > > > > > > > > Good to say what form this takes. > > > > > > Do you mean a description like this: "Read-only string attribute that > > > indicates the component name of Extension Z"? > > > > My expectation would be that the possible strings are tightly constrained > > (perhaps via review). So I'd like to see what they are and a brief description > > of what each one means. > > > > Jonathan > > Okay I see what you mean now. These names will match the sysfs attribute > filenames. So for example, if Extension 9 of Count 2 of Counter device > is /sys/bus/counter/devices/counter4/count2/ceiling, then the attribute > /sys/bus/counter/devices/counter4/count2/extension9_name will hold a > value of "ceiling". > > The idea is that the user walks down through each extension*_name to > find sysfs attribute name for the Extension that they want. When they > find the desired Extension name in say sysfs attribute extension9_name, > then they know 9 is the ID number for that Extension. > > There is an alternative design I was considering: instead of > extension*_name attributes, we could have each Extension sysfs attribute > have a matching *_extension_id attribute which provides the respective > Extension ID. So for example, using the same Extension as before: > /sys/bus/counter/devices/counter4/count2/ceiling_extension_id will hold > a value of 9. > > Do you think this alternative design would be more intuitive to users? It feels like the user is going to start from what they want to enable then get the ID from that. With the current way around they'll have to search the extensionX_name files to find it, rather than a direct look up. So immediate thought is this second way would be easier to use, but perhaps others think differently. Jonathan > > William Breathitt Gray