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: 1940731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 50617DF230 for ; Mon, 7 Jan 2013 11:29:09 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TsAoy-0000uE-EM; Mon, 07 Jan 2013 11:24:49 +0000 Received: from mail-wg0-f49.google.com ([74.125.82.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TsAoN-0000fO-HN for linux-arm-kernel@lists.infradead.org; Mon, 07 Jan 2013 11:24:12 +0000 Received: by mail-wg0-f49.google.com with SMTP id 15so9825611wgd.16 for ; Mon, 07 Jan 2013 03:24:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=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=dj0DjkFqnA6z6KcrrJy29H3onwBiMxDHyVOEVL3+RNVZ3Vh3f3Jt+sZ4TL+guRhyZi 0ebYQ2y/3Dr+QCqE1XQXpRmWdCnuDs5SM3gy42bZ/5eC0gngi5Esi/bH2JGPd5mRYGwu XUL8lrvhkFCpBpNhbP/xASDoYfNwdqhC+q3Iuva1Uk1bsIj9A92PIEhygeAUw8Wf8ZSR CyjuM+2v0kLYCk8gVBxsBpsGRwY9n0SsiCaZRMWJ1OJjHyecHRNGrZ0v9pOhdxv1Zojd l6WdOONlBVVx0p+xCITHEtuBKX7fpaVdZOkwZZ4zztzvYOgkm2+/zjYJQEROkalFKiBo 0Jmw== 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 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: ALoCoQnz52axH/lTXdCK6869qFye/HGTAckA6TiOC7ydOkG9Fp+X1GJlDTDDIgTnwsosCKIRvd8o X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130107_062411_981410_AD075C01 X-CRM114-Status: GOOD ( 12.14 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Rabin Vincent , Srinidhi Kasagar , Fabio Baltieri , Linus Walleij , linux-kernel@vger.kernel.org, Dan Williams , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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)