Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp405290pxu; Tue, 1 Dec 2020 14:26:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1XWydUie0CpcJGcUR/xq0FqZbiu8I6cq8kVO0rY8Hd910PGIakFtBG1bU7bmxKvCcVa8r X-Received: by 2002:a17:906:b793:: with SMTP id dt19mr5334901ejb.120.1606861563964; Tue, 01 Dec 2020 14:26:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861563; cv=none; d=google.com; s=arc-20160816; b=fogeX9Zex2nC/Jx1AmsD4RC66I9Ap5SRbR+BI7dObSFBM9ysoFpQ3YiTpVddigacFP PY8qYMOju7lzcyMcxz/eUuM9JEH7IH4RihyomdppsxLvk2i5wzzOrp5T+hzSjDWigRTU kI5h74s68h0yO81uUJhkSG5Hnyo/S1gOzV91A2Ej43GI0QjpaTpjZyI0Kj+/N22ysbuF saG4crZ/r4FToIiHEKhB+x4q9YA+Buxi3JB2RETt5hNHEfe80B4lcIkSkju2fC299pfp 2939VjQD5JVLeWIM0sdlD5T/3sMEKfuEDEvm/bHv0BLW6BKbqe4aqFRXTARL9b9pixHz 72wg== 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=4bYukZuU9n+D3diSD3zW9JKglDoaKkQp/rsvbZ2PtV4=; b=jzywfs2RJvAXSMRtc2tp2/YdgWDqeDXHb3WJmhEYHX5yCXRM3BEHe+0JTqzymJg0Dp 3f/RVlo5Sj2Detd2LFLZxiA4P4rAIrChv2E6OurCdDZEc8CMwRoes7Fu2GMmVDhrDTge 8dt5wym9Jh4Ds15PGKcJQFKNwQH627IPqT95SEQPPx/bkHOGbOA29xXlSunt6n2UccGK P4y0N6TsRnyuLGBfeuIj6nspRTbwQ+/AjyXiiBKxfza1wWhzdBW8daFbrPgqKceO/n5U 38k5pElGGfh6h05SAPa21/uM2JoeVxLGpawk38VCfdOK7OmQYKtXqKuTLOBPcCJiI8Di DuNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FlzumnBi; 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 p14si756490ejf.275.2020.12.01.14.25.41; Tue, 01 Dec 2020 14:26:03 -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=FlzumnBi; 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 S2389750AbgLAJKn (ORCPT + 99 others); Tue, 1 Dec 2020 04:10:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:48196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389732AbgLAJKi (ORCPT ); Tue, 1 Dec 2020 04:10:38 -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 C36B122240; Tue, 1 Dec 2020 09:09:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813791; bh=4/iLExguJ1tDhA1BXY/9athNkJAZVQDynwf9L9ClHE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FlzumnBizLqKp97Bg3oXk3YeLqJt03LUXBheQI0xdSuBdH+T4xCczn8STCgSifnO4 SgpE61s9CwwUuZhEXaLnhqiskCEiLOweyT1+rNGKQkPUZN6rFNYrbLAq7g5G9OLfHP 0yh3fAOFK9acycPxsBLnJmT/EIA7/TBLgRdoiD1s= 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 5.9 061/152] dmaengine: pl330: _prep_dma_memcpy: Fix wrong burst size Date: Tue, 1 Dec 2020 09:52:56 +0100 Message-Id: <20201201084719.903487658@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084711.707195422@linuxfoundation.org> References: <20201201084711.707195422@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 5274a0704d960..2c3c47e4f7770 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2802,7 +2802,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