Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp72453ybt; Thu, 9 Jul 2020 15:49:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2qL03XtyMVop+q0qBoyOWfI5WAE3dDQEcmgv872nQl/G3V0L84HZf/+HEXlVGKreebz1I X-Received: by 2002:a05:6402:318d:: with SMTP id di13mr65534699edb.172.1594334992995; Thu, 09 Jul 2020 15:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594334992; cv=none; d=google.com; s=arc-20160816; b=cgaXo+V41jK3zQLF+SzUvyWHVBDDgDFgTYRBI8f56NhpXhSDAlc2Z3kKQnNwIeRAj4 4irZ1omwtHcwA+6sVKFLyGmKmkMZLeIAVvY2jh5cQUNhfXfLW98Rh7poXho7+vRicRcI DIsV83fIZlVixl/vv0jDFBKExbadNjDMkJVPIMZ3dou0QXeqsw/VCujDHmJtd0PX0R3w GtE5di6bjA4z16Z3H+MK8DSD3GMmvK2AJcjPgvAykPe2MmcG6yv3CjNFW9ISdmuTaGSN zgEqKxQho6omfaqSDQd2efgib+WySYRtmw3nAwbr4DsiaTEiFnlUWRvFUZhuX6cYDQDd bIDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=PJXjttvpVXTFaXvNi1YoNlPLIawcCuvd5+pbYlYouA4=; b=glY/i69ee1rnkeXee8DJDSmH848CkqDNw5xcFZgKC2Dg4tLCEh5Pucn+sQwUbCmW2u CgMfl8pYSmjcUC0R4UdIjr3YzMnd1bmqXQEmN9E/+n7PZ4Li1LIEg3yRxY0z+0bLuc/C RV3HLcXy34/xXr5B1GsbStlH/DeJnYJ+GD8D1imK+FCbJbo2MjFX3C1+qlDAPWLLUd3I qh4waRmyZqDvupO6L9+8ELZcdxT2a6gvZIBPUbAolxflOFlIbPOd3QVUGkOU/vuHSSzN yh55u7QghH+WUYt0jZhIsgrY9/yUxOfytKtWAnYvaEJHl0/biKD0cYK3zIYhSLyvg0iQ a6KA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g13si2568802edy.128.2020.07.09.15.49.30; Thu, 09 Jul 2020 15:49:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727066AbgGIWqv (ORCPT + 99 others); Thu, 9 Jul 2020 18:46:51 -0400 Received: from mail.baikalelectronics.com ([87.245.175.226]:48236 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727067AbgGIWqT (ORCPT ); Thu, 9 Jul 2020 18:46:19 -0400 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id 3C5FA8040A6C; Thu, 9 Jul 2020 22:46:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NrafgdSSK6TI; Fri, 10 Jul 2020 01:46:13 +0300 (MSK) From: Serge Semin To: Vinod Koul , Viresh Kumar , Andy Shevchenko , Dan Williams CC: Serge Semin , Serge Semin , Alexey Malahov , Thomas Bogendoerfer , Arnd Bergmann , Rob Herring , , , , Subject: [PATCH v7 07/11] dmaengine: dw: Set DMA device max segment size parameter Date: Fri, 10 Jul 2020 01:45:46 +0300 Message-ID: <20200709224550.15539-8-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20200709224550.15539-1-Sergey.Semin@baikalelectronics.ru> References: <20200709224550.15539-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Maximum block size DW DMAC configuration corresponds to the max segment size DMA parameter in the DMA core subsystem notation. Lets set it with a value specific to the probed DW DMA controller. It shall help the DMA clients to create size-optimized SG-list items for the controller. This in turn will cause less dw_desc allocations, less LLP reinitializations, better DMA device performance. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org --- Changelog v2: - This is a new patch created in place of the dropped one: "dmaengine: dw: Add LLP and block size config accessors". Changelog v3: - Use the block_size found for the very first channel instead of looking for the maximum of maximum block sizes. - Don't define device-specific device_dma_parameters object, since it has already been defined by the platform device core. --- drivers/dma/dw/core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index 33e99d95b3d3..fb95920c429e 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c @@ -1229,6 +1229,13 @@ int do_dma_probe(struct dw_dma_chip *chip) BIT(DMA_MEM_TO_MEM); dw->dma.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; + /* + * For now there is no hardware with non uniform maximum block size + * across all of the device channels, so we set the maximum segment + * size as the block size found for the very first channel. + */ + dma_set_max_seg_size(dw->dma.dev, dw->chan[0].block_size); + err = dma_async_device_register(&dw->dma); if (err) goto err_dma_register; -- 2.26.2