diff options
author | Samuel Iglesias Gonsalvez <siglesias@igalia.com> | 2012-12-10 05:50:00 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-15 21:24:38 -0500 |
commit | a1da13a67afa45cf996ae9325030dd86c26573fc (patch) | |
tree | d6dc66f44d8691d5a9332a00d591f3f451add843 /drivers/ipack/devices | |
parent | 7e5730d7c22267e406454b5cff0c40e4ebf9a0da (diff) |
ipack/devices/ipoctal: remove wait_queue and atomic_t board_write
Don't block the TTY client when sending characters.
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/ipack/devices')
-rw-r--r-- | drivers/ipack/devices/ipoctal.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/ipack/devices/ipoctal.c b/drivers/ipack/devices/ipoctal.c index 8d0a86631908..18f9cf1ffe2b 100644 --- a/drivers/ipack/devices/ipoctal.c +++ b/drivers/ipack/devices/ipoctal.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <linux/serial.h> | 20 | #include <linux/serial.h> |
21 | #include <linux/tty_flip.h> | 21 | #include <linux/tty_flip.h> |
22 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
23 | #include <linux/atomic.h> | ||
24 | #include <linux/io.h> | 23 | #include <linux/io.h> |
25 | #include <linux/ipack.h> | 24 | #include <linux/ipack.h> |
26 | #include "ipoctal.h" | 25 | #include "ipoctal.h" |
@@ -42,7 +41,6 @@ struct ipoctal_channel { | |||
42 | union scc2698_channel __iomem *regs; | 41 | union scc2698_channel __iomem *regs; |
43 | union scc2698_block __iomem *block_regs; | 42 | union scc2698_block __iomem *block_regs; |
44 | unsigned int board_id; | 43 | unsigned int board_id; |
45 | unsigned char *board_write; | ||
46 | u8 isr_rx_rdy_mask; | 44 | u8 isr_rx_rdy_mask; |
47 | u8 isr_tx_rdy_mask; | 45 | u8 isr_tx_rdy_mask; |
48 | }; | 46 | }; |
@@ -51,7 +49,6 @@ struct ipoctal { | |||
51 | struct ipack_device *dev; | 49 | struct ipack_device *dev; |
52 | unsigned int board_id; | 50 | unsigned int board_id; |
53 | struct ipoctal_channel channel[NR_CHANNELS]; | 51 | struct ipoctal_channel channel[NR_CHANNELS]; |
54 | unsigned char write; | ||
55 | struct tty_driver *tty_drv; | 52 | struct tty_driver *tty_drv; |
56 | u8 __iomem *mem8_space; | 53 | u8 __iomem *mem8_space; |
57 | u8 __iomem *int_space; | 54 | u8 __iomem *int_space; |
@@ -181,10 +178,8 @@ static void ipoctal_irq_tx(struct ipoctal_channel *channel) | |||
181 | channel->nb_bytes--; | 178 | channel->nb_bytes--; |
182 | 179 | ||
183 | if (channel->nb_bytes == 0 && | 180 | if (channel->nb_bytes == 0 && |
184 | channel->board_id != IPACK1_DEVICE_ID_SBS_OCTAL_485) { | 181 | channel->board_id != IPACK1_DEVICE_ID_SBS_OCTAL_485) |
185 | *channel->board_write = 1; | 182 | iowrite8(CR_DISABLE_TX, &channel->regs->w.cr); |
186 | wake_up_interruptible(&channel->queue); | ||
187 | } | ||
188 | } | 183 | } |
189 | 184 | ||
190 | static void ipoctal_irq_channel(struct ipoctal_channel *channel) | 185 | static void ipoctal_irq_channel(struct ipoctal_channel *channel) |
@@ -207,8 +202,7 @@ static void ipoctal_irq_channel(struct ipoctal_channel *channel) | |||
207 | iowrite8(CR_DISABLE_TX, &channel->regs->w.cr); | 202 | iowrite8(CR_DISABLE_TX, &channel->regs->w.cr); |
208 | iowrite8(CR_CMD_NEGATE_RTSN, &channel->regs->w.cr); | 203 | iowrite8(CR_CMD_NEGATE_RTSN, &channel->regs->w.cr); |
209 | iowrite8(CR_ENABLE_RX, &channel->regs->w.cr); | 204 | iowrite8(CR_ENABLE_RX, &channel->regs->w.cr); |
210 | *channel->board_write = 1; | 205 | iowrite8(CR_DISABLE_TX, &channel->regs->w.cr); |
211 | wake_up_interruptible(&channel->queue); | ||
212 | } | 206 | } |
213 | 207 | ||
214 | /* RX data */ | 208 | /* RX data */ |
@@ -302,7 +296,6 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, | |||
302 | struct ipoctal_channel *channel = &ipoctal->channel[i]; | 296 | struct ipoctal_channel *channel = &ipoctal->channel[i]; |
303 | channel->regs = chan_regs + i; | 297 | channel->regs = chan_regs + i; |
304 | channel->block_regs = block_regs + (i >> 1); | 298 | channel->block_regs = block_regs + (i >> 1); |
305 | channel->board_write = &ipoctal->write; | ||
306 | channel->board_id = ipoctal->board_id; | 299 | channel->board_id = ipoctal->board_id; |
307 | if (i & 1) { | 300 | if (i & 1) { |
308 | channel->isr_tx_rdy_mask = ISR_TxRDY_B; | 301 | channel->isr_tx_rdy_mask = ISR_TxRDY_B; |
@@ -385,8 +378,6 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, | |||
385 | 378 | ||
386 | ipoctal_reset_stats(&channel->stats); | 379 | ipoctal_reset_stats(&channel->stats); |
387 | channel->nb_bytes = 0; | 380 | channel->nb_bytes = 0; |
388 | init_waitqueue_head(&channel->queue); | ||
389 | |||
390 | spin_lock_init(&channel->lock); | 381 | spin_lock_init(&channel->lock); |
391 | channel->pointer_read = 0; | 382 | channel->pointer_read = 0; |
392 | channel->pointer_write = 0; | 383 | channel->pointer_write = 0; |
@@ -450,10 +441,6 @@ static int ipoctal_write_tty(struct tty_struct *tty, | |||
450 | * operations | 441 | * operations |
451 | */ | 442 | */ |
452 | iowrite8(CR_ENABLE_TX, &channel->regs->w.cr); | 443 | iowrite8(CR_ENABLE_TX, &channel->regs->w.cr); |
453 | wait_event_interruptible(channel->queue, *channel->board_write); | ||
454 | iowrite8(CR_DISABLE_TX, &channel->regs->w.cr); | ||
455 | |||
456 | *channel->board_write = 0; | ||
457 | return char_copied; | 444 | return char_copied; |
458 | } | 445 | } |
459 | 446 | ||