Skip to content

Commit

Permalink
Merge branch 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/gregkh/tty-2.6

* 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6:
  serial: bfin_5xx: split uart RX lock from uart port lock to avoid deadlock
  68360serial: Plumb in rs_360_get_icount()
  n_gsm: copy mtu over when configuring via ioctl interface
  virtio: console: Move file back to drivers/char/
  • Loading branch information
Linus Torvalds committed Feb 10, 2011
2 parents b477958 + 0f66e50 commit ce86d35
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
2 changes: 2 additions & 0 deletions 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
1 change: 1 addition & 0 deletions drivers/char/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ obj-$(CONFIG_SYNCLINK_GT) += synclink_gt.o
obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o
obj-$(CONFIG_SX) += sx.o generic_serial.o
obj-$(CONFIG_RIO) += rio/ generic_serial.o
obj-$(CONFIG_VIRTIO_CONSOLE) += virtio_console.o
obj-$(CONFIG_RAW_DRIVER) += raw.o
obj-$(CONFIG_SGI_SNSC) += snsc.o snsc_event.o
obj-$(CONFIG_MSPEC) += mspec.o
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <linux/virtio_console.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include "hvc_console.h"
#include "../tty/hvc/hvc_console.h"

/*
* This is a global struct for storing common data for all the devices
Expand Down
1 change: 0 additions & 1 deletion drivers/tty/hvc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ obj-$(CONFIG_HVC_XEN) += hvc_xen.o
obj-$(CONFIG_HVC_IUCV) += hvc_iucv.o
obj-$(CONFIG_HVC_UDBG) += hvc_udbg.o
obj-$(CONFIG_HVCS) += hvcs.o
obj-$(CONFIG_VIRTIO_CONSOLE) += virtio_console.o
1 change: 1 addition & 0 deletions drivers/tty/n_gsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2414,6 +2414,7 @@ static int gsmld_config(struct tty_struct *tty, struct gsm_mux *gsm,

gsm->initiator = c->initiator;
gsm->mru = c->mru;
gsm->mtu = c->mtu;
gsm->encoding = c->encapsulation;
gsm->adaption = c->adaption;
gsm->n2 = c->n2;
Expand Down
1 change: 1 addition & 0 deletions drivers/tty/serial/68360serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -2428,6 +2428,7 @@ static const struct tty_operations rs_360_ops = {
/* .read_proc = rs_360_read_proc, */
.tiocmget = rs_360_tiocmget,
.tiocmset = rs_360_tiocmset,
.get_icount = rs_360_get_icount,
};

static int __init rs_360_init(void)
Expand Down
15 changes: 6 additions & 9 deletions 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 ce86d35

Please sign in to comment.