aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-22 18:10:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-22 18:10:57 -0500
commitdcfeda9d5f52bf43ae4297d8102a76d88b778d93 (patch)
tree6b9076ddb8c3b266e36a205998802db8e69e7d28
parent7f21739301bf894607f64cbb36add761fa4cb772 (diff)
parentbd63acf9e9a6b48e9c6c15f0f413f85a481cb5ef (diff)
Merge tag 'tty-4.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial fixes from Greg KH: "Here are a few small tty/serial driver fixes for 4.4-rc2 that resolve some reported problems. All have been in linux-next, full details are in the shortlog below" * tag 'tty-4.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: export fsl8250_handle_irq serial: 8250_mid: Add missing dependency tty: audit: Fix audit source serial: etraxfs-uart: Fix crash serial: fsl_lpuart: Fix earlycon support bcm63xx_uart: Use the device name when registering an interrupt tty: Fix direct use of tty buffer work tty: Fix tty_send_xchar() lock order inversion
-rw-r--r--drivers/tty/n_tty.c2
-rw-r--r--drivers/tty/serial/8250/8250_fsl.c1
-rw-r--r--drivers/tty/serial/8250/Kconfig1
-rw-r--r--drivers/tty/serial/Kconfig2
-rw-r--r--drivers/tty/serial/bcm63xx_uart.c2
-rw-r--r--drivers/tty/serial/etraxfs-uart.c2
-rw-r--r--drivers/tty/tty_audit.c2
-rw-r--r--drivers/tty/tty_io.c4
-rw-r--r--drivers/tty/tty_ioctl.c4
-rw-r--r--drivers/tty/tty_ldisc.c2
-rw-r--r--include/linux/tty.h6
11 files changed, 15 insertions, 13 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 13844261cd5f..ed776149261e 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -169,7 +169,7 @@ static inline int tty_copy_to_user(struct tty_struct *tty,
169{ 169{
170 struct n_tty_data *ldata = tty->disc_data; 170 struct n_tty_data *ldata = tty->disc_data;
171 171
172 tty_audit_add_data(tty, to, n, ldata->icanon); 172 tty_audit_add_data(tty, from, n, ldata->icanon);
173 return copy_to_user(to, from, n); 173 return copy_to_user(to, from, n);
174} 174}
175 175
diff --git a/drivers/tty/serial/8250/8250_fsl.c b/drivers/tty/serial/8250/8250_fsl.c
index c0533a57ec53..910bfee5a88b 100644
--- a/drivers/tty/serial/8250/8250_fsl.c
+++ b/drivers/tty/serial/8250/8250_fsl.c
@@ -60,3 +60,4 @@ int fsl8250_handle_irq(struct uart_port *port)
60 spin_unlock_irqrestore(&up->port.lock, flags); 60 spin_unlock_irqrestore(&up->port.lock, flags);
61 return 1; 61 return 1;
62} 62}
63EXPORT_SYMBOL_GPL(fsl8250_handle_irq);
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index e6f5e12a2d83..6412f1455beb 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -373,6 +373,7 @@ config SERIAL_8250_MID
373 depends on SERIAL_8250 && PCI 373 depends on SERIAL_8250 && PCI
374 select HSU_DMA if SERIAL_8250_DMA 374 select HSU_DMA if SERIAL_8250_DMA
375 select HSU_DMA_PCI if X86_INTEL_MID 375 select HSU_DMA_PCI if X86_INTEL_MID
376 select RATIONAL
376 help 377 help
377 Selecting this option will enable handling of the extra features 378 Selecting this option will enable handling of the extra features
378 present on the UART found on Intel Medfield SOC and various other 379 present on the UART found on Intel Medfield SOC and various other
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 1aec4404062d..f38beb28e7ae 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1539,7 +1539,6 @@ config SERIAL_FSL_LPUART
1539 tristate "Freescale lpuart serial port support" 1539 tristate "Freescale lpuart serial port support"
1540 depends on HAS_DMA 1540 depends on HAS_DMA
1541 select SERIAL_CORE 1541 select SERIAL_CORE
1542 select SERIAL_EARLYCON
1543 help 1542 help
1544 Support for the on-chip lpuart on some Freescale SOCs. 1543 Support for the on-chip lpuart on some Freescale SOCs.
1545 1544
@@ -1547,6 +1546,7 @@ config SERIAL_FSL_LPUART_CONSOLE
1547 bool "Console on Freescale lpuart serial port" 1546 bool "Console on Freescale lpuart serial port"
1548 depends on SERIAL_FSL_LPUART=y 1547 depends on SERIAL_FSL_LPUART=y
1549 select SERIAL_CORE_CONSOLE 1548 select SERIAL_CORE_CONSOLE
1549 select SERIAL_EARLYCON
1550 help 1550 help
1551 If you have enabled the lpuart serial port on the Freescale SoCs, 1551 If you have enabled the lpuart serial port on the Freescale SoCs,
1552 you can make it the console by answering Y to this option. 1552 you can make it the console by answering Y to this option.
diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
index 681e0f3d5e0e..a1c0a89d9c7f 100644
--- a/drivers/tty/serial/bcm63xx_uart.c
+++ b/drivers/tty/serial/bcm63xx_uart.c
@@ -474,7 +474,7 @@ static int bcm_uart_startup(struct uart_port *port)
474 474
475 /* register irq and enable rx interrupts */ 475 /* register irq and enable rx interrupts */
476 ret = request_irq(port->irq, bcm_uart_interrupt, 0, 476 ret = request_irq(port->irq, bcm_uart_interrupt, 0,
477 bcm_uart_type(port), port); 477 dev_name(port->dev), port);
478 if (ret) 478 if (ret)
479 return ret; 479 return ret;
480 bcm_uart_writel(port, UART_RX_INT_MASK, UART_IR_REG); 480 bcm_uart_writel(port, UART_RX_INT_MASK, UART_IR_REG);
diff --git a/drivers/tty/serial/etraxfs-uart.c b/drivers/tty/serial/etraxfs-uart.c
index 6813e316e9ff..2f80bc7e44fb 100644
--- a/drivers/tty/serial/etraxfs-uart.c
+++ b/drivers/tty/serial/etraxfs-uart.c
@@ -894,7 +894,7 @@ static int etraxfs_uart_probe(struct platform_device *pdev)
894 up->regi_ser = of_iomap(np, 0); 894 up->regi_ser = of_iomap(np, 0);
895 up->port.dev = &pdev->dev; 895 up->port.dev = &pdev->dev;
896 896
897 up->gpios = mctrl_gpio_init(&pdev->dev, 0); 897 up->gpios = mctrl_gpio_init_noauto(&pdev->dev, 0);
898 if (IS_ERR(up->gpios)) 898 if (IS_ERR(up->gpios))
899 return PTR_ERR(up->gpios); 899 return PTR_ERR(up->gpios);
900 900
diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c
index 90ca082935f6..3d245cd3d8e6 100644
--- a/drivers/tty/tty_audit.c
+++ b/drivers/tty/tty_audit.c
@@ -265,7 +265,7 @@ static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty,
265 * 265 *
266 * Audit @data of @size from @tty, if necessary. 266 * Audit @data of @size from @tty, if necessary.
267 */ 267 */
268void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, 268void tty_audit_add_data(struct tty_struct *tty, const void *data,
269 size_t size, unsigned icanon) 269 size_t size, unsigned icanon)
270{ 270{
271 struct tty_audit_buf *buf; 271 struct tty_audit_buf *buf;
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 0c41dbcb90b8..bcc8e1e8bb72 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1282,18 +1282,22 @@ int tty_send_xchar(struct tty_struct *tty, char ch)
1282 int was_stopped = tty->stopped; 1282 int was_stopped = tty->stopped;
1283 1283
1284 if (tty->ops->send_xchar) { 1284 if (tty->ops->send_xchar) {
1285 down_read(&tty->termios_rwsem);
1285 tty->ops->send_xchar(tty, ch); 1286 tty->ops->send_xchar(tty, ch);
1287 up_read(&tty->termios_rwsem);
1286 return 0; 1288 return 0;
1287 } 1289 }
1288 1290
1289 if (tty_write_lock(tty, 0) < 0) 1291 if (tty_write_lock(tty, 0) < 0)
1290 return -ERESTARTSYS; 1292 return -ERESTARTSYS;
1291 1293
1294 down_read(&tty->termios_rwsem);
1292 if (was_stopped) 1295 if (was_stopped)
1293 start_tty(tty); 1296 start_tty(tty);
1294 tty->ops->write(tty, &ch, 1); 1297 tty->ops->write(tty, &ch, 1);
1295 if (was_stopped) 1298 if (was_stopped)
1296 stop_tty(tty); 1299 stop_tty(tty);
1300 up_read(&tty->termios_rwsem);
1297 tty_write_unlock(tty); 1301 tty_write_unlock(tty);
1298 return 0; 1302 return 0;
1299} 1303}
diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
index 9c5aebfe7053..1445dd39aa62 100644
--- a/drivers/tty/tty_ioctl.c
+++ b/drivers/tty/tty_ioctl.c
@@ -1147,16 +1147,12 @@ int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
1147 spin_unlock_irq(&tty->flow_lock); 1147 spin_unlock_irq(&tty->flow_lock);
1148 break; 1148 break;
1149 case TCIOFF: 1149 case TCIOFF:
1150 down_read(&tty->termios_rwsem);
1151 if (STOP_CHAR(tty) != __DISABLED_CHAR) 1150 if (STOP_CHAR(tty) != __DISABLED_CHAR)
1152 retval = tty_send_xchar(tty, STOP_CHAR(tty)); 1151 retval = tty_send_xchar(tty, STOP_CHAR(tty));
1153 up_read(&tty->termios_rwsem);
1154 break; 1152 break;
1155 case TCION: 1153 case TCION:
1156 down_read(&tty->termios_rwsem);
1157 if (START_CHAR(tty) != __DISABLED_CHAR) 1154 if (START_CHAR(tty) != __DISABLED_CHAR)
1158 retval = tty_send_xchar(tty, START_CHAR(tty)); 1155 retval = tty_send_xchar(tty, START_CHAR(tty));
1159 up_read(&tty->termios_rwsem);
1160 break; 1156 break;
1161 default: 1157 default:
1162 return -EINVAL; 1158 return -EINVAL;
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index 5af8f1874c1a..629e3c865072 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -592,7 +592,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc)
592 592
593 /* Restart the work queue in case no characters kick it off. Safe if 593 /* Restart the work queue in case no characters kick it off. Safe if
594 already running */ 594 already running */
595 schedule_work(&tty->port->buf.work); 595 tty_buffer_restart_work(tty->port);
596 596
597 tty_unlock(tty); 597 tty_unlock(tty);
598 return retval; 598 return retval;
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 5b04b0a5375b..5e31f1b99037 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -607,7 +607,7 @@ extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops);
607 607
608/* tty_audit.c */ 608/* tty_audit.c */
609#ifdef CONFIG_AUDIT 609#ifdef CONFIG_AUDIT
610extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, 610extern void tty_audit_add_data(struct tty_struct *tty, const void *data,
611 size_t size, unsigned icanon); 611 size_t size, unsigned icanon);
612extern void tty_audit_exit(void); 612extern void tty_audit_exit(void);
613extern void tty_audit_fork(struct signal_struct *sig); 613extern void tty_audit_fork(struct signal_struct *sig);
@@ -615,8 +615,8 @@ extern void tty_audit_tiocsti(struct tty_struct *tty, char ch);
615extern void tty_audit_push(struct tty_struct *tty); 615extern void tty_audit_push(struct tty_struct *tty);
616extern int tty_audit_push_current(void); 616extern int tty_audit_push_current(void);
617#else 617#else
618static inline void tty_audit_add_data(struct tty_struct *tty, 618static inline void tty_audit_add_data(struct tty_struct *tty, const void *data,
619 unsigned char *data, size_t size, unsigned icanon) 619 size_t size, unsigned icanon)
620{ 620{
621} 621}
622static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch) 622static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch)