Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5077464rwe; Tue, 18 Apr 2023 01:31:56 -0700 (PDT) X-Google-Smtp-Source: AKy350byrgHY/WgpxmEv2gTZwdyt7qr62CN1UyhPw67VTvJ59laXuf+/sB+LLwxxHGvH7UY4ryUm X-Received: by 2002:a17:90b:3695:b0:247:173c:ba26 with SMTP id mj21-20020a17090b369500b00247173cba26mr1196981pjb.19.1681806715908; Tue, 18 Apr 2023 01:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681806715; cv=none; d=google.com; s=arc-20160816; b=zprfZSaMVfzNGqb570KXJMdU2dFUuikHCrRP8Kh7RXLnC78+IhQHNj0arHYRq9ysVe mr94ilMrCTjvYm8L4xrTdEkAkxYUtiRY01eMsU7aADOOFUtVNJDjuWbSdmcmZAu4EHcc RVWJGZXzyU4Nr1RrIZJpqvl8YRJ0gM8J0DRZADtsHyS94IX0VC0U+F7VNmcto7yggQhQ A31CYJUPDbUGWIEU9WQ0Hb8+eDtSrcNgtoC0DvJRAXquas/rXQib7n8g5V0QK47I8KSg 9zir+9SQNbOh3NYL4q6Ci3xbPNOXDBhncEJYpktn0ecH3cqj5/tfvnb/TgmxVawLFJK/ oYfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=8DTc/oRJhMEBa33wB3TaMgkNKc15dOmlHK8alGfdcJk=; b=aAWidApMQy/8QOEj0hOmrCu0MPtZubLxVVourd+63obnFUf4MavLpm8Mt7Rg0LziX9 z3+G94Ar7RqvsSEeud6VqZTexjP1GGXl6+EZKoJ64Pw0t61exXwldepf7xew3f621noG fgr1p6vvFfWCzMftNnLVEimqneVSVt6cMQM23RUABT2Mvwn8n3SR/4ETflBbhkEh02DQ GRUU5pZdFHwaT0uSkjFSq5t7MO5QFfmXkeIn7ly1OA0/W6AiluM3dyCGk2+a5cdC/QTm +l1DO9ARkvqB5DJ0XOEXlZ7+OXoS1fAPZrRduV/9/mytcZD46v6Thef/SvrLPp93S5JW 9dhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=i2y5XYqQ; 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=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv184-20020a632ec1000000b0050bedf49bb3si13666897pgb.821.2023.04.18.01.31.42; Tue, 18 Apr 2023 01:31:55 -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=@crapouillou.net header.s=mail header.b=i2y5XYqQ; 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=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231378AbjDRIKP (ORCPT + 99 others); Tue, 18 Apr 2023 04:10:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231502AbjDRIJz (ORCPT ); Tue, 18 Apr 2023 04:09:55 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 318907A99; Tue, 18 Apr 2023 01:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1681805303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8DTc/oRJhMEBa33wB3TaMgkNKc15dOmlHK8alGfdcJk=; b=i2y5XYqQS4KdTNNlpdITBztyfUED78n/aM0a3L19IR0dztlNgHD4h8kG3hHLJb6PE4BHyh BHoN5d/SlAU8cwhrU+rUiz49RLxT/CSXxujr6Onaz2R1d5d35D14IgL/OTfA4/HlL3/KGZ wp5ZiCeGY69eCgNlIg3o3Qf0vNWzzVk= Message-ID: <1f63ffced9ed18309401af9a885310e1715b6538.camel@crapouillou.net> Subject: Re: [PATCH v3 03/11] iio: buffer-dma: Get rid of outgoing queue From: Paul Cercueil To: Jonathan Cameron Cc: Lars-Peter Clausen , Vinod Koul , Michael Hennerich , Nuno =?ISO-8859-1?Q?S=E1?= , Sumit Semwal , Christian =?ISO-8859-1?Q?K=F6nig?= , 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 Date: Tue, 18 Apr 2023 10:08:21 +0200 In-Reply-To: <20230416152422.477ecf67@jic23-huawei> References: <20230403154800.215924-1-paul@crapouillou.net> <20230403154800.215924-4-paul@crapouillou.net> <20230416152422.477ecf67@jic23-huawei> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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, Le dimanche 16 avril 2023 =C3=A0 15:24 +0100, Jonathan Cameron a =C3=A9crit= =C2=A0: > On Mon,=C2=A0 3 Apr 2023 17:47:52 +0200 > Paul Cercueil wrote: >=20 > > The buffer-dma code was using two queues, incoming and outgoing, to > > manage the state of the blocks in use. > >=20 > > 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. > >=20 > > Since the new DMABUF based API wouldn't use the outgoing queue > > anyway, > > getting rid of it now makes the upcoming changes simpler. > >=20 > > With this change, the IIO_BLOCK_STATE_DEQUEUED is now useless, and > > can > > be removed. > >=20 > > Signed-off-by: Paul Cercueil > >=20 > > --- > > v2: - Only remove the outgoing queue, and keep the incoming queue, > > as we > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 want the buffer to start streaming data = as soon as it is > > enabled. > > =C2=A0=C2=A0=C2=A0 - Remove IIO_BLOCK_STATE_DEQUEUED, since it is now f= unctionally > > the > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 same as IIO_BLOCK_STATE_DONE. >=20 > I'm not that familiar with this code, but with my understanding this > makes > sense.=C2=A0=C2=A0 I think it is independent of the earlier patches and i= s a > useful > change in it's own right.=C2=A0 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.=C2=A0 No great rush as too late for the coming > merge > window anyway. Actually, you can pick patches 3 to 6 (when all have been acked). They add write support for buffer-dma implementations; which is a dependency for the rest of the patchset, but they can live on their own. Cheers, -Paul