Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp680265pxb; Thu, 30 Sep 2021 14:54:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUnl57EQd2KdGOYACupAP/+PGO1au+Vx3G2QNCRrc+vTVM7xu0fN2GJ5Gtwxx5X4GWmapH X-Received: by 2002:a17:90a:1610:: with SMTP id n16mr15492315pja.59.1633038859809; Thu, 30 Sep 2021 14:54:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633038859; cv=none; d=google.com; s=arc-20160816; b=tVlBmnfrwjBBWwtGBQUGn3pwHMHDW3M/6C2wCrkGsJijmrmg9YavI/CJJ7/d0uQi0e nDnN4DeyOrUyFRemlKZkepJhqYdpBTbidfMctG4wPYqf+alLoyPshUV5OUhZCj8zeYfI mcylKEzG2+tbkVdLlCcJ/+Ithov8PbelCewsiz3fGsqGPVR/evUd5a6+7Ebf+MdcB8xY EevhiPP+MHfC2wmgyxbDry7eGRZOsjKtFvzmMckp3Um1KvyXhWz6v1Cikn097Lu5z5zH GPwT4k2kCDYh8F5iTkpGzWFSNelE7m53tJ+0LMr5+/Ohs4c7wrvEv8ZFx46Kzxab1u+t Y3mA== 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=nz9fu/YsrSMt3C+RzE3FLuDD+popkL6tMBIuR/KRGrg=; b=Mkmbn9XFkUc7oXxN4UVQn+3+kXdYhaAXPJ7NXQHeMMNpYNoN5LVp88DU+JaoSP7pUv naR+va/tNbszrVEcRN8iuPi9jJ4i9dPIngabzD5iSmi/s9//RPs1qLID6ivGovCr0o2V vBMx/vasqlewWZkk56jon0MdXCK/8nUxWJoTxL2o7HBKgMBk+Ao0DejBQkPLTDLrpSng iKunhp8qO6PHMTOWWClX9QyTdofOO1zgBOr2NuigKDtrqTSlQDT4363Qmwz+fKLRYPCU EhRI2j7evQyO3CWeYypW4ISCGcYBHc3LFEy0dlvLvE30LoqWZdorHiHV8ueOjpKGdbI+ 1YmA== 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 fu18si7626260pjb.0.2021.09.30.14.54.06; Thu, 30 Sep 2021 14:54:19 -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; 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 S1352111AbhI3RTe (ORCPT + 99 others); Thu, 30 Sep 2021 13:19:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:37294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348476AbhI3RTd (ORCPT ); Thu, 30 Sep 2021 13:19:33 -0400 Received: from jic23-huawei (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 B78F66137A; Thu, 30 Sep 2021 17:17:45 +0000 (UTC) Date: Thu, 30 Sep 2021 18:21:40 +0100 From: Jonathan Cameron To: William Breathitt Gray Cc: linux-stm32@st-md-mailman.stormreply.com, kernel@pengutronix.de, 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, jarkko.nikula@linux.intel.com, Peter Rosin Subject: Re: [PATCH v17 0/9] Introduce the Counter character device interface Message-ID: <20210930182140.0475e772@jic23-huawei> In-Reply-To: References: X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; 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 Wed, 29 Sep 2021 12:15:57 +0900 William Breathitt Gray wrote: > Changes in v17: > - A couple minor improvements to documentation from review suggestions > - chrdev_lock redeclared as atomic_t; BITMAP was not necessary because > chrdev_lock is a single flag > - test_and_set_bit_lock(), clear_bit_unlock(), and clear_bit(), > replaced respectively with atomic_add_unless(), atomic_dec(), and > atomic_set() > - counter_comp_read_is_equal() and counter_comp_read_is_set() macros > implemented in order to properly test counter_comp structures' read > callback states > - counter_sysfs_add() call performed before counter_chrdev_add() call > in counter_register() in order to match unwinding sequence > - for-loop utilized in counter-example.c in order to simplify code > - counter-example.c returns 1 on error instead of -errno; errno may be > modified after a subsequent library call so we can't depend on it > > For convenience, this patchset is also available on my personal git > repo: https://gitlab.com/vilhelmgray/iio/-/tree/counter_chrdev_v17 > > A Counter character device interface is introduced that allows Counter > events and associated data to be read() by userspace; the > events_configure() and watch_validate() driver callbacks are introduced > to support Counter events; and IRQ support is added to the > 104-QUAD-8 driver, serving as an example of how to support the new > Counter events functionality. Applied to the togreg branch of iio.git and pushed out as testing for 0-day to see if we missed anything! I couldn't resist hitting lore.kernel.org for some archaeology on whether this broke records for a series on the IIO list (i.e. one I'd actually reviewed :) It has the dubious honour of being the only series to reach v17 that has been posted to linux-iio@vger.kernel.org as far as records go back. Peter Rosin's MUX series got to v15 and that seems to be the previous record holder joint with an mxs-lradc set from a while back. Perhaps not a record you wanted to get, but it shows impressive grit and determination! Jonathan > > William Breathitt Gray (9): > counter: Move counter enums to uapi header > counter: Add character device interface > docs: counter: Document character device interface > tools/counter: Create Counter tools > counter: Implement signalZ_action_component_id sysfs attribute > counter: Implement *_component_id sysfs attributes > counter: Implement events_queue_size sysfs attribute > counter: 104-quad-8: Replace mutex with spinlock > counter: 104-quad-8: Add IRQ support for the ACCES 104-QUAD-8 > > Documentation/ABI/testing/sysfs-bus-counter | 29 + > Documentation/driver-api/generic-counter.rst | 177 ++++-- > .../userspace-api/ioctl/ioctl-number.rst | 1 + > MAINTAINERS | 2 + > drivers/counter/104-quad-8.c | 256 ++++++-- > drivers/counter/Kconfig | 6 +- > drivers/counter/Makefile | 2 +- > drivers/counter/counter-chrdev.c | 578 ++++++++++++++++++ > drivers/counter/counter-chrdev.h | 14 + > drivers/counter/counter-core.c | 56 +- > drivers/counter/counter-sysfs.c | 123 +++- > include/linux/counter.h | 98 +-- > include/uapi/linux/counter.h | 154 +++++ > tools/Makefile | 13 +- > tools/counter/Build | 1 + > tools/counter/Makefile | 53 ++ > tools/counter/counter_example.c | 92 +++ > 17 files changed, 1509 insertions(+), 146 deletions(-) > create mode 100644 drivers/counter/counter-chrdev.c > create mode 100644 drivers/counter/counter-chrdev.h > create mode 100644 include/uapi/linux/counter.h > create mode 100644 tools/counter/Build > create mode 100644 tools/counter/Makefile > create mode 100644 tools/counter/counter_example.c > > > base-commit: a5ae0cfd53aaf031c2e9ba048281776fa67047c2