Title: [8206] trunk/drivers/char/bfin_sport.c: bug[#5832]quickly jump out of error interrupt handler,when DMA tx interrupt handler is waiting for sport to complete transfer
- Revision
- 8206
- Author
- cliff
- Date
- 2010-01-21 02:14:30 -0500 (Thu, 21 Jan 2010)
Log Message
bug[#5832]quickly jump out of error interrupt handler,when DMA tx interrupt handler is waiting for sport to complete transfer
Modified Paths
Diff
Modified: trunk/drivers/char/bfin_sport.c (8205 => 8206)
--- trunk/drivers/char/bfin_sport.c 2010-01-21 02:18:16 UTC (rev 8205)
+++ trunk/drivers/char/bfin_sport.c 2010-01-21 07:14:30 UTC (rev 8206)
@@ -54,6 +54,7 @@
volatile struct sport_register *regs;
struct sport_config config;
+ int dma_tx_run;
};
/* XXX: this should get pushed to platform device */
@@ -285,7 +286,7 @@
dev->regs->tcr1 &= ~TSPEN;
SSYNC();
disable_dma(dev->dma_tx_chan);
-
+ dev->dma_tx_run = 0;
complete(&dev->c);
/* Clear the interrupt status */
@@ -399,6 +400,10 @@
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);
@@ -406,21 +411,16 @@
dev->regs->tcr1 &= ~TSPEN;
dev->regs->rcr1 &= ~RSPEN;
SSYNC();
-
- 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" : "");
+ 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,6 +640,7 @@
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