diff options
author | Jiri Slaby <jslaby@suse.cz> | 2011-04-20 04:43:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-25 17:19:11 -0400 |
commit | 7fdc28931176a17ef0bdc5d35742925a155533c4 (patch) | |
tree | 6a13bfc4de8289649af0b5eb9878e882accba639 | |
parent | 6d742f655efe767dc77a099b57297fa417afc473 (diff) |
Char: nozomi, remove useless tty_sem
tty_sem used to protect tty open count. This was removed in 33dd474a
but the lock remained in place.
So remove it completely as it protects nothing now.
Also this solves Mac's problem with inatomic operation called from
atomic context (ppp):
BUG: scheduling while atomic: firefox-bin/1992/0x10000800
Modules linked in: ...
Pid: 1992, comm: firefox-bin Not tainted 2.6.38 #1
Call Trace:
...
[] ? mutex_lock+0xe/0x21
[] ? ntty_write+0x5d/0x192 [nozomi]
[] ? __mod_timer.clone.30+0xbe/0xcc
[] ? check_preempt_curr+0x60/0x6d
[] ? __nf_ct_refresh_acct+0x75/0xbe
[] ? ppp_async_push+0xa9/0x3bd [ppp_async]
[] ? ppp_async_send+0x34/0x40 [ppp_async]
[] ? ppp_push+0x6c/0x4f9 [ppp_generic]
...
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reported-by: Mac <kmac@poczta.fm>
Tested-by: Gerald Pfeifer <gerald@pfeifer.com>
Reviewed-by: Jack Stone <jwjstone@fastmail.fm>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/tty/nozomi.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c index c34d622dace4..b1aecc7bb32a 100644 --- a/drivers/tty/nozomi.c +++ b/drivers/tty/nozomi.c | |||
@@ -364,8 +364,6 @@ struct port { | |||
364 | u8 toggle_ul; | 364 | u8 toggle_ul; |
365 | u16 token_dl; | 365 | u16 token_dl; |
366 | 366 | ||
367 | /* mutex to ensure one access patch to this port */ | ||
368 | struct mutex tty_sem; | ||
369 | wait_queue_head_t tty_wait; | 367 | wait_queue_head_t tty_wait; |
370 | struct async_icount tty_icount; | 368 | struct async_icount tty_icount; |
371 | 369 | ||
@@ -1474,7 +1472,6 @@ static int __devinit nozomi_card_init(struct pci_dev *pdev, | |||
1474 | struct device *tty_dev; | 1472 | struct device *tty_dev; |
1475 | struct port *port = &dc->port[i]; | 1473 | struct port *port = &dc->port[i]; |
1476 | port->dc = dc; | 1474 | port->dc = dc; |
1477 | mutex_init(&port->tty_sem); | ||
1478 | tty_port_init(&port->port); | 1475 | tty_port_init(&port->port); |
1479 | port->port.ops = &noz_tty_port_ops; | 1476 | port->port.ops = &noz_tty_port_ops; |
1480 | tty_dev = tty_register_device(ntty_driver, dc->index_start + i, | 1477 | tty_dev = tty_register_device(ntty_driver, dc->index_start + i, |
@@ -1688,8 +1685,6 @@ static int ntty_write(struct tty_struct *tty, const unsigned char *buffer, | |||
1688 | if (!dc || !port) | 1685 | if (!dc || !port) |
1689 | return -ENODEV; | 1686 | return -ENODEV; |
1690 | 1687 | ||
1691 | mutex_lock(&port->tty_sem); | ||
1692 | |||
1693 | rval = kfifo_in(&port->fifo_ul, (unsigned char *)buffer, count); | 1688 | rval = kfifo_in(&port->fifo_ul, (unsigned char *)buffer, count); |
1694 | 1689 | ||
1695 | /* notify card */ | 1690 | /* notify card */ |
@@ -1714,7 +1709,6 @@ static int ntty_write(struct tty_struct *tty, const unsigned char *buffer, | |||
1714 | spin_unlock_irqrestore(&dc->spin_mutex, flags); | 1709 | spin_unlock_irqrestore(&dc->spin_mutex, flags); |
1715 | 1710 | ||
1716 | exit: | 1711 | exit: |
1717 | mutex_unlock(&port->tty_sem); | ||
1718 | return rval; | 1712 | return rval; |
1719 | } | 1713 | } |
1720 | 1714 | ||
@@ -1733,11 +1727,9 @@ static int ntty_write_room(struct tty_struct *tty) | |||
1733 | int room = 4096; | 1727 | int room = 4096; |
1734 | const struct nozomi *dc = get_dc_by_tty(tty); | 1728 | const struct nozomi *dc = get_dc_by_tty(tty); |
1735 | 1729 | ||
1736 | if (dc) { | 1730 | if (dc) |
1737 | mutex_lock(&port->tty_sem); | ||
1738 | room = kfifo_avail(&port->fifo_ul); | 1731 | room = kfifo_avail(&port->fifo_ul); |
1739 | mutex_unlock(&port->tty_sem); | 1732 | |
1740 | } | ||
1741 | return room; | 1733 | return room; |
1742 | } | 1734 | } |
1743 | 1735 | ||