Title: [8228] trunk/drivers/char/bfin_sport.c: bug[#5832]disable err irq to avoid unwanted interrupt nest
Revision
8228
Author
cliff
Date
2010-01-25 01:19:54 -0500 (Mon, 25 Jan 2010)

Log Message

bug[#5832]disable err irq to avoid unwanted interrupt nest

Modified Paths

Diff

Modified: trunk/drivers/char/bfin_sport.c (8227 => 8228)


--- trunk/drivers/char/bfin_sport.c	2010-01-25 04:44:01 UTC (rev 8227)
+++ trunk/drivers/char/bfin_sport.c	2010-01-25 06:19:54 UTC (rev 8228)
@@ -54,7 +54,6 @@
 
 	volatile struct sport_register *regs;
 	struct sport_config config;
-	int dma_tx_run;
 };
 
 /* XXX: this should get pushed to platform device */
@@ -268,6 +267,7 @@
 	unsigned int status;
 
 	pr_debug("%s enter\n", __func__);
+	disable_irq(dev->err_irq);
 	status = get_dma_curr_irqstat(dev->dma_tx_chan);
 	while (status & DMA_RUN) {
 		pr_debug("status:0x%04x\n", status);
@@ -285,8 +285,9 @@
 
 	dev->regs->tcr1 &= ~TSPEN;
 	SSYNC();
+	enable_irq(dev->err_irq);
 	disable_dma(dev->dma_tx_chan);
-	dev->dma_tx_run = 0;
+
 	complete(&dev->c);
 
 	/* Clear the interrupt status */
@@ -400,10 +401,6 @@
 
 	if (status & (TOVF | TUVF | ROVF | RUVF)) {
 		dev->regs->stat = (status & (TOVF | TUVF | ROVF | RUVF));
-		if (dev->dma_tx_run && dev->config.dma_enabled) {
-			dev->regs->tcr1 &= ~TSPEN;
-			goto out;
-		}
 		if (dev->config.dma_enabled) {
 			disable_dma(dev->dma_rx_chan);
 			disable_dma(dev->dma_tx_chan);
@@ -411,16 +408,21 @@
 		dev->regs->tcr1 &= ~TSPEN;
 		dev->regs->rcr1 &= ~RSPEN;
 		SSYNC();
-		pr_warning("sport %p status error:%s%s%s%s\n",
-		       dev->regs,
-		       status & TOVF ? " TOVF" : "",
-		       status & TUVF ? " TUVF" : "",
-		       status & ROVF ? " ROVF" : "",
-		       status & RUVF ? " RUVF" : "");
+
+		if (!dev->config.dma_enabled && !dev->config.int_clk) {
+			if (status & TUVF)
+				complete(&dev->c);
+		} else
+			pr_warning("sport %p status error:%s%s%s%s\n",
+			       dev->regs,
+			       status & TOVF ? " TOVF" : "",
+			       status & TUVF ? " TUVF" : "",
+			       status & ROVF ? " ROVF" : "",
+			       status & RUVF ? " RUVF" : "");
 	}
 
 	/* XXX: should we always complete here and have read/write error ? */
-out:
+
 	return IRQ_HANDLED;
 }
 
@@ -640,7 +642,6 @@
 		set_dma_config(dev->dma_tx_chan, dma_config);
 
 		enable_dma(dev->dma_tx_chan);
-		dev->dma_tx_run = 1;
 	} else {
 		/* Configure parameters to start PIO transfer */
 		dev->tx_buf = buf;
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to