From patchwork Fri Nov 7 18:05:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jon Medhurst (Tixy)" X-Patchwork-Id: 5254931 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 380E0C11AC for ; Fri, 7 Nov 2014 18:39:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DD9620123 for ; Fri, 7 Nov 2014 18:39:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0247B20121 for ; Fri, 7 Nov 2014 18:39:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751793AbaKGSjQ (ORCPT ); Fri, 7 Nov 2014 13:39:16 -0500 Received: from queue01c.mail.zen.net.uk ([212.23.3.237]:58279 "EHLO queue01c.mail.zen.net.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751459AbaKGSjQ (ORCPT ); Fri, 7 Nov 2014 13:39:16 -0500 X-Greylist: delayed 1958 seconds by postgrey-1.27 at vger.kernel.org; Fri, 07 Nov 2014 13:39:15 EST Received: from [212.23.1.1] (helo=smarthost01a.mail.zen.net.uk) by queue01c.mail.zen.net.uk with esmtp (Exim 4.72) (envelope-from ) id 1Xmnvh-0007lu-8G; Fri, 07 Nov 2014 18:06:37 +0000 Received: from [82.69.122.217] (helo=plug1) by smarthost01a.mail.zen.net.uk with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XmnvC-0000ZT-Me; Fri, 07 Nov 2014 18:06:06 +0000 Received: from linaro1 ([192.168.2.110] helo=linaro1.home) by plug1 with esmtp (Exim 4.80) (envelope-from ) id 1Xmnv9-0002Di-6p; Fri, 07 Nov 2014 18:06:03 +0000 Received: from tixy by linaro1.home with local (Exim 4.84) (envelope-from ) id 1Xmnv9-0007e0-4V; Fri, 07 Nov 2014 18:06:03 +0000 From: Jon Medhurst To: Vinod Koul , Dan Williams , dmaengine@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] dma: pl330: Limit MFIFO usage for memcpy to avoid exhausting entries Date: Fri, 7 Nov 2014 18:05:18 +0000 Message-Id: <1415383518-29327-3-git-send-email-tixy@linaro.org> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1415383518-29327-1-git-send-email-tixy@linaro.org> References: <1415383518-29327-1-git-send-email-tixy@linaro.org> X-Originating-smarthost01a-IP: [82.69.122.217] Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The MFIFO is shared by all channels so restrict each memcpy to it's fair share. This is being over cautious, but without a global view of DMA channel usage on a system it's not possible to come up with a more optimum safe limit. Signed-off-by: Jon Medhurst --- 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 8f869ec..849439a 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2336,7 +2336,7 @@ static inline int get_burst_len(struct dma_pl330_desc *desc, size_t len) int burst_len; burst_len = pl330->pcfg.data_bus_width / 8; - burst_len *= pl330->pcfg.data_buf_dep; + burst_len *= pl330->pcfg.data_buf_dep / pl330->pcfg.num_chan; burst_len >>= desc->rqcfg.brst_size; /* src/dst_burst_len can't be more than 16 */