From patchwork Mon Jan 7 11:21:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 13869 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1916923EC8 for ; Mon, 7 Jan 2013 11:24:11 +0000 (UTC) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by fiordland.canonical.com (Postfix) with ESMTP id CA79BA188FA for ; Mon, 7 Jan 2013 11:24:10 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id p1so18882239vcq.24 for ; Mon, 07 Jan 2013 03:24:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=yYLMPg+sCwt/UX37/eUMg1the1qiB1ujbr+umLmVFjE=; b=ghVSiegCJGKHGMgSIijf37zzQbnxLUBupN8j59J7DlSVa6p6IlqUag+Pahq7iC9In8 1SsBgc2DT2p81JP07bk2NMYe/BjJhJAAc+8OviDIJ1lJ86LajYjtJhpJvtNDWWTHB3Em Yyuh5Dyb6jpu8zvdrn/JWD9Y4wojD9rYq1G2kUyLHKzXmkpWz6rF+oSc84rt3VibXhTF uKPVPO92UyWc9/7fRe/gzN4mR/eiWnrxwYMe0fV45nhtSHxC6szciz6E0ie+syYyXV29 Ed14YpuqlZI09TjRs1e+KZTVm8/NfvakiHJ6CX4MuNvRv6RgmYX4mKmCToPWZVksh8tZ glNg== X-Received: by 10.220.157.9 with SMTP id z9mr82704002vcw.45.1357557850334; Mon, 07 Jan 2013 03:24:10 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp56242veb; Mon, 7 Jan 2013 03:24:09 -0800 (PST) X-Received: by 10.180.95.135 with SMTP id dk7mr8686249wib.29.1357557849325; Mon, 07 Jan 2013 03:24:09 -0800 (PST) Received: from mail-wg0-x22a.google.com ([2a00:1450:400c:c00::22a]) by mx.google.com with ESMTPS id y1si87357132wje.37.2013.01.07.03.24.09 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 03:24:09 -0800 (PST) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::22a is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) client-ip=2a00:1450:400c:c00::22a; Authentication-Results: mx.google.com; spf=neutral (google.com: 2a00:1450:400c:c00::22a is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) smtp.mail=fabio.baltieri@linaro.org Received: by mail-wg0-f42.google.com with SMTP id dr1so2140626wgb.1 for ; Mon, 07 Jan 2013 03:24:08 -0800 (PST) X-Received: by 10.180.92.36 with SMTP id cj4mr8647043wib.23.1357557848918; Mon, 07 Jan 2013 03:24:08 -0800 (PST) Received: from localhost ([2a01:2029:1:11e3:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPS id i2sm11654964wiw.3.2013.01.07.03.24.02 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 07 Jan 2013 03:24:08 -0800 (PST) From: Fabio Baltieri To: Vinod Koul Cc: Dan Williams , Linus Walleij , Srinidhi Kasagar , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rabin Vincent , Fabio Baltieri Subject: [PATCH 06/16] dmaengine: ste_dma40: don't allow high priority dest event lines Date: Mon, 7 Jan 2013 12:21:48 +0100 Message-Id: <1357557718-15676-7-git-send-email-fabio.baltieri@linaro.org> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1357557718-15676-1-git-send-email-fabio.baltieri@linaro.org> References: <1357557718-15676-1-git-send-email-fabio.baltieri@linaro.org> X-Gm-Message-State: ALoCoQmJprEyrQAAdAB8p2/4iDdwypDH9rrOhdDcMukkiBzVtFAEJ/7g2qkQbCAu9WPsjxyAGKIJ From: Rabin Vincent Hardware bug: when a logical channel is triggerred by a high priority destination event line, an extra packet transaction is generated in case of important data write response latency on previous logical channel A and if the source transfer of current logical channel B is already completed and if no other channel with a higher priority than B is waiting for execution. Software workaround: do not set the high priority level for the destination event lines that trigger logical channels. Signed-off-by: Rabin Vincent Reviewed-by: Shreshtha Kumar Sahu Acked-by: Linus Walleij Signed-off-by: Fabio Baltieri --- drivers/dma/ste_dma40.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 760576b..9f8964a 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2180,11 +2180,24 @@ static void __d40_set_prio_rt(struct d40_chan *d40c, int dev_type, bool src) { bool realtime = d40c->dma_cfg.realtime; bool highprio = d40c->dma_cfg.high_priority; - u32 prioreg = highprio ? D40_DREG_PSEG1 : D40_DREG_PCEG1; u32 rtreg = realtime ? D40_DREG_RSEG1 : D40_DREG_RCEG1; u32 event = D40_TYPE_TO_EVENT(dev_type); u32 group = D40_TYPE_TO_GROUP(dev_type); u32 bit = 1 << event; + u32 prioreg; + + /* + * Due to a hardware bug, in some cases a logical channel triggered by + * a high priority destination event line can generate extra packet + * transactions. + * + * The workaround is to not set the high priority level for the + * destination event lines that trigger logical channels. + */ + if (!src && chan_is_logical(d40c)) + highprio = false; + + prioreg = highprio ? D40_DREG_PSEG1 : D40_DREG_PCEG1; /* Destination event lines are stored in the upper halfword */ if (!src)