From patchwork Thu Feb 7 10:38:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alvaro Moran X-Patchwork-Id: 2110001 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 6E9DA3FDF1 for ; Thu, 7 Feb 2013 10:44:03 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U3OuR-0004hW-F8; Thu, 07 Feb 2013 10:40:51 +0000 Received: from mail-wi0-f179.google.com ([209.85.212.179]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U3OuP-0004hC-I1 for linux-arm-kernel@lists.infradead.org; Thu, 07 Feb 2013 10:40:50 +0000 Received: by mail-wi0-f179.google.com with SMTP id ez12so2675877wid.12 for ; Thu, 07 Feb 2013 02:40:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=aIOtrLEkPyBgYZVgNxLl/CMesPRmnl81lGItmcnRayU=; b=rgLWp+BD9g30p7b+dPpU/ybuMp7aW3rhOqw5Jh8FL9UVWl9xtjLh+U2kZMuzOkj7LV BQB91yRxI3MAkFo+UKx90iF20Ntth0WA16TzNNozLnpQBbtyWH8X3MpzJ6XaMJwnRNp1 mTa2eBCm8x42eJ0eAD1JuMUSp1FGx7mJfqpIubB1i1JB5G4rzWXT6ltHIinA3aGVZD1D mOcYG9jEFLMagBloRug8orIrDsVcn24waIk5b7zuhb65ofb2SgQT8eX+wI9jRsLloYGj V39QOm8eBHqwUXuFVE18El+5FDHTov14dKgdCVuW53qgeOZUbY6dGfNZVMNPCoFwRmuG FC5A== X-Received: by 10.194.161.135 with SMTP id xs7mr1542195wjb.41.1360233647613; Thu, 07 Feb 2013 02:40:47 -0800 (PST) Received: from maquina.parrot.biz ([46.218.109.82]) by mx.google.com with ESMTPS id cu7sm7807630wib.8.2013.02.07.02.40.45 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Feb 2013 02:40:46 -0800 (PST) From: Alvaro Moran To: Russell King - ARM Linux Subject: [PATCH 1/1] DMA: PL330: allow submitting 2 requests at a time Date: Thu, 7 Feb 2013 11:38:43 +0100 Message-Id: <1360233523-20825-1-git-send-email-dirac3000@gmail.com> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130207_054049_714062_8DB17B46 X-CRM114-Status: GOOD ( 14.54 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (dirac3000[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.179 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (dirac3000[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Alvaro Moran , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Due to the original driver design, only one request was processed at a time by the driver, even if the low-level part of the driver was able to handle 2 requests. With this patch we are able to create 2 microcodes per thread and to launch the second transfer on the interrupt handler of the first one, instead of having to wait for the tasklet to generate the microcode. Signed-off-by: Alvaro Moran --- drivers/dma/pl330.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 80680ee..7814f8e 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -486,6 +486,8 @@ struct pl330_thread { /* Index of the last submitted request or -1 if the DMA is stopped */ int req_running; }; +/* We handle two requests at a time */ +#define NR_MAX_REQUESTS 2 enum pl330_dmac_state { UNINIT, @@ -2276,13 +2278,18 @@ static inline void handle_cyclic_desc_list(struct list_head *list) static inline void fill_queue(struct dma_pl330_chan *pch) { struct dma_pl330_desc *desc; + int busy_reqs = 0; int ret; list_for_each_entry(desc, &pch->work_list, node) { /* If already submitted */ - if (desc->status == BUSY) - break; + if (desc->status == BUSY) { + busy_reqs++; + if (busy_reqs == NR_MAX_REQUESTS) + break; + continue; + } ret = pl330_submit_req(pch->pl330_chid, &desc->req);