Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1188888pxb; Tue, 8 Feb 2022 11:11:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLtN9ziAJ0/wh73kMnRn7I3DMcNlP/UhD0qnpyjGMUsUsP7dDKBz47bF7dCLUopqPZEGnG X-Received: by 2002:a17:90b:4b88:: with SMTP id lr8mr2921595pjb.12.1644347495302; Tue, 08 Feb 2022 11:11:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644347495; cv=none; d=google.com; s=arc-20160816; b=FWn7A6WKgLeUfUwYzZrVGo7zcbesRplaD61IM/ic4upqxfBD9DjwqXyJPe+VhWI5pC iXo+sGp4chbzx5q2I7F3FAmejTkqmeIb3N4QxvpFW4rM70q6OSQLr+dktPacdZYlS9tE 1Yf8t8MyhU+4nXYNyVFSw8P+C3A9GQlFLMcVq9EIYLOkfTuvd0rHCW85O1Sk38pGdH88 BJlJhP1v6tLlFJBO8XrrwTlQ8nR6AFQp/Kg0ZFUJQWRVgaBqwXUSN2DhMq+xi7XOu04p u18R7rVkqPmt2f5feW6Z3WjhSKa5KkWz9fq2I1t0cR0+07yf1iMaMpk2wGG1mWDwJz6h 3JMQ== 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 :message-id:date:subject:cc:to:from; bh=/APtJR5gm6ShzNQ3BFd42uVvxIvxknKI/yhgMZAQres=; b=nx78uZW9wotbcXsBzVBhuFbI9sR0vVwrLfmjP2zlp9p17Xq37Ac7ig8V72V2iV1Kc5 qQhvwFqSirtQax88Lk7dBFTJMYcmbWlQDtFV1IPnfWHkVIq+UqZ+W3bS79baC2UC1Ll9 2JuQIne78Q93uOxstbDK1xePA59X1auZHlGhAD3t839JfXBFshLRjORuEbNT/sZ8mPjK EMJnLFYQrzMPDzHAGIOonjqLm/QwFpWs4PdAT8XEpCgCi6vbvIipf4bIXSc0zl38PEGj S1IJ5uwu8LnhdGPTLSEV1Lmpa9GV6ja/wxbLACwzVjzc4bZoSgzh8Bxp7tbL1J5uDTnR E0vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r72si13540393pgr.218.2022.02.08.11.11.22; Tue, 08 Feb 2022 11:11:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1448768AbiBGNMx (ORCPT + 99 others); Mon, 7 Feb 2022 08:12:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386697AbiBGNFd (ORCPT ); Mon, 7 Feb 2022 08:05:33 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AA03C043181; Mon, 7 Feb 2022 05:05:33 -0800 (PST) From: Paul Cercueil To: Jonathan Cameron Cc: Michael Hennerich , Lars-Peter Clausen , =?UTF-8?q?Christian=20K=C3=B6nig?= , Sumit Semwal , Jonathan Corbet , Alexandru Ardelean , dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Paul Cercueil Subject: [PATCH v2 00/12] iio: buffer-dma: write() and new DMABUF based API Date: Mon, 7 Feb 2022 12:59:21 +0000 Message-Id: <20220207125933.81634-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jonathan, This is the V2 of my patchset that introduces a new userspace interface based on DMABUF objects to complement the fileio API, and adds write() support to the existing fileio API. Changes since v1: - the patches that were merged in v1 have been (obviously) dropped from this patchset; - the patch that was setting the write-combine cache setting has been dropped as well, as it was simply not useful. - [01/12]: * Only remove the outgoing queue, and keep the incoming queue, as we want the buffer to start streaming data as soon as it is enabled. * Remove IIO_BLOCK_STATE_DEQUEUED, since it is now functionally the same as IIO_BLOCK_STATE_DONE. - [02/12]: * Fix block->state not being reset in iio_dma_buffer_request_update() for output buffers. * Only update block->bytes_used once and add a comment about why we update it. * Add a comment about why we're setting a different state for output buffers in iio_dma_buffer_request_update() * Remove useless cast to bool (!!) in iio_dma_buffer_io() - [05/12]: Only allow the new IOCTLs on the buffer FD created with IIO_BUFFER_GET_FD_IOCTL(). - [12/12]: * Explicitly state that the new interface is optional and is not implemented by all drivers. * The IOCTLs can now only be called on the buffer FD returned by IIO_BUFFER_GET_FD_IOCTL. * Move the page up a bit in the index since it is core stuff and not driver-specific. The patches not listed here have not been modified since v1. Cheers, -Paul Alexandru Ardelean (1): iio: buffer-dma: split iio_dma_buffer_fileio_free() function Paul Cercueil (11): iio: buffer-dma: Get rid of outgoing queue iio: buffer-dma: Enable buffer write support iio: buffer-dmaengine: Support specifying buffer direction iio: buffer-dmaengine: Enable write support iio: core: Add new DMABUF interface infrastructure iio: buffer-dma: Use DMABUFs instead of custom solution iio: buffer-dma: Implement new DMABUF based userspace API iio: buffer-dmaengine: Support new DMABUF based userspace API iio: core: Add support for cyclic buffers iio: buffer-dmaengine: Add support for cyclic buffers Documentation: iio: Document high-speed DMABUF based API Documentation/driver-api/dma-buf.rst | 2 + Documentation/iio/dmabuf_api.rst | 94 +++ Documentation/iio/index.rst | 2 + drivers/iio/adc/adi-axi-adc.c | 3 +- drivers/iio/buffer/industrialio-buffer-dma.c | 610 ++++++++++++++---- .../buffer/industrialio-buffer-dmaengine.c | 42 +- drivers/iio/industrialio-buffer.c | 60 ++ include/linux/iio/buffer-dma.h | 38 +- include/linux/iio/buffer-dmaengine.h | 5 +- include/linux/iio/buffer_impl.h | 8 + include/uapi/linux/iio/buffer.h | 30 + 11 files changed, 749 insertions(+), 145 deletions(-) create mode 100644 Documentation/iio/dmabuf_api.rst -- 2.34.1