From patchwork Wed Dec 12 09:37:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 13497 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 5E64F4C17AA for ; Wed, 12 Dec 2012 10:25:35 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id E6E1BA19365 for ; Wed, 12 Dec 2012 10:25:34 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1455820ieb.11 for ; Wed, 12 Dec 2012 02:25:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :resent-from:resent-date:resent-message-id:resent-to:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=TZoa8fman0/00cTKTXnrIh0pgSVkvbRPrpnnCKg9XnM=; b=Ee925T6m1k7b70I7YtnuoVBwAxGPSTbyfTyTjMppu/yHbLUqDXXoFec89hUArNXfB5 +vaMZS+TNeYaJNkeVA39dVfhoXDP95WiK+79zixWkoIz9GoMrVH3V5wGH+lKwZNaPoCZ y6MSNpUtrhdwrZoXqZxtxsAqxULN+rrN6X8rvs5P3fg/8acZTN2Lm7yklcHkb7mVWien 4Ev7Q1gRhb+S28XIArbYr80BMDwkdn1Y3b9MrPTgEJRNTgVwbJboGfAE34RQpE6Y6EE6 2aTw4RsiQfNl8Gj/jeobkAmHjvp0J3mYLZcCAZQ1c2VhuzTN8QPqEoiyItUdaVLmbO9y H4LA== Received: by 10.50.173.34 with SMTP id bh2mr376454igc.70.1355307934361; Wed, 12 Dec 2012 02:25:34 -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.50.67.148 with SMTP id n20csp190159igt; Wed, 12 Dec 2012 02:25:33 -0800 (PST) Received: by 10.14.194.199 with SMTP id m47mr1575025een.11.1355307933471; Wed, 12 Dec 2012 02:25:33 -0800 (PST) Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by mx.google.com with ESMTPS id q6si62217320eep.0.2012.12.12.02.25.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Dec 2012 02:25:33 -0800 (PST) Received-SPF: neutral (google.com: 74.125.83.49 is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) client-ip=74.125.83.49; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.83.49 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-ee0-f49.google.com with SMTP id c4so297665eek.36 for ; Wed, 12 Dec 2012 02:25:33 -0800 (PST) Received: by 10.14.209.193 with SMTP id s41mr1581517eeo.9.1355307932924; Wed, 12 Dec 2012 02:25:32 -0800 (PST) Received: from localhost ([2a01:2003:1:1d66:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPS id b2sm55038702eep.9.2012.12.12.02.25.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Dec 2012 02:25:32 -0800 (PST) Resent-From: Fabio Baltieri Resent-Date: Wed, 12 Dec 2012 11:25:24 +0100 Resent-Message-ID: <20121212102524.GG10536@balto.lan> Resent-To: patches@linaro.org Received: from localhost ([2a01:2003:1:1d66:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPS id b49sm54842625eem.16.2012.12.12.01.38.27 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Dec 2012 01:38:29 -0800 (PST) From: Fabio Baltieri To: Linus Walleij , Srinidhi Kasagar Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rabin Vincent , Fabio Baltieri Subject: [PATCH 6/7] dmaengine: ste_dma40: don't allow high priority dest event lines Date: Wed, 12 Dec 2012 10:37:20 +0100 Message-Id: <1355305041-2338-7-git-send-email-fabio.baltieri@linaro.org> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1355305041-2338-1-git-send-email-fabio.baltieri@linaro.org> References: <1355305041-2338-1-git-send-email-fabio.baltieri@linaro.org> X-Gm-Message-State: ALoCoQnEMFnbcqa8STJUrCf9+Xx1fP76kIe07ULTQeC1TmtGuaKDSF6ruWhtLuaZYzB6V/sZL2M8 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 d8d58d9..f871df6 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2181,11 +2181,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)