aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/68360serial.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-04-30 03:53:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:45 -0400
commit978e595f88a1fba5869aa42a4af4fba36f33ecac (patch)
tree60848f49949c5b7b518621ee36cdc6d500244539 /drivers/serial/68360serial.c
parentac0e4b7d319bf284bb64bc7e1c051417386b34a4 (diff)
tty/serial: lay the foundations for the next set of reworks
- Stop drivers calling their own flush method indirectly, it obfuscates code and it will change soon anyway - A few more lock_kernel paths temporarily needed in some driver internal waiting code - Remove private put_char method that does a write call for one char - we have that anyway - Most but not yet all of the termios copy under lock fixing (some has other dependencies to follow) - Note a few locking bugs in drivers found in the process - Kill remaining [ab]users of TIOCG/SSOFTCAR in the driver, these must go to fix the termios locking Signed-off-by: Alan Cox <alan@redhat.com> Cc: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial/68360serial.c')
-rw-r--r--drivers/serial/68360serial.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c
index 6f540107d0bb..f4f737bfa0a7 100644
--- a/drivers/serial/68360serial.c
+++ b/drivers/serial/68360serial.c
@@ -1436,18 +1436,6 @@ static int rs_360_ioctl(struct tty_struct *tty, struct file * file,
1436 return retval; 1436 return retval;
1437 end_break(info); 1437 end_break(info);
1438 return 0; 1438 return 0;
1439 case TIOCGSOFTCAR:
1440 /* return put_user(C_CLOCAL(tty) ? 1 : 0, (int *) arg); */
1441 put_user(C_CLOCAL(tty) ? 1 : 0, (int *) arg);
1442 return 0;
1443 case TIOCSSOFTCAR:
1444 error = get_user(arg, (unsigned int *) arg);
1445 if (error)
1446 return error;
1447 tty->termios->c_cflag =
1448 ((tty->termios->c_cflag & ~CLOCAL) |
1449 (arg ? CLOCAL : 0));
1450 return 0;
1451#ifdef maybe 1439#ifdef maybe
1452 case TIOCSERGETLSR: /* Get line status register */ 1440 case TIOCSERGETLSR: /* Get line status register */
1453 return get_lsr_info(info, (unsigned int *) arg); 1441 return get_lsr_info(info, (unsigned int *) arg);
@@ -1665,8 +1653,7 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp)
1665 rs_360_wait_until_sent(tty, info->timeout); 1653 rs_360_wait_until_sent(tty, info->timeout);
1666 } 1654 }
1667 shutdown(info); 1655 shutdown(info);
1668 if (tty->driver->flush_buffer) 1656 rs_360_flush_buffer(tty);
1669 tty->driver->flush_buffer(tty);
1670 tty_ldisc_flush(tty); 1657 tty_ldisc_flush(tty);
1671 tty->closing = 0; 1658 tty->closing = 0;
1672 info->event = 0; 1659 info->event = 0;
@@ -1717,6 +1704,7 @@ static void rs_360_wait_until_sent(struct tty_struct *tty, int timeout)
1717 printk("jiff=%lu...", jiffies); 1704 printk("jiff=%lu...", jiffies);
1718#endif 1705#endif
1719 1706
1707 lock_kernel();
1720 /* We go through the loop at least once because we can't tell 1708 /* We go through the loop at least once because we can't tell
1721 * exactly when the last character exits the shifter. There can 1709 * exactly when the last character exits the shifter. There can
1722 * be at least two characters waiting to be sent after the buffers 1710 * be at least two characters waiting to be sent after the buffers
@@ -1745,6 +1733,7 @@ static void rs_360_wait_until_sent(struct tty_struct *tty, int timeout)
1745 bdp--; 1733 bdp--;
1746 } while (bdp->status & BD_SC_READY); 1734 } while (bdp->status & BD_SC_READY);
1747 current->state = TASK_RUNNING; 1735 current->state = TASK_RUNNING;
1736 unlock_kernel();
1748#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT 1737#ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
1749 printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies); 1738 printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies);
1750#endif 1739#endif