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: 5443751 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 1E7B9BEEA8 for ; Fri, 5 Dec 2014 13:15:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1ACCF20295 for ; Fri, 5 Dec 2014 13:15:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16C0D20272 for ; Fri, 5 Dec 2014 13:15:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751009AbaLENPT (ORCPT ); Fri, 5 Dec 2014 08:15:19 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:46287 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750800AbaLENPS (ORCPT ); Fri, 5 Dec 2014 08:15:18 -0500 Received: by mail-pd0-f181.google.com with SMTP id v10so683737pde.12 for ; Fri, 05 Dec 2014 05:15:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5Sgvyvia78HJqtcRN7eBDSL2vUx1c255wNHMZZ4SI9s=; b=P9h9wPoYGKtsCL+zuo+CVT9H4zckuLt/ewdu8CUmtTG3ruL4Su8ZQb3/9TyqTzSdIC 89T9+WRVQdml6VxkHkCW4q3Kn9DJ1FrER9df3fjMxrTb/1+niMHAbXDwjYsl93yAdQBp yJAse4vdqUoqozGjDOmmxsMk7csYJA49lpIr26VP1nWYPLkUkidYBkh/Wjd0o3pdsrQX 5Ucp07GH2hGESgO1t7ZTDLvp5OcQy27pfOZeExl1HndcalcgWLYJQ3LxrnR1mlwL9aI+ yL74eW9c1jNvWcixPV+w8mZyEVjXfv7U9B/HIOPJZYABuAXkzzRp9t7G7ZzyKpfUcEmr d2UQ== X-Gm-Message-State: ALoCoQkWu6ksEAaheebEH4NitYVQ6bFBMU498RiycaKytIbVvFHmUel6+y9JpmGlcGszUWHIYJBX 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 Cc: vinod.koul@intel.com, lars@metafoo.de, linux@arm.linux.org.uk, Jassi Brar 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 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 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);