From patchwork Wed Feb 24 03:52:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caesar Wang X-Patchwork-Id: 8398511 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EBD42C0553 for ; Wed, 24 Feb 2016 03:53:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2277C202C8 for ; Wed, 24 Feb 2016 03:53:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F886202BE for ; Wed, 24 Feb 2016 03:53:32 +0000 (UTC) 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 1aYQW3-0006rW-65; Wed, 24 Feb 2016 03:53:31 +0000 Received: from mail-pf0-f174.google.com ([209.85.192.174]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYQW0-0006kQ-Bm for linux-rockchip@lists.infradead.org; Wed, 24 Feb 2016 03:53:29 +0000 Received: by mail-pf0-f174.google.com with SMTP id q63so4819505pfb.0 for ; Tue, 23 Feb 2016 19:53:07 -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=a8Pp9jTGY4Bl/DGbwgA0gQ4ZLgcdIldNe0fi4X9th/Y=; b=UgJBnGIiO4v4sTBeGkoQFKCA9Xom3hj0d/XfS+ubMta/6oBUlLso8/CHuD5XhLrERH 4FM1dFZHio5vBGO4Pr2Wie8QENsUa1vDH9POUsk4Qg4Yp7I+BfeqwgMSiFeq0sIAyiMF Fd+HSOqAWK53l0SsoNxzxXqyZD6qnooeBMKDYQq0pLPiPxWs+/kUwC0dqySP+bN6xyUE 2iPK8fP1P0/DwuAwJRhpWkvfSwWCfPik1pfCSD8LXX7iuNkQo4HUF1TmbGYWPIQEhdVn BjiPZxm2rCT0e5TawJQZHTy6CKLNaWyPG+uy+lI2DqyHCH4cOJg3PfP7JYuIa5bgh25m t+cw== X-Gm-Message-State: AG10YOR3eNWYm76TEk6fM/35O5EzLFzcu36B5dnpYwBX9Fg+ocmnNon1GyT2Lpide3ruXw== X-Received: by 10.98.15.135 with SMTP id 7mr50962033pfp.142.1456285987376; Tue, 23 Feb 2016 19:53:07 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id qh8sm833079pac.40.2016.02.23.19.53.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Feb 2016 19:53:06 -0800 (PST) From: Caesar Wang To: dinguyen@opensource.altera.com, vinod.koul@intel.com Subject: [PATCH] dmaengine: pl330: fix to support the brust mode Date: Wed, 24 Feb 2016 11:52:25 +0800 Message-Id: <1456285945-19258-1-git-send-email-wxt@rock-chips.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160223_195328_433379_4CA13D30 X-CRM114-Status: GOOD ( 10.62 ) X-Spam-Score: -2.4 (--) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, al.kochet@gmail.com, shawn.lin@rock-chips.com, boojin.kim@samsung.com, dianders@chromium.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, dmaengine@vger.kernel.org, dan.j.williams@intel.com, sonnyrao@chromium.org, Caesar Wang MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 This patch fixes the brust mode that will break DMA uart on SoCFPGA. In some cases, some SoCS didn't support the multi-brust even if the devices who use the pl330 claim support the maxbrust. Fixes: commit 848e977 "dmaengine: pl330: support burst mode for dev-to-mem and mem-to-dev transmit" Reported-by: Dinh Nguyen Signed-off-by: Caesar Wang Tested-by: Dinh Nguyen Tested-by: Dinh Nguyen --- drivers/dma/pl330.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 1b0453b..372b435 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -1161,7 +1161,7 @@ static inline int _ldst_devtomem(struct pl330_dmac *pl330, unsigned dry_run, if (pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP) cond = BURST; else - cond = (pxs->desc->rqcfg.brst_len == 1) ? SINGLE : BURST; + cond = SINGLE; while (cyc--) { off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri); @@ -1186,8 +1186,7 @@ static inline int _ldst_memtodev(struct pl330_dmac *pl330, if (pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP) cond = BURST; else - cond = (pxs->desc->rqcfg.brst_len == 1) ? SINGLE : BURST; - + cond = SINGLE; while (cyc--) { off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri); @@ -2598,7 +2597,7 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic( desc->rqtype = direction; desc->rqcfg.brst_size = pch->burst_sz; - desc->rqcfg.brst_len = pch->burst_len; + desc->rqcfg.brst_len = 1; desc->bytes_requested = period_len; fill_px(&desc->px, dst, src, period_len); @@ -2743,7 +2742,7 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, } desc->rqcfg.brst_size = pch->burst_sz; - desc->rqcfg.brst_len = pch->burst_len; + desc->rqcfg.brst_len = 1; desc->rqtype = direction; desc->bytes_requested = sg_dma_len(sg); }