From patchwork Thu Feb 25 01:00:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caesar Wang X-Patchwork-Id: 8415671 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 5F103C0553 for ; Thu, 25 Feb 2016 01:02:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 763862022A for ; Thu, 25 Feb 2016 01:02:42 +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 9E5FD20253 for ; Thu, 25 Feb 2016 01:02:41 +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 1aYkKF-0000q1-5L; Thu, 25 Feb 2016 01:02:39 +0000 Received: from mail-pa0-f67.google.com ([209.85.220.67]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYkKD-0000aI-2d for linux-rockchip@lists.infradead.org; Thu, 25 Feb 2016 01:02:37 +0000 Received: by mail-pa0-f67.google.com with SMTP id yy13so1826271pab.1 for ; Wed, 24 Feb 2016 17:02:15 -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=7G2qM53lN4Q4vyvm6XRBZLSskL3LWgnZsfqTLcqw+7Q=; b=bRF+nPRMmxskP1a71XYH7QDMUxnnh+Z0U3iw/ZGC4zmT0E9lVkqOnfV1fzbvKSumez QI9YszUna+wymW4zYRCVaaq99QCnHNMeDae5FmmA3n3mw3iPtxusE6+G+OK0ugNt2xJ6 A9I3XH0GPdc4GNgSJqn+y4KMIr3IUDwfmEV8QLXVi08fjZwnGmOV7jaPtJgEzEQNAAS7 H6EcIjWpbBj91F7JqVopvzGv+TYrhSuBDhPS3FJJGNJvOklm8thNhfgADh0+x3jDF51U JDgulctnF0wakKkbwHobczB6HhH3vyBuqyvRnV5GTJvGln3aWsuDtbVR4Gnovr+grVkS PswQ== X-Gm-Message-State: AG10YORyYGtluPoxqEZZogYc6XDGivJpC8RHF+6MozGYh6PNJHODEU/R20JlOwg1aQcfiQ== X-Received: by 10.66.228.97 with SMTP id sh1mr51904760pac.77.1456362135376; Wed, 24 Feb 2016 17:02:15 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id 6sm7602548pfo.58.2016.02.24.17.02.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Feb 2016 17:02:14 -0800 (PST) From: Caesar Wang To: vinod.koul@intel.com Subject: [PATCH v2] dmaengine: pl330: fix to support the burst mode Date: Thu, 25 Feb 2016 09:00:53 +0800 Message-Id: <1456362053-1425-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-20160224_170237_220307_D19097AD X-CRM114-Status: GOOD ( 11.07 ) 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, b.zolnierkie@samsung.com, linux-kernel@vger.kernel.org, dianders@chromium.org, linux-rockchip@lists.infradead.org, dmaengine@vger.kernel.org, dinguyen@opensource.altera.com, sonnyrao@chromium.org, dan.j.williams@intel.com, 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 burst mode that will break DMA uart on SoCFPGA. In some cases, some SoCS didn't support the multi-burst even if the devices who use the pl330 claim support the maxburst. 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: Bartlomiej Zolnierkiewicz Tested-by: Dinh Nguyen --- Changes in v2: - s/brust/burst - add Dinh and Bartlomiej test tags. 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); }