Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2725239ybz; Sun, 3 May 2020 07:55:40 -0700 (PDT) X-Google-Smtp-Source: APiQypJZsqRzJ0QKf4FPYAokb9I5pPo5VjyldxowpMsO9A1VakXovGN70FRt9Jsax2cyn+NXt00C X-Received: by 2002:a05:6402:30ae:: with SMTP id df14mr10541624edb.86.1588517740616; Sun, 03 May 2020 07:55:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588517740; cv=none; d=google.com; s=arc-20160816; b=XZF2fIQ6Ym/0gmcsTlWbsuy3GVF5o5Uk7h+fK8UcPHpTEHVdLVcBVcVeb9vmgEtJBz DdLpvBrnLBvTqx2CcnwBR5fCDHzrzkdWt/WC7/JDPzS9qmbo5HQwZ8EA+LPRAD1EvuOq hHzu7MAdeUtSn8rShfS7BWWDSbXPLdTrMkNunoEuvFItTvmyz3F2/aFJRwd4GAUUYTpj Y88ZmiJ3twBqMAcaVtAJNyR3pjArydwAqq0Swp5mPHWRNybGj+utoxAMnbqHv2jgXp+G CaZS+8Xz0Q1djR7DSNRE26ftpCTK5ujXfFU6cxs9vpnqfVglSbkl7J1BIw1JfiI6t6Xg PNlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=SX50huPCkFM+RUVgIxJCp3xxwyGyS8qNIGAF41U/3GU=; b=dwD/EQ6cFxwTDTQQI65kmLki+63ow8V5QM6lT/VSP1/vVBxoyz+GpE1gRgQPcbOY2N gfjrfxy0nCEPZVojG6R5+k8H9YPGCq1LhwubihpxsY0ftLXj4PT3NdQv/pQArkuhM6RN d6f4Gf2dnk7Opqgl4h2arBpPwwxe+qjSPYMtwKA+Zs/ms431ywtKOaF5BCXCWtfOoOdS geQrrMvq5TCdCAj3vIHPBZtU1ExBQP0z4xtOkaIyrIl6dpqB2peV17Np8wHsn1MR9eNl gDU+f0ajyVi8hh2PESO6S1wvOn6/GQ3YRGRjEaIX8+xZnrBen7ras8lWGR/U7OV9FMKw i6Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BwzIx5JN; 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 u19si4837196eda.10.2020.05.03.07.55.17; Sun, 03 May 2020 07:55:40 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=BwzIx5JN; 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 S1728742AbgECOww (ORCPT + 99 others); Sun, 3 May 2020 10:52:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:41774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728002AbgECOwv (ORCPT ); Sun, 3 May 2020 10:52:51 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (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 918FD206F0; Sun, 3 May 2020 14:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588517571; bh=xXDUieDuCzRqcEpqQa4OH8QkYBoUMGQ7uE6Ln2swCE8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BwzIx5JNlgm+xPpdHNmK6Ug/5+tkTXai709h5BlOsaYVzJ70JQUz02hooslHlBOpm cvowAwVs5jIu5veh1ttXQnvWEGfN4Feo4hghFrLb49giSYHDa16woOeomwk/qq32g5 L/RSkXW+YBlKnRkpnbcJgJIo7mU7ZHX4hiwzt2Zo= Date: Sun, 3 May 2020 15:52:45 +0100 From: Jonathan Cameron To: David Lechner Cc: William Breathitt Gray , kamel.bouhara@bootlin.com, gwendal@chromium.org, alexandre.belloni@bootlin.com, felipe.balbi@linux.intel.com, fabien.lahoudere@collabora.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, 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 Subject: Re: [PATCH 0/4] Introduce the Counter character device interface Message-ID: <20200503155245.08916211@archlinux> In-Reply-To: References: X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Apr 2020 15:21:05 -0500 David Lechner wrote: > On 4/29/20 1:11 PM, William Breathitt Gray wrote: > > Over the past couple years we have noticed some shortcomings with the > > Counter sysfs interface. Although useful in the majority of situations, > > there are certain use-cases where interacting through sysfs attributes > > can become cumbersome and inefficient. A desire to support more advanced > > functionality such as timestamps, multi-axis positioning tables, and > > other such latency-sensitive applications, has motivated a reevaluation > > of the Counter subsystem. I believe a character device interface will be > > helpful for this more niche area of counter device use. > > Nice to see some progress being made. :-) > > > > > Interaction with Counter character devices occurs via ioctl commands. > > This allows userspace applications to access and set counter data using > > native C datatypes rather than working through string translations. > > For most aspects of the counter subsystem, this is not an issue since > configuring a counter is not a time-sensitive operation. Instead of > ioctls, I was expecting to just be able to read the character device > and receive counter events or poll to wait for events similar to how > the input subsystem works or how buffers work in the iio subsystem. > > I'm afraid I don't really see much use in having ioctls that do > exactly what sysfs already does. And my intuition tells me that the > extra work needed to maintain it will probably cost more than any > benefit gained. (Maybe other have a different experience that leads > to a different conclusion?) I agree with David here. The ioctls are currently doing what could have been done nicely with a userspace library. Moving away from the string based internal interface is a good move to my mind, because it ensures consistency in they sysfs interface and provides for in kernel users when they make sense. The step of then using that to simplify providing an IOCTL interface to do the same things doesn't seem particularly useful. So what do we gain? Jonathan