Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233109
b: refs/heads/master
c: 0f66e50
h: refs/heads/master
i:
  233107: 6346935
v: v3
  • Loading branch information
Sonic Zhang authored and Greg Kroah-Hartman committed Feb 3, 2011
1 parent 3e5c182 commit 924bdcf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e517f4b1de4787ecff87a73a9865a0b1aa2b10b
refs/heads/master: 0f66e50af53d39edebf4bc64ef90077e738c171f
2 changes: 2 additions & 0 deletions trunk/arch/blackfin/include/asm/bfin_serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define __BFIN_ASM_SERIAL_H__

#include <linux/serial_core.h>
#include <linux/spinlock.h>
#include <mach/anomaly.h>
#include <mach/bfin_serial.h>

Expand Down Expand Up @@ -41,6 +42,7 @@ struct bfin_serial_port {
struct circ_buf rx_dma_buf;
struct timer_list rx_dma_timer;
int rx_dma_nrows;
spinlock_t rx_lock;
unsigned int tx_dma_channel;
unsigned int rx_dma_channel;
struct work_struct tx_dma_workqueue;
Expand Down
15 changes: 6 additions & 9 deletions trunk/drivers/tty/serial/bfin_5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,8 @@ static irqreturn_t bfin_serial_rx_int(int irq, void *dev_id)
{
struct bfin_serial_port *uart = dev_id;

spin_lock(&uart->port.lock);
while (UART_GET_LSR(uart) & DR)
bfin_serial_rx_chars(uart);
spin_unlock(&uart->port.lock);

return IRQ_HANDLED;
}
Expand Down Expand Up @@ -490,9 +488,8 @@ void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart)
{
int x_pos, pos;

dma_disable_irq(uart->tx_dma_channel);
dma_disable_irq(uart->rx_dma_channel);
spin_lock_bh(&uart->port.lock);
dma_disable_irq_nosync(uart->rx_dma_channel);
spin_lock_bh(&uart->rx_lock);

/* 2D DMA RX buffer ring is used. Because curr_y_count and
* curr_x_count can't be read as an atomic operation,
Expand Down Expand Up @@ -523,8 +520,7 @@ void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart)
uart->rx_dma_buf.tail = uart->rx_dma_buf.head;
}

spin_unlock_bh(&uart->port.lock);
dma_enable_irq(uart->tx_dma_channel);
spin_unlock_bh(&uart->rx_lock);
dma_enable_irq(uart->rx_dma_channel);

mod_timer(&(uart->rx_dma_timer), jiffies + DMA_RX_FLUSH_JIFFIES);
Expand Down Expand Up @@ -571,7 +567,7 @@ static irqreturn_t bfin_serial_dma_rx_int(int irq, void *dev_id)
unsigned short irqstat;
int x_pos, pos;

spin_lock(&uart->port.lock);
spin_lock(&uart->rx_lock);
irqstat = get_dma_curr_irqstat(uart->rx_dma_channel);
clear_dma_irqstat(uart->rx_dma_channel);

Expand All @@ -589,7 +585,7 @@ static irqreturn_t bfin_serial_dma_rx_int(int irq, void *dev_id)
uart->rx_dma_buf.tail = uart->rx_dma_buf.head;
}

spin_unlock(&uart->port.lock);
spin_unlock(&uart->rx_lock);

return IRQ_HANDLED;
}
Expand Down Expand Up @@ -1332,6 +1328,7 @@ static int bfin_serial_probe(struct platform_device *pdev)
}

#ifdef CONFIG_SERIAL_BFIN_DMA
spin_lock_init(&uart->rx_lock);
uart->tx_done = 1;
uart->tx_count = 0;

Expand Down

0 comments on commit 924bdcf

Please sign in to comment.