linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sugar Zhang <sugar.zhang@rock-chips.com>,
	Vinod Koul <vkoul@kernel.org>, Sasha Levin <sashal@kernel.org>,
	dmaengine@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 18/23] dmaengine: pl330: _prep_dma_memcpy: Fix wrong burst size
Date: Wed, 25 Nov 2020 10:36:33 -0500	[thread overview]
Message-ID: <20201125153638.810419-18-sashal@kernel.org> (raw)
In-Reply-To: <20201125153638.810419-1-sashal@kernel.org>

From: Sugar Zhang <sugar.zhang@rock-chips.com>

[ 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 <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1605326106-55681-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 cd81d10974a29..57b6555d6d042 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2793,7 +2793,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


  parent reply	other threads:[~2020-11-25 15:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 15:36 [PATCH AUTOSEL 5.4 01/23] HID: uclogic: Add ID for Trust Flex Design Tablet Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 02/23] HID: ite: Replace ABS_MISC 120/121 events with touchpad on/off keypresses Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 03/23] HID: cypress: Support Varmilo Keyboards' media hotkeys Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 04/23] HID: add support for Sega Saturn Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 05/23] Input: i8042 - allow insmod to succeed on devices without an i8042 controller Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 06/23] HID: hid-sensor-hub: Fix issue with devices with no report ID Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 07/23] staging: ralink-gdma: fix kconfig dependency bug for DMA_RALINK Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 08/23] HID: add HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE for Gamevice devices Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 09/23] dmaengine: xilinx_dma: use readl_poll_timeout_atomic variant Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 10/23] x86/xen: don't unbind uninitialized lock_kicker_irq Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 11/23] HID: logitech-hidpp: Add HIDPP_CONSUMER_VENDOR_KEYS quirk for the Dinovo Edge Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 12/23] HID: Add Logitech Dinovo Edge battery quirk Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 13/23] proc: don't allow async path resolution of /proc/self components Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 14/23] nvme: free sq/cq dbbuf pointers when dbbuf set fails Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 15/23] vhost scsi: fix cmd completion race Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 16/23] vhost scsi: add lun parser helper Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 17/23] vhost scsi: Add support for LUN resets Sasha Levin
2020-11-25 15:36 ` Sasha Levin [this message]
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 19/23] scsi: libiscsi: Fix NOP race condition Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 20/23] scsi: target: iscsi: Fix cmd abort fabric stop race Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 21/23] perf/x86: fix sysfs type mismatches Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 22/23] xtensa: uaccess: Add missing __user to strncpy_from_user() prototype Sasha Levin
2020-11-25 15:36 ` [PATCH AUTOSEL 5.4 23/23] net: dsa: mv88e6xxx: Wait for EEPROM done after HW reset Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201125153638.810419-18-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=sugar.zhang@rock-chips.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).