From patchwork Fri Dec 5 13:14:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jassi Brar X-Patchwork-Id: 41975 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2A65226669 for ; Fri, 5 Dec 2014 13:17:06 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id e53sf493607eek.3 for ; Fri, 05 Dec 2014 05:17:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=CcWdUyP7RwgE1PFbP+RkxsXDPsbnMl/3yBQHXAJ1QV4=; b=RMXfPuwuFTQP50yn9VAT1FOSRiceMEbwcrSkV7aKTxJBpRyZVpHsH+lB86pd4L5RxV 4vzg0rYr3a55mPDEH3S0yFLqTKpunVuaK0h+HmgRddG3tteW3tuLmPaV9peujr6w13eK ctVmceRJsrOkCEvY6W2uypM35Bc9yghgY3RzMRpnNTwmS6lmOTIxBdtxxWBjeZNPglsb AGxKrZ56bOtSydUei0WXAx3YVikZ/YFL3Iy0VY1uHIKw5A8EfQIn1s2uIY+YwoBHbJab cYIFHQqI0kWnalb0m5yGW+bgMYfCLYyHfNYOhwVWmz+lwoCGUZuEe6uBetuRGYdy1Kkv mwFw== X-Gm-Message-State: ALoCoQkf1fjJ+Ug1hzTkOi1qfhYaY5C25T2GJvEL/p/3aD378yla6sxkElstzMtBdQA/rWTet9kM X-Received: by 10.112.53.39 with SMTP id y7mr3410674lbo.8.1417785425348; Fri, 05 Dec 2014 05:17:05 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.226 with SMTP id z2ls393989lal.5.gmail; Fri, 05 Dec 2014 05:17:05 -0800 (PST) X-Received: by 10.112.138.9 with SMTP id qm9mr2934907lbb.62.1417785425009; Fri, 05 Dec 2014 05:17:05 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id qu3si28940100lbb.27.2014.12.05.05.17.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Dec 2014 05:17:04 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id l4so497972lbv.40 for ; Fri, 05 Dec 2014 05:17:04 -0800 (PST) X-Received: by 10.152.2.165 with SMTP id 5mr2916115lav.40.1417785424915; Fri, 05 Dec 2014 05:17:04 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp207173lbc; Fri, 5 Dec 2014 05:17:04 -0800 (PST) X-Received: by 10.70.23.99 with SMTP id l3mr28255538pdf.86.1417785423311; Fri, 05 Dec 2014 05:17:03 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id fe7si40625221pdb.87.2014.12.05.05.17.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Dec 2014 05:17:03 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XwsjX-0000gQ-Gm; Fri, 05 Dec 2014 13:15:43 +0000 Received: from mail-pa0-f51.google.com ([209.85.220.51]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XwsjT-0000ep-WB for linux-arm-kernel@lists.infradead.org; Fri, 05 Dec 2014 13:15:40 +0000 Received: by mail-pa0-f51.google.com with SMTP id ey11so672912pad.24 for ; Fri, 05 Dec 2014 05:15:18 -0800 (PST) X-Received: by 10.70.23.99 with SMTP id l3mr28241378pdf.86.1417785317988; Fri, 05 Dec 2014 05:15:17 -0800 (PST) Received: from localhost.localdomain ([59.89.161.135]) by mx.google.com with ESMTPSA id jd1sm28909410pbd.49.2014.12.05.05.15.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Dec 2014 05:15:17 -0800 (PST) From: Jassi Brar To: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] dma: pl330: revert commit 04abf5daf7d Date: Fri, 5 Dec 2014 18:44:56 +0530 Message-Id: <1417785296-4435-1-git-send-email-jaswinder.singh@linaro.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141205_051540_057901_F384B91E X-CRM114-Status: GOOD ( 12.90 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.51 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.220.51 listed in wl.mailspike.net] Cc: vinod.koul@intel.com, Jassi Brar , lars@metafoo.de, linux@arm.linux.org.uk X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: jaswinder.singh@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 >From Documentation/crypto/async-tx-api.txt "... Once a driver-specific threshold is met the driver automatically issues pending operations. An application can force this event by calling async_tx_issue_pending_all() ..." That is, the DMA controller drivers may buffer transfer requests for optimization. However it is perfectly legal to start dma as soon as the user calls .tx_submit() on the descriptor, as the documentation specifies in include/linux/dmaengine.h It is also consistent with the expected behaviour. For example, if a channel is already active when a client submits a request, we do not expect the channel to stop after the current request is done and wait for explicit issue_pending() from the user (the user has already done prep() and submit()) on the last request. Signed-off-by: Jassi Brar --- drivers/dma/pl330.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 19a9974..8ec5f1f 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -411,9 +411,7 @@ struct dma_pl330_chan { /* DMA-Engine Channel */ struct dma_chan chan; - /* List of submitted descriptors */ - struct list_head submitted_list; - /* List of issued descriptors */ + /* List of to be xfered descriptors */ struct list_head work_list; /* List of completed descriptors */ struct list_head completed_list; @@ -2084,11 +2082,6 @@ static int pl330_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, unsigned pch->thread->req_running = -1; /* Mark all desc done */ - list_for_each_entry(desc, &pch->submitted_list, node) { - desc->status = FREE; - dma_cookie_complete(&desc->txd); - } - list_for_each_entry(desc, &pch->work_list , node) { desc->status = FREE; dma_cookie_complete(&desc->txd); @@ -2099,7 +2092,6 @@ static int pl330_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, unsigned dma_cookie_complete(&desc->txd); } - list_splice_tail_init(&pch->submitted_list, &pl330->desc_pool); list_splice_tail_init(&pch->work_list, &pl330->desc_pool); list_splice_tail_init(&pch->completed_list, &pl330->desc_pool); spin_unlock_irqrestore(&pch->lock, flags); @@ -2158,14 +2150,7 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie, static void pl330_issue_pending(struct dma_chan *chan) { - struct dma_pl330_chan *pch = to_pchan(chan); - unsigned long flags; - - spin_lock_irqsave(&pch->lock, flags); - list_splice_tail_init(&pch->submitted_list, &pch->work_list); - spin_unlock_irqrestore(&pch->lock, flags); - - pl330_tasklet((unsigned long)pch); + pl330_tasklet((unsigned long) to_pchan(chan)); } /* @@ -2192,11 +2177,11 @@ static dma_cookie_t pl330_tx_submit(struct dma_async_tx_descriptor *tx) dma_cookie_assign(&desc->txd); - list_move_tail(&desc->node, &pch->submitted_list); + list_move_tail(&desc->node, &pch->work_list); } cookie = dma_cookie_assign(&last->txd); - list_add_tail(&last->node, &pch->submitted_list); + list_add_tail(&last->node, &pch->work_list); spin_unlock_irqrestore(&pch->lock, flags); return cookie; @@ -2680,7 +2665,6 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) else pch->chan.private = adev->dev.of_node; - INIT_LIST_HEAD(&pch->submitted_list); INIT_LIST_HEAD(&pch->work_list); INIT_LIST_HEAD(&pch->completed_list); spin_lock_init(&pch->lock);