Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752996AbbD0LwX (ORCPT ); Mon, 27 Apr 2015 07:52:23 -0400 Received: from www.linutronix.de ([62.245.132.108]:47736 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752842AbbD0LwV (ORCPT ); Mon, 27 Apr 2015 07:52:21 -0400 From: John Ogness To: linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org Cc: Sekhar Nori Cc: Peter Ujfalusi Cc: Greg Kroah-Hartman Cc: Sebastian Andrzej Siewior Subject: [PATCH 1/3] ARM: common: edma: clear completion interrupts on stop Date: Mon, 27 Apr 2015 13:52:15 +0200 Message-ID: <87wq0xaivk.fsf@linutronix.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1272 Lines: 34 When stopping a DMA transfer with interrupts disabled it is possible that the DMA transfer completes before the events are cleared. In this case the completion interrupt will be pending, causing a completion callback after the transfer was stopped. By clearing the completion interrupt for the stopping channel it is ensured that no completion event will be generated after the stop. Signed-off-by: John Ogness --- arch/arm/common/edma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c index 5662a87..873dbfc 100644 --- a/arch/arm/common/edma.c +++ b/arch/arm/common/edma.c @@ -1350,6 +1350,9 @@ void edma_stop(unsigned channel) edma_shadow0_write_array(ctlr, SH_SECR, j, mask); edma_write_array(ctlr, EDMA_EMCR, j, mask); + /* clear possibly pending completion interrupt */ + edma_shadow0_write_array(ctlr, SH_ICR, j, mask); + pr_debug("EDMA: EER%d %08x\n", j, edma_shadow0_read_array(ctlr, SH_EER, j)); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/