Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4293691pxu; Tue, 1 Dec 2020 01:03:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxs2dY5wrkUh9jxI/F8GktS7VxozdkKNWfzgdXiKrx7ZjNsZE79hYiSg8VxwDOgxBXMu7xc X-Received: by 2002:a50:b243:: with SMTP id o61mr1978527edd.57.1606813396370; Tue, 01 Dec 2020 01:03:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606813396; cv=none; d=google.com; s=arc-20160816; b=zIiU5/rySHj5NtceWB3VUdkkPUdh/ni7iQRXELZ9xsXBrlEk7l1msvi6DKKG4ojf3a bQaE0s+JXrx3UEaC8sZ2lNSon1l8kWlwRjn7kxcxEZLwrzDpmccHSJEBQMx0/57hNZLT V+30yXnaDbKpWx4Ysw5wW/nZALnju+6HRDko0VJNJkGkeFv2ZUW71Eq1pX5m0lBN/Mu7 RGaxvP1V3MRw4z2sKlVfbiSyH/01rn1Lme4ljpQdHg2Ezpjsv0YafKa70V0JlX1A7ASX 3mnOyq8vwgqS6DD81xTXVRFHmnHC5928ShXkAGvpMx6Pucv/NyQIU9EuAX2Tla4CjvtK PdeA== 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=aP3LP0EVkVmhWzFc5wuZkwNxf5lFDoE/SMYtDpSE90A=; b=tUdixD6ox9OhuOP2C/zD8zpz4GlsAgJFpl3Kdo5U0wf5UkE/+DIIzZd9kZ9955NQ11 nmE6bGAOiA0ZoOCzlPRemAJ4GRtCanR5ZtXE+2WmYzyF2qlv0B7Z57HVSzcqzRdx0CdU WDPEq09yhE/Hb7fbTgkmDMptQDZ3bnmydRrtjYYIpKDyg87fVfxSXzEFYCaLqL/MtgGl jZnaT8qZSqAtMft7OQNkF7q2r6CoVKL+ZRA4Hp7AmQAk5v7tpiNm9uyDPuAa4OrHPWfP yUaCp2yMYz0YXOIm/pb/k/qRfsrsG4MI+ZlHpEWgzJZe5vzfhG5jeL9A5zAxnH4gdUgh 2iIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ubZZ4ojA; 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 v11si658420edt.532.2020.12.01.01.02.53; Tue, 01 Dec 2020 01:03:16 -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=ubZZ4ojA; 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 S2388226AbgLAI76 (ORCPT + 99 others); Tue, 1 Dec 2020 03:59:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:35858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388213AbgLAI7y (ORCPT ); Tue, 1 Dec 2020 03:59:54 -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 7005E2222E; Tue, 1 Dec 2020 08:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813154; bh=s04otEKyyrUeTCStCHfLrx++jbsvN6FsIIB0dPDYNPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ubZZ4ojAz/C/AOKyepFDBGZpqTHnLqfEfNSrrosQug48c1xBfq0vC8/I/Cr9ykDtt UTK2jxx4A/RvU/uGUbmQpJ6al6VfQTTc1O67xOJu7mjQZXRnNAFOMucQi0XegkUZHM 0OZU2vjHUHgkoUBdZkoM//KeK8DsgsPDJefVhKxY= 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.14 22/50] dmaengine: pl330: _prep_dma_memcpy: Fix wrong burst size Date: Tue, 1 Dec 2020 09:53:21 +0100 Message-Id: <20201201084647.834515954@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084644.803812112@linuxfoundation.org> References: <20201201084644.803812112@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 ff8b7042d28f4..c034f506e015a 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2666,7 +2666,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