Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4386226pxb; Sun, 14 Feb 2021 08:36:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3hjMJjCIaojPV5ZJvoZ+MY6JrJg8fPV0E+TI6IA/a4kw64MCyIKHr0B4ByRFIYVMRWnvg X-Received: by 2002:a17:906:dff1:: with SMTP id lc17mr11799049ejc.198.1613320569012; Sun, 14 Feb 2021 08:36:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613320569; cv=none; d=google.com; s=arc-20160816; b=wTQe737SV35ejXrs1tIyHxWq0hoPmI7Blapf6Off5QFqavG39D34cV/3w/eNhCb98/ d1yWt/8D+9Otl25cYmsL7rgfrYOKnnF97otM+xEmXyqvxX9CK92KrZ6on5UhQrT/aFZe E5YtQj7WyDi9J5x0KS6lpWqNCjwySzOiSFtHmhSGEOSSQwjVyXIZNIb4Vz6gsrb6+U2K XWwmgD35xv5tYETwWSNI+ao29Q18f/hbG7/kEx+85D2ZwG4/XKgJMKjbLM3sUyCCy+1L SeVFkWS4NI4aNBqC8UKYfFATxVYtmdFv8TU1LJvV571dK3Qqt3c2WC2FcI39PJ+5KUb+ A3Cg== 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=oJi5As2YODOGpS7Zw4FkZ/Xl+I04+UAl8Ely2uVNJFk=; b=cpuedgM5FNVthv5UCcVADBI/fNQ+v28jCRSpt1ArpqZdLQLr/e0n+UAVKGpN20V2aY g25m4stvJLpWOqd92wNZqbhbqK7Wj6Ev8N3stHqEFQJVSvH30V5cXALdHgWZAeYGfN04 B2gEPYLXNKK/1VHc0C7e/txQaCe0Ll2k88o3HXHacUC77j5erAdWK7U7/LqBXoewkVUi 9dJMsakttaMuQU1z8RSENLZ1YfXj7JI+W4TSFSBLiLa2qlzwoRxhrIX0HlGjlVhmiLna RALHF14BOpXVF1f2g8cHjkEoh+nkYXhVIaHwMx7ARWn6ls7F2FyJgM3QZ6BK6JhorTIu yyAw== 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 x5si4798250ede.575.2021.02.14.08.35.45; Sun, 14 Feb 2021 08:36:09 -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 S229870AbhBNQdg (ORCPT + 99 others); Sun, 14 Feb 2021 11:33:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:41414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229788AbhBNQde (ORCPT ); Sun, 14 Feb 2021 11:33:34 -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 4D0A160232; Sun, 14 Feb 2021 16:32:52 +0000 (UTC) Date: Sun, 14 Feb 2021 16:32:48 +0000 From: Jonathan Cameron To: Alexandru Ardelean Cc: , , , , , Subject: Re: [RFC PATCH 0/5] iio: buffer: add output buffer and cyclic mode Message-ID: <20210214163248.03d19fe1@archlinux> In-Reply-To: <20210212102021.47276-1-alexandru.ardelean@analog.com> References: <20210212102021.47276-1-alexandru.ardelean@analog.com> 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, 12 Feb 2021 12:20:16 +0200 Alexandru Ardelean wrote: > Largely, an adaptation of Lars' work, applied on the IIO multi-buffer > support + high-speed/mmap support [1]. > Found here: > https://github.com/larsclausen/linux/commits/iio-high-speed-5.10 > But this isn't tested. > > [1] Requires that these sets be applied (in this order): > * https://lore.kernel.org/linux-iio/20210211122452.78106-1-alexandru.ardelean@analog.com/T/#t > * https://lore.kernel.org/linux-iio/20210212101143.18993-1-alexandru.ardelean@analog.com/T/#t > > Some of the variation from the original work are: > 1. It's applied on top of the multibuffer support; so the direction of the > data is set per iio_buffer, and not iio_dev > 2. Cyclic mode is a separate patch > 3. devm_iio_dmaengine_buffer_alloc() requires the definition of > 'enum iio_buffer_direction'; which means that 'linux/iio/buffer.h' > needs to be included in buffer-dma.h; Lars tried to use a bool, but > using the enum seems a bit more consistent and allows us to maybe > go down the route of both I/O buffers (some day); not sure if > that's sane or not (you never know) > 4. Various re-formatting; and added some docstrings where I remembered > to so so Just thinking about how this is different from input buffers. For now at least I guess we can assume there is no equivalent of multiple consumers and the mux logic needed to support them. However I can definitely see we may get inkernel 'consumers' of these output buffers. Come to think of it, we probably need to rework the inkern logic anyway to deal with multiple buffer input devices. Hopefully it just continues working with the single buffer cases so there won't be any regressions on that front. Largest issue with this series is lack of users. It all seems good in principal but until drivers are making use of it, I'm not keen on merging this extra infrastructure. Jonathan > > Lars-Peter Clausen (5): > iio: Add output buffer support > iio: kfifo-buffer: Add output buffer support > iio: buffer-dma: Allow to provide custom buffer ops > iio: buffer-dma: Add output buffer support > iio: buffer-dma: add support for cyclic DMA transfers > > drivers/iio/adc/adi-axi-adc.c | 5 +- > drivers/iio/buffer/industrialio-buffer-dma.c | 120 ++++++++++++++++-- > .../buffer/industrialio-buffer-dmaengine.c | 57 +++++++-- > drivers/iio/buffer/kfifo_buf.c | 50 ++++++++ > drivers/iio/industrialio-buffer.c | 110 +++++++++++++++- > include/linux/iio/buffer-dma.h | 11 +- > include/linux/iio/buffer-dmaengine.h | 7 +- > include/linux/iio/buffer.h | 7 + > include/linux/iio/buffer_impl.h | 11 ++ > include/uapi/linux/iio/buffer.h | 1 + > 10 files changed, 348 insertions(+), 31 deletions(-) >