aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/crisv10.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/crisv10.c')
-rw-r--r--drivers/serial/crisv10.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c
index 88e7c1d5b919..f9fa237aa949 100644
--- a/drivers/serial/crisv10.c
+++ b/drivers/serial/crisv10.c
@@ -1788,7 +1788,7 @@ static unsigned int handle_descr_data(struct e100_serial *info,
1788 1788
1789 if (info->recv_cnt + recvl > 65536) { 1789 if (info->recv_cnt + recvl > 65536) {
1790 printk(KERN_CRIT 1790 printk(KERN_CRIT
1791 "%s: Too much pending incoming serial data! Dropping %u bytes.\n", __FUNCTION__, recvl); 1791 "%s: Too much pending incoming serial data! Dropping %u bytes.\n", __func__, recvl);
1792 return 0; 1792 return 0;
1793 } 1793 }
1794 1794
@@ -1801,7 +1801,7 @@ static unsigned int handle_descr_data(struct e100_serial *info,
1801 append_recv_buffer(info, buffer); 1801 append_recv_buffer(info, buffer);
1802 1802
1803 if (!(buffer = alloc_recv_buffer(SERIAL_DESCR_BUF_SIZE))) 1803 if (!(buffer = alloc_recv_buffer(SERIAL_DESCR_BUF_SIZE)))
1804 panic("%s: Failed to allocate memory for receive buffer!\n", __FUNCTION__); 1804 panic("%s: Failed to allocate memory for receive buffer!\n", __func__);
1805 1805
1806 descr->buf = virt_to_phys(buffer->buffer); 1806 descr->buf = virt_to_phys(buffer->buffer);
1807 1807
@@ -1925,7 +1925,7 @@ static int start_recv_dma(struct e100_serial *info)
1925 /* Set up the receiving descriptors */ 1925 /* Set up the receiving descriptors */
1926 for (i = 0; i < SERIAL_RECV_DESCRIPTORS; i++) { 1926 for (i = 0; i < SERIAL_RECV_DESCRIPTORS; i++) {
1927 if (!(buffer = alloc_recv_buffer(SERIAL_DESCR_BUF_SIZE))) 1927 if (!(buffer = alloc_recv_buffer(SERIAL_DESCR_BUF_SIZE)))
1928 panic("%s: Failed to allocate memory for receive buffer!\n", __FUNCTION__); 1928 panic("%s: Failed to allocate memory for receive buffer!\n", __func__);
1929 1929
1930 descr[i].ctrl = d_int; 1930 descr[i].ctrl = d_int;
1931 descr[i].buf = virt_to_phys(buffer->buffer); 1931 descr[i].buf = virt_to_phys(buffer->buffer);
@@ -3581,8 +3581,9 @@ rs_tiocmset(struct tty_struct *tty, struct file *file,
3581 unsigned int set, unsigned int clear) 3581 unsigned int set, unsigned int clear)
3582{ 3582{
3583 struct e100_serial *info = (struct e100_serial *)tty->driver_data; 3583 struct e100_serial *info = (struct e100_serial *)tty->driver_data;
3584 unsigned long flags;
3584 3585
3585 lock_kernel(); 3586 local_irq_save(flags);
3586 3587
3587 if (clear & TIOCM_RTS) 3588 if (clear & TIOCM_RTS)
3588 e100_rts(info, 0); 3589 e100_rts(info, 0);
@@ -3604,7 +3605,7 @@ rs_tiocmset(struct tty_struct *tty, struct file *file,
3604 if (set & TIOCM_CD) 3605 if (set & TIOCM_CD)
3605 e100_cd_out(info, 1); 3606 e100_cd_out(info, 1);
3606 3607
3607 unlock_kernel(); 3608 local_irq_restore(flags);
3608 return 0; 3609 return 0;
3609} 3610}
3610 3611
@@ -3613,8 +3614,10 @@ rs_tiocmget(struct tty_struct *tty, struct file *file)
3613{ 3614{
3614 struct e100_serial *info = (struct e100_serial *)tty->driver_data; 3615 struct e100_serial *info = (struct e100_serial *)tty->driver_data;
3615 unsigned int result; 3616 unsigned int result;
3617 unsigned long flags;
3618
3619 local_irq_save(flags);
3616 3620
3617 lock_kernel();
3618 result = 3621 result =
3619 (!E100_RTS_GET(info) ? TIOCM_RTS : 0) 3622 (!E100_RTS_GET(info) ? TIOCM_RTS : 0)
3620 | (!E100_DTR_GET(info) ? TIOCM_DTR : 0) 3623 | (!E100_DTR_GET(info) ? TIOCM_DTR : 0)
@@ -3623,7 +3626,7 @@ rs_tiocmget(struct tty_struct *tty, struct file *file)
3623 | (!E100_CD_GET(info) ? TIOCM_CAR : 0) 3626 | (!E100_CD_GET(info) ? TIOCM_CAR : 0)
3624 | (!E100_CTS_GET(info) ? TIOCM_CTS : 0); 3627 | (!E100_CTS_GET(info) ? TIOCM_CTS : 0);
3625 3628
3626 unlock_kernel(); 3629 local_irq_restore(flags);
3627 3630
3628#ifdef SERIAL_DEBUG_IO 3631#ifdef SERIAL_DEBUG_IO
3629 printk(KERN_DEBUG "ser%i: modem state: %i 0x%08X\n", 3632 printk(KERN_DEBUG "ser%i: modem state: %i 0x%08X\n",
@@ -3702,10 +3705,6 @@ rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
3702{ 3705{
3703 struct e100_serial *info = (struct e100_serial *)tty->driver_data; 3706 struct e100_serial *info = (struct e100_serial *)tty->driver_data;
3704 3707
3705 if (tty->termios->c_cflag == old_termios->c_cflag &&
3706 tty->termios->c_iflag == old_termios->c_iflag)
3707 return;
3708
3709 change_speed(info); 3708 change_speed(info);
3710 3709
3711 /* Handle turning off CRTSCTS */ 3710 /* Handle turning off CRTSCTS */
@@ -3808,10 +3807,8 @@ rs_close(struct tty_struct *tty, struct file * filp)
3808#endif 3807#endif
3809 3808
3810 shutdown(info); 3809 shutdown(info);
3811 if (tty->driver->flush_buffer) 3810 rs_flush_buffer(tty);
3812 tty->driver->flush_buffer(tty); 3811 tty_ldisc_flush_buffer(tty);
3813 if (tty->ldisc.flush_buffer)
3814 tty->ldisc.flush_buffer(tty);
3815 tty->closing = 0; 3812 tty->closing = 0;
3816 info->event = 0; 3813 info->event = 0;
3817 info->tty = 0; 3814 info->tty = 0;
@@ -3885,6 +3882,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
3885 * Check R_DMA_CHx_STATUS bit 0-6=number of available bytes in FIFO 3882 * Check R_DMA_CHx_STATUS bit 0-6=number of available bytes in FIFO
3886 * R_DMA_CHx_HWSW bit 31-16=nbr of bytes left in DMA buffer (0=64k) 3883 * R_DMA_CHx_HWSW bit 31-16=nbr of bytes left in DMA buffer (0=64k)
3887 */ 3884 */
3885 lock_kernel();
3888 orig_jiffies = jiffies; 3886 orig_jiffies = jiffies;
3889 while (info->xmit.head != info->xmit.tail || /* More in send queue */ 3887 while (info->xmit.head != info->xmit.tail || /* More in send queue */
3890 (*info->ostatusadr & 0x007f) || /* more in FIFO */ 3888 (*info->ostatusadr & 0x007f) || /* more in FIFO */
@@ -3901,6 +3899,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
3901 curr_time_usec - info->last_tx_active_usec; 3899 curr_time_usec - info->last_tx_active_usec;
3902 } 3900 }
3903 set_current_state(TASK_RUNNING); 3901 set_current_state(TASK_RUNNING);
3902 unlock_kernel();
3904} 3903}
3905 3904
3906/* 3905/*
@@ -4520,7 +4519,7 @@ rs_init(void)
4520 4519
4521 if (request_irq(SERIAL_IRQ_NBR, ser_interrupt, 4520 if (request_irq(SERIAL_IRQ_NBR, ser_interrupt,
4522 IRQF_SHARED | IRQF_DISABLED, "serial ", driver)) 4521 IRQF_SHARED | IRQF_DISABLED, "serial ", driver))
4523 panic("%s: Failed to request irq8", __FUNCTION__); 4522 panic("%s: Failed to request irq8", __func__);
4524 4523
4525#endif 4524#endif
4526#endif /* CONFIG_SVINTO_SIM */ 4525#endif /* CONFIG_SVINTO_SIM */