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=-15.5 required=3.0 tests=BAYES_00,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=unavailable 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 50F46C433EF for ; Sun, 12 Sep 2021 16:33:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 33FAF6054F for ; Sun, 12 Sep 2021 16:33:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233848AbhILQeZ (ORCPT ); Sun, 12 Sep 2021 12:34:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:48776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbhILQeR (ORCPT ); Sun, 12 Sep 2021 12:34:17 -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 58701608FB; Sun, 12 Sep 2021 16:32:55 +0000 (UTC) Date: Sun, 12 Sep 2021 17:36:27 +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 Subject: Re: [PATCH v16 00/14] Introduce the Counter character device interface Message-ID: <20210912173627.0a09144b@jic23-huawei> In-Reply-To: <20210830181706.74e45cb8@jic23-huawei> References: <20210830181706.74e45cb8@jic23-huawei> 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 Mon, 30 Aug 2021 18:17:06 +0100 Jonathan Cameron wrote: > On Fri, 27 Aug 2021 12:47:44 +0900 > William Breathitt Gray wrote: > > > Changes in v16: > > - Define magic numbers for stm32-lptimer-cnt clock polarities > > - Define magic numbers for stm32-timer-cnt encoder modes > > - Bump KernelVersion to 5.16 in sysfs-bus-counter ABI documentation > > - Fix typos in driver API generic-counter.rst documentation file > > > > For convenience, this patchset is also available on my personal git > > repo: https://gitlab.com/vilhelmgray/iio/-/tree/counter_chrdev_v16 > > > > The patches preceding "counter: Internalize sysfs interface code" are > > primarily cleanup and fixes that can be picked up and applied now to the > > IIO tree if so desired. The "counter: Internalize sysfs interface code" > > patch as well may be considered for pickup because it is relatively safe > > and makes no changes to the userspace interface. > > > > To summarize the main points of this patchset: there are no changes to > > the existing Counter sysfs userspace interface; 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. > > Hi William, > > I'll aim to pick up the first part in a week (too tired today after a lot > of reviewing to even manage the basic sanity check on the changes). > > For the rest... > > What I'd really like to know is if anyone other than William and I is planning > to review them in depth? (particularly 7 and 8 which are the new interface > patch and docs) > > So if anyone reading this is in that category please let me know. We can wait, > but conversely if no one is going to get time / inclination to do it then I > don't want to hold these up any longer and maximum time in linux-next may > be more useful than sitting unloved on the mailing list. Ah well, looks like it's just the two of us for the chrdev core patches :) Anyhow, I found time for a more thorough review. I'm not 100% convinced on the model for the chrdev but you know a lot more about this sort of hardware than I do and it definitely seems reasonable - if anything it might be more flexible than it needs to be. I've highlighted a few small things in the patches. With those fixed I'm happy to apply the remainder of this series unless someone shouts in the meantime. There has been plenty of time for review, so fingers crossed that anyone who hasn't commented, but cares, is happy with how you have done it. So, lucky v17! Persistence pays off in the end. Thanks, Jonathan > > Jonathan > > > > > William Breathitt Gray (14): > > counter: stm32-lptimer-cnt: Provide defines for clock polarities > > counter: stm32-timer-cnt: Provide defines for slave mode selection > > counter: Internalize sysfs interface code > > counter: Update counter.h comments to reflect sysfs internalization > > docs: counter: Update to reflect sysfs internalization > > 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 | 38 +- > > Documentation/driver-api/generic-counter.rst | 358 +++- > > .../userspace-api/ioctl/ioctl-number.rst | 1 + > > MAINTAINERS | 3 +- > > drivers/counter/104-quad-8.c | 699 ++++---- > > drivers/counter/Kconfig | 6 +- > > drivers/counter/Makefile | 1 + > > drivers/counter/counter-chrdev.c | 553 ++++++ > > drivers/counter/counter-chrdev.h | 14 + > > drivers/counter/counter-core.c | 191 +++ > > drivers/counter/counter-sysfs.c | 960 +++++++++++ > > drivers/counter/counter-sysfs.h | 13 + > > drivers/counter/counter.c | 1496 ----------------- > > drivers/counter/ftm-quaddec.c | 60 +- > > drivers/counter/intel-qep.c | 144 +- > > drivers/counter/interrupt-cnt.c | 62 +- > > drivers/counter/microchip-tcb-capture.c | 91 +- > > drivers/counter/stm32-lptimer-cnt.c | 212 ++- > > drivers/counter/stm32-timer-cnt.c | 195 +-- > > drivers/counter/ti-eqep.c | 180 +- > > include/linux/counter.h | 715 ++++---- > > include/linux/counter_enum.h | 45 - > > include/linux/mfd/stm32-lptimer.h | 5 + > > include/linux/mfd/stm32-timers.h | 4 + > > include/uapi/linux/counter.h | 154 ++ > > tools/Makefile | 13 +- > > tools/counter/Build | 1 + > > tools/counter/Makefile | 53 + > > tools/counter/counter_example.c | 93 + > > 29 files changed, 3569 insertions(+), 2791 deletions(-) > > create mode 100644 drivers/counter/counter-chrdev.c > > create mode 100644 drivers/counter/counter-chrdev.h > > create mode 100644 drivers/counter/counter-core.c > > create mode 100644 drivers/counter/counter-sysfs.c > > create mode 100644 drivers/counter/counter-sysfs.h > > delete mode 100644 drivers/counter/counter.c > > delete mode 100644 include/linux/counter_enum.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: 5ffeb17c0d3dd44704b4aee83e297ec07666e4d6 > 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=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable 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 A5302C433EF for ; Sun, 12 Sep 2021 16:34:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 70BC8608FB for ; Sun, 12 Sep 2021 16:34:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 70BC8608FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LvdfgzmSY1fMFgeUH2RTxe5H5w5RUsb6t/tmmg1R0yc=; b=battt/6eNB9WaT DSV0iPtqmqbk29fxXTEmbE7VJTRU30QRJ08XoDPfmFYJBvQHGACUnQHjzuby5xklUa9eAbGfLLVv/ 9TEs73/nBNEOnqLvR8g11GeVYwihD8yKpUWQh4rIhuR5BLOhpJiNu/RIZp2j0in9lpVF0AzCvcmZ2 JmPQF+Ah/SqcV5VU0yd6Y6fb21cJd5jplnMYsh2y7nPF6e6qPUN8bU++YSO73J2pX1VNGAZO1+znY qOoB6tdXhmHtmS56dFpaMPwE+Vl2XDT7CGWMplyvLZh/YDB9B2mjrCnnNWxIDkO009tPBeBwzydg9 R129v+JM27iNeU8IsCQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPSPg-00Gj1R-72; Sun, 12 Sep 2021 16:33:04 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPSPb-00Gj0i-Tl for linux-arm-kernel@lists.infradead.org; Sun, 12 Sep 2021 16:33:01 +0000 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 58701608FB; Sun, 12 Sep 2021 16:32:55 +0000 (UTC) Date: Sun, 12 Sep 2021 17:36:27 +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 Subject: Re: [PATCH v16 00/14] Introduce the Counter character device interface Message-ID: <20210912173627.0a09144b@jic23-huawei> In-Reply-To: <20210830181706.74e45cb8@jic23-huawei> References: <20210830181706.74e45cb8@jic23-huawei> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210912_093300_058718_C38769FF X-CRM114-Status: GOOD ( 40.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 30 Aug 2021 18:17:06 +0100 Jonathan Cameron wrote: > On Fri, 27 Aug 2021 12:47:44 +0900 > William Breathitt Gray wrote: > > > Changes in v16: > > - Define magic numbers for stm32-lptimer-cnt clock polarities > > - Define magic numbers for stm32-timer-cnt encoder modes > > - Bump KernelVersion to 5.16 in sysfs-bus-counter ABI documentation > > - Fix typos in driver API generic-counter.rst documentation file > > > > For convenience, this patchset is also available on my personal git > > repo: https://gitlab.com/vilhelmgray/iio/-/tree/counter_chrdev_v16 > > > > The patches preceding "counter: Internalize sysfs interface code" are > > primarily cleanup and fixes that can be picked up and applied now to the > > IIO tree if so desired. The "counter: Internalize sysfs interface code" > > patch as well may be considered for pickup because it is relatively safe > > and makes no changes to the userspace interface. > > > > To summarize the main points of this patchset: there are no changes to > > the existing Counter sysfs userspace interface; 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. > > Hi William, > > I'll aim to pick up the first part in a week (too tired today after a lot > of reviewing to even manage the basic sanity check on the changes). > > For the rest... > > What I'd really like to know is if anyone other than William and I is planning > to review them in depth? (particularly 7 and 8 which are the new interface > patch and docs) > > So if anyone reading this is in that category please let me know. We can wait, > but conversely if no one is going to get time / inclination to do it then I > don't want to hold these up any longer and maximum time in linux-next may > be more useful than sitting unloved on the mailing list. Ah well, looks like it's just the two of us for the chrdev core patches :) Anyhow, I found time for a more thorough review. I'm not 100% convinced on the model for the chrdev but you know a lot more about this sort of hardware than I do and it definitely seems reasonable - if anything it might be more flexible than it needs to be. I've highlighted a few small things in the patches. With those fixed I'm happy to apply the remainder of this series unless someone shouts in the meantime. There has been plenty of time for review, so fingers crossed that anyone who hasn't commented, but cares, is happy with how you have done it. So, lucky v17! Persistence pays off in the end. Thanks, Jonathan > > Jonathan > > > > > William Breathitt Gray (14): > > counter: stm32-lptimer-cnt: Provide defines for clock polarities > > counter: stm32-timer-cnt: Provide defines for slave mode selection > > counter: Internalize sysfs interface code > > counter: Update counter.h comments to reflect sysfs internalization > > docs: counter: Update to reflect sysfs internalization > > 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 | 38 +- > > Documentation/driver-api/generic-counter.rst | 358 +++- > > .../userspace-api/ioctl/ioctl-number.rst | 1 + > > MAINTAINERS | 3 +- > > drivers/counter/104-quad-8.c | 699 ++++---- > > drivers/counter/Kconfig | 6 +- > > drivers/counter/Makefile | 1 + > > drivers/counter/counter-chrdev.c | 553 ++++++ > > drivers/counter/counter-chrdev.h | 14 + > > drivers/counter/counter-core.c | 191 +++ > > drivers/counter/counter-sysfs.c | 960 +++++++++++ > > drivers/counter/counter-sysfs.h | 13 + > > drivers/counter/counter.c | 1496 ----------------- > > drivers/counter/ftm-quaddec.c | 60 +- > > drivers/counter/intel-qep.c | 144 +- > > drivers/counter/interrupt-cnt.c | 62 +- > > drivers/counter/microchip-tcb-capture.c | 91 +- > > drivers/counter/stm32-lptimer-cnt.c | 212 ++- > > drivers/counter/stm32-timer-cnt.c | 195 +-- > > drivers/counter/ti-eqep.c | 180 +- > > include/linux/counter.h | 715 ++++---- > > include/linux/counter_enum.h | 45 - > > include/linux/mfd/stm32-lptimer.h | 5 + > > include/linux/mfd/stm32-timers.h | 4 + > > include/uapi/linux/counter.h | 154 ++ > > tools/Makefile | 13 +- > > tools/counter/Build | 1 + > > tools/counter/Makefile | 53 + > > tools/counter/counter_example.c | 93 + > > 29 files changed, 3569 insertions(+), 2791 deletions(-) > > create mode 100644 drivers/counter/counter-chrdev.c > > create mode 100644 drivers/counter/counter-chrdev.h > > create mode 100644 drivers/counter/counter-core.c > > create mode 100644 drivers/counter/counter-sysfs.c > > create mode 100644 drivers/counter/counter-sysfs.h > > delete mode 100644 drivers/counter/counter.c > > delete mode 100644 include/linux/counter_enum.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: 5ffeb17c0d3dd44704b4aee83e297ec07666e4d6 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel