Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1647962pxb; Fri, 13 Nov 2020 20:05:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwd6iwLCHwAGkGHyg/ik1sCpsGZVzTYLrKWL2tfU7ilF9+tcRcu0NhcknVh8luuafvgIvbn X-Received: by 2002:a50:f604:: with SMTP id c4mr5711212edn.117.1605326708389; Fri, 13 Nov 2020 20:05:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605326708; cv=none; d=google.com; s=arc-20160816; b=R1cv2lhjf4hPBzRDfGBAKPT6OEpsfpW6mk/DnS3qXvuBOEjAVnD0oWXh7PD88iS7oK Gy9Rcc8mn1ssHC/f9o1nzBOPUQtzSD9u9bNL342Lw0gBy2nk3PSCtj6c+Mdv//+g7aUo a1dbQf6krcXpdLCJdjPxz016bAD/j8AIHnLI3wykQ+8EZHYXOS0ewLAnaWeLsmrz3AXh ZmA2Jdc3VjeZhg/U4f2wn285lHBu/uOxShbwxQz2IE6v33jNcrIwyeuLraGbbvsFov+Z ruyobFs4apBMk6eohBbsAX/tIzRc3UPtwbaG4JN7u/FR5v0eOL1YN+PmUj1fyBgp6o0P UNig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=sKMpQ5ne3bJcHp039ucX4CLTfNzBoilljNLxxSGAOuY=; b=Xq1xsvtZUTytS8yoe5WE70bnZonGNRLQy0lp+MIKf00LybNZFNKg6g5wIIqHuiPepY zXincvk7r+SEMj4Df2tQ7vOip1xNOK2gvjis7DtvVPcepdhJ/B72FUI8UkS+E67jnY5F vYe5ZU84NYXA180vQYa1JSW8+teQ9H6aK3OlfttV3zjNexmLdwjKHqXvTkAWI3H5zkN+ aGjhc/KZ/rfxKfOqN9PSeLIZEbI21H4c1sWiufzWXxxmQ1J2OfBt6kDb3SmnF+6g3PqR qPZC1O5moN8MD5I1Vi3IVPWH/Zri1y/XGGI+x0BQJRdTBmGUAJon9aeXCDEVrecRthlc EnUQ== 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 lj26si6648010ejb.663.2020.11.13.20.04.45; Fri, 13 Nov 2020 20:05:08 -0800 (PST) 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 S1726228AbgKNEDS (ORCPT + 99 others); Fri, 13 Nov 2020 23:03:18 -0500 Received: from lucky1.263xmail.com ([211.157.147.134]:46722 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbgKNEDR (ORCPT ); Fri, 13 Nov 2020 23:03:17 -0500 X-Greylist: delayed 388 seconds by postgrey-1.27 at vger.kernel.org; Fri, 13 Nov 2020 23:02:08 EST Received: from localhost (unknown [192.168.167.70]) by lucky1.263xmail.com (Postfix) with ESMTP id 0B240C49BF; Sat, 14 Nov 2020 11:55:32 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P27840T140553139496704S1605326130614637_; Sat, 14 Nov 2020 11:55:31 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <6d5c2be54c926e753545094f68123e26> X-RL-SENDER: sugar.zhang@rock-chips.com X-SENDER: zxg@rock-chips.com X-LOGIN-NAME: sugar.zhang@rock-chips.com X-FST-TO: vkoul@kernel.org X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 From: Sugar Zhang To: vkoul@kernel.org Cc: linux-rockchip@lists.infradead.org, Sugar Zhang , Dan Williams , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] dmaengine: pl330: _prep_dma_memcpy: Fix wrong burst size Date: Sat, 14 Nov 2020 11:55:06 +0800 Message-Id: <1605326106-55681-1-git-send-email-sugar.zhang@rock-chips.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Actually, burst size is equal to '1 << desc->rqcfg.brst_size'. we should use burst size, not desc->rqcfg.brst_size. dma memcpy performance on Rockchip RV1126 @ 1512MHz A7, 1056MHz LPDDR3, 200MHz DMA: dmatest: /# echo dma0chan0 > /sys/module/dmatest/parameters/channel /# echo 4194304 > /sys/module/dmatest/parameters/test_buf_size /# echo 8 > /sys/module/dmatest/parameters/iterations /# echo y > /sys/module/dmatest/parameters/norandom /# echo y > /sys/module/dmatest/parameters/verbose /# echo 1 > /sys/module/dmatest/parameters/run dmatest: dma0chan0-copy0: result #1: 'test passed' with src_off=0x0 dst_off=0x0 len=0x400000 dmatest: dma0chan0-copy0: result #2: 'test passed' with src_off=0x0 dst_off=0x0 len=0x400000 dmatest: dma0chan0-copy0: result #3: 'test passed' with src_off=0x0 dst_off=0x0 len=0x400000 dmatest: dma0chan0-copy0: result #4: 'test passed' with src_off=0x0 dst_off=0x0 len=0x400000 dmatest: dma0chan0-copy0: result #5: 'test passed' with src_off=0x0 dst_off=0x0 len=0x400000 dmatest: dma0chan0-copy0: result #6: 'test passed' with src_off=0x0 dst_off=0x0 len=0x400000 dmatest: dma0chan0-copy0: result #7: 'test passed' with src_off=0x0 dst_off=0x0 len=0x400000 dmatest: dma0chan0-copy0: result #8: 'test passed' with src_off=0x0 dst_off=0x0 len=0x400000 Before: dmatest: dma0chan0-copy0: summary 8 tests, 0 failures 48 iops 200338 KB/s (0) After this patch: dmatest: dma0chan0-copy0: summary 8 tests, 0 failures 179 iops 734873 KB/s (0) After this patch and increase dma clk to 400MHz: dmatest: dma0chan0-copy0: summary 8 tests, 0 failures 259 iops 1062929 KB/s (0) Signed-off-by: Sugar Zhang --- drivers/dma/pl330.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index e9f0101..0f5c193 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2799,7 +2799,7 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst, * If burst size is smaller than bus width then make sure we only * transfer one at a time to avoid a burst stradling an MFIFO entry. */ - if (desc->rqcfg.brst_size * 8 < pl330->pcfg.data_bus_width) + if (burst * 8 < pl330->pcfg.data_bus_width) desc->rqcfg.brst_len = 1; desc->bytes_requested = len; -- 2.7.4