From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2580FC43334 for ; Tue, 21 Jun 2022 12:53:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350623AbiFUMxq (ORCPT ); Tue, 21 Jun 2022 08:53:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344117AbiFUMxo (ORCPT ); Tue, 21 Jun 2022 08:53:44 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C918D12761; Tue, 21 Jun 2022 05:53:43 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B303D165C; Tue, 21 Jun 2022 05:53:43 -0700 (PDT) Received: from [10.57.85.30] (unknown [10.57.85.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 508173F534; Tue, 21 Jun 2022 05:53:42 -0700 (PDT) Message-ID: Date: Tue, 21 Jun 2022 13:53:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] dmaengine: sun6i: Set the maximum segment size Content-Language: en-GB To: Samuel Holland , Chen-Yu Tsai , Jernej Skrabec , Vinod Koul Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev References: <20220617034209.57337-1-samuel@sholland.org> From: Robin Murphy In-Reply-To: <20220617034209.57337-1-samuel@sholland.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-06-17 04:42, Samuel Holland wrote: > The sun6i DMA engine supports segment sizes up to 2^25-1 bytes. This is > explicitly stated in newer SoC documentation (H6, D1), and it is implied > in older documentation by the 25-bit width of the "bytes left in the > current segment" register field. > > Exposing the real segment size limit (instead of the 64k default) > reduces the number of SG list segments needed for a transaction. > > Signed-off-by: Samuel Holland > --- > Tested on A64, verified that the maximum ALSA PCM period increased, and > that audio playback still worked. > > drivers/dma/sun6i-dma.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c > index b7557f437936..1425f87d97b7 100644 > --- a/drivers/dma/sun6i-dma.c > +++ b/drivers/dma/sun6i-dma.c > @@ -9,6 +9,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -1334,6 +1335,8 @@ static int sun6i_dma_probe(struct platform_device *pdev) > INIT_LIST_HEAD(&sdc->pending); > spin_lock_init(&sdc->lock); > > + dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(25)); Similarly to my comment on the DRM patch, "SZ_32M - 1" might be clearer here. Thanks, Robin. > + > dma_cap_set(DMA_PRIVATE, sdc->slave.cap_mask); > dma_cap_set(DMA_MEMCPY, sdc->slave.cap_mask); > dma_cap_set(DMA_SLAVE, sdc->slave.cap_mask);