Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp2892428rwe; Sun, 16 Apr 2023 07:30:23 -0700 (PDT) X-Google-Smtp-Source: AKy350bqNG5HPTdS/O2NZDe+RWwjN/7J77HS0V25nhYQMCatYI8YlojppjgZSgLNPueQlL3Pspu7 X-Received: by 2002:a17:902:e848:b0:1a1:97b5:c660 with SMTP id t8-20020a170902e84800b001a197b5c660mr11536069plg.20.1681655423367; Sun, 16 Apr 2023 07:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681655423; cv=none; d=google.com; s=arc-20160816; b=mYyKnVObKeamO34/iDgZIPQhev1iURd+jrMXAmSFmxxoiquOBOewbyIF+l0rEop5xu sjt6Aot6Lu36NBjIKM85Wznqjhc7g72O85r53iqlnNIiWekOHTlNhbNeyM7m/1Bl4lVz LsQukmdGpdTO4/uDFf8jPiKOLfceUsiCQpOoOZ87p+f6GM02S8Mv4OsZ6pObL6gtzTdq 1NkLmQqTWXeG25eUygtLyPC1L9auBjGYzJ2Bc5LwH6CkKvrUDySvz5T+WUDf2nOybn4C f3Et8lGYSAZZ+1IoVE7mohgc1DZ6zr2oMSq8rgHZfKV+3GbsuDhRlfh0R1sxwScwxDY2 mEbw== 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 :dkim-signature; bh=gVdwFRcc+64/G96OfnlCm9A/DsaMMae8nSVJsSLmHZw=; b=L0zubq2rkCA+EcaREGK4C1JGDYUiAQwbNqKmJrTy+EnGw5RPsxmsphAQwMN9lQBNA0 8w2Lvc+RA529gz239unRFw5dStd04MxrEK15t51dPEDBV5iT2GQaNbxvSTEPROwN59OT 036kwJIMQqAeyZ8B9aFVwbYluZTZdhtK1cORv1+LnZrIkXK3wc6Hw5Ke0s4KNUNd9mpN 6J9/0o0pZyCWzK/8xW1ykDuXI2OEDeBiFjti04Q1746eQ72c5+WWTsTMeWMMQKcJecr8 pPVxtTBISFim/dBgXJ5vc1OjMvQYXaUayohHlcwbV4e4PARqrIqoCRMoX0DtNNdLUCny 620A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Wt/oOFIO"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a170902dac700b001a1f70cc7dbsi10632481plx.562.2023.04.16.07.30.09; Sun, 16 Apr 2023 07:30:23 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Wt/oOFIO"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbjDPOY0 (ORCPT + 99 others); Sun, 16 Apr 2023 10:24:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230365AbjDPOYY (ORCPT ); Sun, 16 Apr 2023 10:24:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A18B2D4C; Sun, 16 Apr 2023 07:24:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CA650611AA; Sun, 16 Apr 2023 14:24:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5246C433EF; Sun, 16 Apr 2023 14:24:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681655062; bh=DRmjqzj0vppDmwa+O86tDrM1feeK6o2CP6HsH/iSM5g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Wt/oOFIOb7ClzTlXeE51KP9dzjzQfnpaiY0WTAv4NobCq54yPwX5qV/qjjK/b0RrA cpavE5HEA9pj+xEdppDeLnD/JC67azwEuGpvp6wlEFOrandFtCm1FLhthsjnoARCsp XbNcXBC/3+tzrgybHGZg2B/Z5GdRPXfgWYT6g5oal0L863CtHpHi3Z6ZUIdoWsrG6H fvHFyV6Zl1d/K/RanvVcGEJV8WMozjP5AR1oxJ/JIAkgq8r2+bL3UVAVQGJocbYUZU 2RxLvisVOdPSoWac6/WZtNAFJhHG2iDLOUYXsZ6B59lSpqZLjEIBxDfmVr42E/nhhT 3e1p5nnM2kGlA== Date: Sun, 16 Apr 2023 15:24:22 +0100 From: Jonathan Cameron To: Paul Cercueil Cc: Lars-Peter Clausen , Vinod Koul , Michael Hennerich , Nuno =?UTF-8?B?U8Oh?= , Sumit Semwal , Christian =?UTF-8?B?S8O2bmln?= , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-iio@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH v3 03/11] iio: buffer-dma: Get rid of outgoing queue Message-ID: <20230416152422.477ecf67@jic23-huawei> In-Reply-To: <20230403154800.215924-4-paul@crapouillou.net> References: <20230403154800.215924-1-paul@crapouillou.net> <20230403154800.215924-4-paul@crapouillou.net> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 On Mon, 3 Apr 2023 17:47:52 +0200 Paul Cercueil wrote: > The buffer-dma code was using two queues, incoming and outgoing, to > manage the state of the blocks in use. > > While this totally works, it adds some complexity to the code, > especially since the code only manages 2 blocks. It is much easier to > just check each block's state manually, and keep a counter for the next > block to dequeue. > > Since the new DMABUF based API wouldn't use the outgoing queue anyway, > getting rid of it now makes the upcoming changes simpler. > > With this change, the IIO_BLOCK_STATE_DEQUEUED is now useless, and can > be removed. > > Signed-off-by: Paul Cercueil > > --- > v2: - 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. I'm not that familiar with this code, but with my understanding this makes sense. I think it is independent of the earlier patches and is a useful change in it's own right. As such, does it make sense to pick this up ahead of the rest of the series? I'm assuming that discussion on the rest will take a while. No great rush as too late for the coming merge window anyway. Thanks, Jonathan