diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2008-04-30 03:53:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:45 -0400 |
commit | 978e595f88a1fba5869aa42a4af4fba36f33ecac (patch) | |
tree | 60848f49949c5b7b518621ee36cdc6d500244539 /drivers/serial/mcfserial.c | |
parent | ac0e4b7d319bf284bb64bc7e1c051417386b34a4 (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/mcfserial.c')
-rw-r--r-- | drivers/serial/mcfserial.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c index ddd3aa50d4ad..aafa1704e1ab 100644 --- a/drivers/serial/mcfserial.c +++ b/drivers/serial/mcfserial.c | |||
@@ -1072,18 +1072,6 @@ static int mcfrs_ioctl(struct tty_struct *tty, struct file * file, | |||
1072 | tty_wait_until_sent(tty, 0); | 1072 | tty_wait_until_sent(tty, 0); |
1073 | send_break(info, arg ? arg*(HZ/10) : HZ/4); | 1073 | send_break(info, arg ? arg*(HZ/10) : HZ/4); |
1074 | return 0; | 1074 | return 0; |
1075 | case TIOCGSOFTCAR: | ||
1076 | error = put_user(C_CLOCAL(tty) ? 1 : 0, | ||
1077 | (unsigned long *) arg); | ||
1078 | if (error) | ||
1079 | return error; | ||
1080 | return 0; | ||
1081 | case TIOCSSOFTCAR: | ||
1082 | get_user(arg, (unsigned long *) arg); | ||
1083 | tty->termios->c_cflag = | ||
1084 | ((tty->termios->c_cflag & ~CLOCAL) | | ||
1085 | (arg ? CLOCAL : 0)); | ||
1086 | return 0; | ||
1087 | case TIOCGSERIAL: | 1075 | case TIOCGSERIAL: |
1088 | if (access_ok(VERIFY_WRITE, (void *) arg, | 1076 | if (access_ok(VERIFY_WRITE, (void *) arg, |
1089 | sizeof(struct serial_struct))) | 1077 | sizeof(struct serial_struct))) |
@@ -1222,8 +1210,7 @@ static void mcfrs_close(struct tty_struct *tty, struct file * filp) | |||
1222 | } else | 1210 | } else |
1223 | #endif | 1211 | #endif |
1224 | shutdown(info); | 1212 | shutdown(info); |
1225 | if (tty->driver->flush_buffer) | 1213 | mcfrs_flush_buffer(tty); |
1226 | tty->driver->flush_buffer(tty); | ||
1227 | tty_ldisc_flush(tty); | 1214 | tty_ldisc_flush(tty); |
1228 | 1215 | ||
1229 | tty->closing = 0; | 1216 | tty->closing = 0; |
@@ -1276,6 +1263,8 @@ mcfrs_wait_until_sent(struct tty_struct *tty, int timeout) | |||
1276 | * Note: we have to use pretty tight timings here to satisfy | 1263 | * Note: we have to use pretty tight timings here to satisfy |
1277 | * the NIST-PCTS. | 1264 | * the NIST-PCTS. |
1278 | */ | 1265 | */ |
1266 | lock_kernel(); | ||
1267 | |||
1279 | fifo_time = (MCF5272_FIFO_SIZE * HZ * 10) / info->baud; | 1268 | fifo_time = (MCF5272_FIFO_SIZE * HZ * 10) / info->baud; |
1280 | char_time = fifo_time / 5; | 1269 | char_time = fifo_time / 5; |
1281 | if (char_time == 0) | 1270 | if (char_time == 0) |
@@ -1312,6 +1301,7 @@ mcfrs_wait_until_sent(struct tty_struct *tty, int timeout) | |||
1312 | if (timeout && time_after(jiffies, orig_jiffies + timeout)) | 1301 | if (timeout && time_after(jiffies, orig_jiffies + timeout)) |
1313 | break; | 1302 | break; |
1314 | } | 1303 | } |
1304 | unlock_kernel(); | ||
1315 | #else | 1305 | #else |
1316 | /* | 1306 | /* |
1317 | * For the other coldfire models, assume all data has been sent | 1307 | * For the other coldfire models, assume all data has been sent |