Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-serial-4.20-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus

Johan writes:

USB-serial fix for v4.20-rc6

Here's a fix for a reported USB-console regression in 4.18 which
revealed a long-standing bug in the console implementation.

The patch has been in linux-next over night with no reported issues.

Signed-off-by: Johan Hovold <johan@kernel.org>

* tag 'usb-serial-4.20-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial:
USB: serial: console: fix reported terminal settings

+11 -3
+9 -2
drivers/tty/tty_io.c
··· 1373 1373 return ERR_PTR(retval); 1374 1374 } 1375 1375 1376 - static void tty_free_termios(struct tty_struct *tty) 1376 + /** 1377 + * tty_save_termios() - save tty termios data in driver table 1378 + * @tty: tty whose termios data to save 1379 + * 1380 + * Locking: Caller guarantees serialisation with tty_init_termios(). 1381 + */ 1382 + void tty_save_termios(struct tty_struct *tty) 1377 1383 { 1378 1384 struct ktermios *tp; 1379 1385 int idx = tty->index; ··· 1398 1392 } 1399 1393 *tp = tty->termios; 1400 1394 } 1395 + EXPORT_SYMBOL_GPL(tty_save_termios); 1401 1396 1402 1397 /** 1403 1398 * tty_flush_works - flush all works of a tty/pty pair ··· 1498 1491 WARN_ON(!mutex_is_locked(&tty_mutex)); 1499 1492 if (tty->ops->shutdown) 1500 1493 tty->ops->shutdown(tty); 1501 - tty_free_termios(tty); 1494 + tty_save_termios(tty); 1502 1495 tty_driver_remove_tty(tty->driver, tty); 1503 1496 tty->port->itty = NULL; 1504 1497 if (tty->link)
+1 -1
drivers/usb/serial/console.c
··· 101 101 cflag |= PARENB; 102 102 break; 103 103 } 104 - co->cflag = cflag; 105 104 106 105 /* 107 106 * no need to check the index here: if the index is wrong, console ··· 163 164 serial->type->set_termios(tty, port, &dummy); 164 165 165 166 tty_port_tty_set(&port->port, NULL); 167 + tty_save_termios(tty); 166 168 tty_kref_put(tty); 167 169 } 168 170 tty_port_set_initialized(&port->port, 1);
+1
include/linux/tty.h
··· 556 556 extern void tty_release_struct(struct tty_struct *tty, int idx); 557 557 extern int tty_release(struct inode *inode, struct file *filp); 558 558 extern void tty_init_termios(struct tty_struct *tty); 559 + extern void tty_save_termios(struct tty_struct *tty); 559 560 extern int tty_standard_install(struct tty_driver *driver, 560 561 struct tty_struct *tty); 561 562