Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp409070pxu; Tue, 1 Dec 2020 14:32:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqC4V9tsYfS++joMvOXwYzqbNHcXWBWr0SaDu0yCnqdisZMsFqdm9363IKM26niCkJiZC+ X-Received: by 2002:a17:906:e212:: with SMTP id gf18mr5274902ejb.551.1606861960825; Tue, 01 Dec 2020 14:32:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861960; cv=none; d=google.com; s=arc-20160816; b=zic8d0oB7Bx4hEI6nrM3shRQlTCHAFL+zXRlCJHALWT3JgiRF/hoPYxd/IJXz0Hx6e 201laFz1Czu/kx2zZo5KofvVxX+pamiiRnt/IWws3SAASF2pjt/s+VH3tr8ZG/VL2BH7 EfRz7TatYqQTth/oq3TiWDFCUnay0375peLxmrnZgBcWbpmVdubbJbc9yWAZZ8cu4c3Z KumQjFB+5yTX1mt7KobJ3zmRuqHdO0kOIkwrUM7kfb7n79tzMCZB95t5F4u+6FykfaHl n84tThV/sa/EwhD3vhvdUHncsVfxS3/CODu5EbJm2JATV91RSpQA6gclL1L6ZoKJ8h7J CGJA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OtzU6yWNRGF/iWT3kmr6AebirGl3K9D2YKbu0boMQRE=; b=ZHF1NcHz+uvTa/K6jvwkUJAQ8zi2XA2LvDcSJzAJTp82w9xm3hKUY11RZEioPeXEbQ 3j/2b/tRfbZsoaBsFXgFo2AP5CwK8w0N/9panuvelEfgkOQ21tr7UUL+ZyEHMRvzK2yy 09kzzZ/J/SrZpNXP+TRh7RT3isthDB6++QLuBTok6PmjeK7t2pE4+pSWe1hp2sOcFekD OpeYHUOiNlxeu1Ibdbw9q602eLAKcNSkl1BFHw5jvAxqu75soNV3fmo5oa7gJP2Glea5 JW6qMFxl9xdjZwb/hJ8lBsj37AmCc5hhC+9C+ebQDBNqaN9sHo7u/PtT32YZeAezb7u4 1FfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kOw273b9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f21si835108ejk.90.2020.12.01.14.32.18; Tue, 01 Dec 2020 14:32:40 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kOw273b9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388485AbgLAJ2N (ORCPT + 99 others); Tue, 1 Dec 2020 04:28:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:37348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388426AbgLAJBI (ORCPT ); Tue, 1 Dec 2020 04:01:08 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3193722242; Tue, 1 Dec 2020 09:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813221; bh=S9eKUfI1sM2UNJ0xmIPknHAu2yzvwnfytp8fUGQskxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kOw273b9og1/LZiSRbhsIrBArSScvYu2EcCNcw5zS+KfOvvcfwLYcMv+DRpA7W17m YRv7qYFPizFvV2WAsNmHF1H8Bt8gSE3BtSBa/cW/TpZnaqVphyGnFiyV3Pt0O52qoc 2ICoicYHEFKhAytm3AJGOdoJB+seRXvK95x9nkiY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sugar Zhang , Vinod Koul , Sasha Levin Subject: [PATCH 4.19 23/57] dmaengine: pl330: _prep_dma_memcpy: Fix wrong burst size Date: Tue, 1 Dec 2020 09:53:28 +0100 Message-Id: <20201201084650.322935613@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084647.751612010@linuxfoundation.org> References: <20201201084647.751612010@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sugar Zhang [ Upstream commit e773ca7da8beeca7f17fe4c9d1284a2b66839cc1 ] 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 Link: https://lore.kernel.org/r/1605326106-55681-1-git-send-email-sugar.zhang@rock-chips.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- 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 c564df713efc3..15b30d2d8f7ed 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2774,7 +2774,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.27.0