From patchwork Tue Sep 28 12:24:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Yanok X-Patchwork-Id: 65963 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id B8CB2B7178 for ; Tue, 28 Sep 2010 22:50:43 +1000 (EST) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by ozlabs.org (Postfix) with ESMTP id 815B8B70E9 for ; Tue, 28 Sep 2010 22:25:29 +1000 (EST) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id CD1EC1C15808; Tue, 28 Sep 2010 14:25:16 +0200 (CEST) X-Auth-Info: EuH5qZgGQF7gI2oN8+HhLG6Xr7hYAAK3SyjpUblCcmk= Received: from mail.denx.de (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id C4A771C0037E; Tue, 28 Sep 2010 14:25:16 +0200 (CEST) Received: from pollux.denx.de (pollux [192.168.1.1]) by mail.denx.de (Postfix) with ESMTP id B489B40BCE7E; Tue, 28 Sep 2010 14:25:16 +0200 (CEST) Received: by pollux.denx.de (Postfix, from userid 547) id A9E32101174A2; Tue, 28 Sep 2010 14:25:16 +0200 (CEST) From: Ilya Yanok To: linuxppc-dev@lists.ozlabs.org, wd@denx.de, dzu@denx.de, vlad@emcraft.com Subject: [PATCH 2/3] mpc512x_dma: fix the hanged transfer issue Date: Tue, 28 Sep 2010 14:24:55 +0200 Message-Id: <1285676696-5358-3-git-send-email-yanok@emcraft.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1285676696-5358-1-git-send-email-yanok@emcraft.com> References: <1285676696-5358-1-git-send-email-yanok@emcraft.com> Cc: Piotr Ziecik , Ilya Yanok X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Current code clears interrupt active status _after_ submiting new transfers. This leaves a possibility of clearing the interrupt for this new transfer (if it is triggered fast enough) and thus lose this interrupt. We want to clear interrupt active status _before_ new transfers is submited and for current channel only. Signed-off-by: Ilya Yanok Cc: Piotr Ziecik --- drivers/dma/mpc512x_dma.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c index 1bc04aa..0717527 100644 --- a/drivers/dma/mpc512x_dma.c +++ b/drivers/dma/mpc512x_dma.c @@ -276,6 +276,9 @@ static void mpc_dma_irq_process(struct mpc_dma *mdma, u32 is, u32 es, int off) spin_lock(&mchan->lock); + out_8(&mdma->regs->dmacint, ch + off); + out_8(&mdma->regs->dmacerr, ch + off); + /* Check error status */ if (es & (1 << ch)) list_for_each_entry(mdesc, &mchan->active, node) @@ -309,12 +312,6 @@ static irqreturn_t mpc_dma_irq(int irq, void *data) mpc_dma_irq_process(mdma, in_be32(&mdma->regs->dmaintl), in_be32(&mdma->regs->dmaerrl), 0); - /* Ack interrupt on all channels */ - out_be32(&mdma->regs->dmainth, 0xFFFFFFFF); - out_be32(&mdma->regs->dmaintl, 0xFFFFFFFF); - out_be32(&mdma->regs->dmaerrh, 0xFFFFFFFF); - out_be32(&mdma->regs->dmaerrl, 0xFFFFFFFF); - /* Schedule tasklet */ tasklet_schedule(&mdma->tasklet);