Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp433730lqp; Sun, 9 Jun 2024 02:56:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUimEXMyMVJVPu51mr6Co+pDCZ6/aGFdzEsF1sRKH97JFV347kywS2yreqBvUZZWzmpYOVhdmkj180mNwWQby9cRy67LxlB9BwiJ0iekA== X-Google-Smtp-Source: AGHT+IFjtx8t1YsIPkLE20vqrfoM+X35Sx1zyooUXEQzsXNE1jzhr+Pua9YP5k64/9o8JZdMzh96 X-Received: by 2002:a05:6808:d49:b0:3d2:27ef:264f with SMTP id 5614622812f47-3d227ef2888mr511248b6e.10.1717926973581; Sun, 09 Jun 2024 02:56:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717926973; cv=pass; d=google.com; s=arc-20160816; b=MbvG+HbCpPUEhoy0KOkcNvdk4qqN6RrLUamy3R4iN/ZORpsicoqLUA3qrseXTcfna6 mxatodnPQaH9E+Z+KWjnaImLvL9PUadzkKdxw6tKqwi9s9+/2BUZyE6Eg1Zzi2brGXHB PH+Qoj/VUYK7o88gO43XGADDerekr4He/6ENpDYWz1qynJJkZtnMzXYWurKYscVpDfsy 2HnJiQI/v0j6Mf5+45RqZjJyhaGU3dLRh6eySvi04LrbpXwonF8hhMp/0y7oSZdeGz5l 7gNyTyeW9wyFkoWc9TwBtGiQdQwLjB3OLv2Im/QQbgmKu11dK4l/M28pDuuxODOeTakz +I0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=r1BBetiVPoixmFv4ngkCYQxtLcOP1EUGVeQXeOfCd8s=; fh=DAH3yHiYTDcWslJ5vMdBU9iEJOPX9MyA2bk7V2mkHZg=; b=RO08LzhFQyIWaJ93QMWN+Vyg8HCdp+8lUKk3cSHI5RWxK7eKTAOUHPxcSeDvnDPfcg T/ko1qIQxZoR5SQOvYKzLYr7ol9WZSgHdR9J2z8uZNaBJm4JyF3VboBJ6m5kwCnV0w1o R+0ufIL1PYLT5vJxMi5uI0zXLJAU8nYA9NN5OsuL9Fgoozi4ZvqCWqprZNagjLCSNxEV z3KbHkXo6ZTeQNsRXNyv45BJZJZfAAQrpYj2DWZZXlhCziWAKefZ6CvXem8pBWAMqQkB se4DODk2n8gJbBNNgddWRCvTVGxGpxMRJJ9mghvkU2jEiMpdcMlbX9uXBXOqBo4t1T5l 02ag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vh4rp+nY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-207310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de28d2eeefsi5889278a12.639.2024.06.09.02.56.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 02:56:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vh4rp+nY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-207310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id AAABAB213B4 for ; Sun, 9 Jun 2024 09:56:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B609D208AD; Sun, 9 Jun 2024 09:55:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Vh4rp+nY" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC27BEED8; Sun, 9 Jun 2024 09:55:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717926953; cv=none; b=fZYRHMh0KJXQUdFRqGKFTc8F3XQpEiLyqHwsD25RP5lZLDRqfDutkLPJp8FBFGVjcJInp1eIofkdTj64A/J4h1a6PFYLe2Mcf7VStedH5boDT2Uneg/7YyBi51pkE38PW6oeTODPMWidhUiiQlH0B4ss9mrtClZzmlPX4w/e55U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717926953; c=relaxed/simple; bh=J3+LkAlthj2AJZLov9TBAoYftU77dGSFi6J0sALU0co=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XQb1m9R2eVmPyfMwS/t3W/VPPwnvp3BB0u8R/h9+y/VK1Jts37iYVUivA2c1P3lRUXgnnqtIev1thKF20yI6DZq3SDj3tIG1E2ezntNuma8/Mv0Mhgl/EotyI96WWYPBgJBoWGdLCWgjvAsqpi3DR6LggfgiI+N9sVjnRuX53KM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Vh4rp+nY; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 331BCC2BD10; Sun, 9 Jun 2024 09:55:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717926953; bh=J3+LkAlthj2AJZLov9TBAoYftU77dGSFi6J0sALU0co=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Vh4rp+nYjUUgM1+TcsBri2M5y1fvrGCXzGe1V+fo6MKCK7rJqsTLooYlf65NCjVvt Tt9m3WeDWASFpGNXmjb+rs3eHqJn0RbGDc7ct4c1lAnocGLbGO1mNyycpM6DDVfO1A JeK4MbJisCPaj+nU3ayutUVe9FG1kyr4Jfd6kKDSUl6zrRjcgj8qK67oEjwmCoxIUK 1anrNBYEO/rzthGsyH0348ZLzBWlrqQpH7kfnsRkVy+fPsxegcic5G7VnH9hvMGgJu K41rX/QAmAH4t2kwexgm09vL3cgBuu/GvkzWZKe4axa5KScy2nlGDfRI7BgaWhqciu 0MgiMFDAimjQw== Date: Sun, 9 Jun 2024 10:55:01 +0100 From: Jonathan Cameron To: Paul Cercueil Cc: Lars-Peter Clausen , Vinod Koul , Sumit Semwal , Christian =?UTF-8?B?S8O2bmln?= , Jonathan Corbet , Nuno Sa , linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH v10 4/6] iio: buffer-dma: Enable support for DMABUFs Message-ID: <20240609105501.0f836684@jic23-huawei> In-Reply-To: <20240605110845.86740-5-paul@crapouillou.net> References: <20240605110845.86740-1-paul@crapouillou.net> <20240605110845.86740-5-paul@crapouillou.net> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.42; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 5 Jun 2024 13:08:43 +0200 Paul Cercueil wrote: > Implement iio_dma_buffer_attach_dmabuf(), iio_dma_buffer_detach_dmabuf() > and iio_dma_buffer_transfer_dmabuf(), which can then be used by the IIO > DMA buffer implementations. > > Signed-off-by: Paul Cercueil > Signed-off-by: Nuno Sa > Same thing on SoB. Also another missing structure field related docs comment inline. > diff --git a/include/linux/iio/buffer-dma.h b/include/linux/iio/buffer-dma.h > index 6e27e47077d5..e54158e53fd6 100644 > --- a/include/linux/iio/buffer-dma.h > +++ b/include/linux/iio/buffer-dma.h > @@ -7,6 +7,7 @@ > #ifndef __INDUSTRIALIO_DMA_BUFFER_H__ > #define __INDUSTRIALIO_DMA_BUFFER_H__ > > +#include > #include > #include > #include > @@ -16,6 +17,9 @@ > struct iio_dma_buffer_queue; > struct iio_dma_buffer_ops; > struct device; > +struct dma_buf_attachment; > +struct dma_fence; > +struct sg_table; > > /** > * enum iio_block_state - State of a struct iio_dma_buffer_block > @@ -41,6 +45,8 @@ enum iio_block_state { > * @queue: Parent DMA buffer queue > * @kref: kref used to manage the lifetime of block > * @state: Current state of the block > + * @cyclic: True if this is a cyclic buffer > + * @fileio: True if this buffer is used for fileio mode kernel doc needs to be complete. So missing attach, sg_table and fence. > */ > struct iio_dma_buffer_block { > /* May only be accessed by the owner of the block */ > @@ -63,6 +69,14 @@ struct iio_dma_buffer_block { > * queue->list_lock if the block is not owned by the core. > */ > enum iio_block_state state; > + > + bool cyclic; > + bool fileio; > + > + struct dma_buf_attachment *attach; > + struct sg_table *sg_table; > + > + struct dma_fence *fence; > };