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 'tty-4.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial driver fixes from Greg KH:
"Here are a number of small serial and tty fixes for reported issues.

All have been in linux-next successfully"

* tag 'tty-4.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
tty: vt: Fix !TASK_RUNNING diagnostic warning from paste_selection()
serial: core: Fix crashes while echoing when closing
m32r: Add ioreadXX/iowriteXX big-endian mmio accessors
Revert "serial: imx: initialized DMA w/o HW flow enabled"
sc16is7xx: fix FIFO address of secondary UART
sc16is7xx: fix Kconfig dependencies
serial: etraxfs-uart: Fix release etraxfs_uart_ports
tty/vt: Fix the memory leak in visual_init
serial: amba-pl011: Fix devm_ioremap_resource return value check
n_tty: signal and flush atomically

+57 -23
+5
arch/m32r/include/asm/io.h
··· 174 174 #define iowrite16 writew 175 175 #define iowrite32 writel 176 176 177 + #define ioread16be(addr) be16_to_cpu(readw(addr)) 178 + #define ioread32be(addr) be32_to_cpu(readl(addr)) 179 + #define iowrite16be(v, addr) writew(cpu_to_be16(v), (addr)) 180 + #define iowrite32be(v, addr) writel(cpu_to_be32(v), (addr)) 181 + 177 182 #define mmiowb() 178 183 179 184 #define flush_write_buffers() do { } while (0) /* M32R_FIXME */
+13 -3
drivers/tty/n_tty.c
··· 1108 1108 * Locking: ctrl_lock 1109 1109 */ 1110 1110 1111 - static void isig(int sig, struct tty_struct *tty) 1111 + static void __isig(int sig, struct tty_struct *tty) 1112 1112 { 1113 - struct n_tty_data *ldata = tty->disc_data; 1114 1113 struct pid *tty_pgrp = tty_get_pgrp(tty); 1115 1114 if (tty_pgrp) { 1116 1115 kill_pgrp(tty_pgrp, sig, 1); 1117 1116 put_pid(tty_pgrp); 1118 1117 } 1118 + } 1119 1119 1120 - if (!L_NOFLSH(tty)) { 1120 + static void isig(int sig, struct tty_struct *tty) 1121 + { 1122 + struct n_tty_data *ldata = tty->disc_data; 1123 + 1124 + if (L_NOFLSH(tty)) { 1125 + /* signal only */ 1126 + __isig(sig, tty); 1127 + 1128 + } else { /* signal and flush */ 1121 1129 up_read(&tty->termios_rwsem); 1122 1130 down_write(&tty->termios_rwsem); 1131 + 1132 + __isig(sig, tty); 1123 1133 1124 1134 /* clear echo buffer */ 1125 1135 mutex_lock(&ldata->output_lock);
+1 -1
drivers/tty/serial/Kconfig
··· 1185 1185 config SERIAL_SC16IS7XX 1186 1186 tristate "SC16IS7xx serial support" 1187 1187 select SERIAL_CORE 1188 - depends on I2C || SPI_MASTER 1188 + depends on (SPI_MASTER && !I2C) || I2C 1189 1189 help 1190 1190 This selects support for SC16IS7xx serial ports. 1191 1191 Supported ICs are SC16IS740, SC16IS741, SC16IS750, SC16IS752,
+2 -2
drivers/tty/serial/amba-pl011.c
··· 2310 2310 void __iomem *base; 2311 2311 2312 2312 base = devm_ioremap_resource(dev, mmiobase); 2313 - if (!base) 2314 - return -ENOMEM; 2313 + if (IS_ERR(base)) 2314 + return PTR_ERR(base); 2315 2315 2316 2316 index = pl011_probe_dt_alias(index, dev); 2317 2317
+1 -1
drivers/tty/serial/etraxfs-uart.c
··· 950 950 951 951 port = platform_get_drvdata(pdev); 952 952 uart_remove_one_port(&etraxfs_uart_driver, port); 953 - etraxfs_uart_ports[pdev->id] = NULL; 953 + etraxfs_uart_ports[port->line] = NULL; 954 954 955 955 return 0; 956 956 }
+7 -8
drivers/tty/serial/imx.c
··· 1121 1121 1122 1122 writel(temp & ~UCR4_DREN, sport->port.membase + UCR4); 1123 1123 1124 - /* Can we enable the DMA support? */ 1125 - if (is_imx6q_uart(sport) && !uart_console(port) && 1126 - !sport->dma_is_inited) 1127 - imx_uart_dma_init(sport); 1128 - 1129 1124 spin_lock_irqsave(&sport->port.lock, flags); 1130 1125 /* Reset fifo's and state machines */ 1131 1126 i = 100; ··· 1137 1142 */ 1138 1143 writel(USR1_RTSD, sport->port.membase + USR1); 1139 1144 writel(USR2_ORE, sport->port.membase + USR2); 1140 - 1141 - if (sport->dma_is_inited && !sport->dma_is_enabled) 1142 - imx_enable_dma(sport); 1143 1145 1144 1146 temp = readl(sport->port.membase + UCR1); 1145 1147 temp |= UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN; ··· 1308 1316 } else { 1309 1317 ucr2 |= UCR2_CTSC; 1310 1318 } 1319 + 1320 + /* Can we enable the DMA support? */ 1321 + if (is_imx6q_uart(sport) && !uart_console(port) 1322 + && !sport->dma_is_inited) 1323 + imx_uart_dma_init(sport); 1311 1324 } else { 1312 1325 termios->c_cflag &= ~CRTSCTS; 1313 1326 } ··· 1429 1432 if (UART_ENABLE_MS(&sport->port, termios->c_cflag)) 1430 1433 imx_enable_ms(&sport->port); 1431 1434 1435 + if (sport->dma_is_inited && !sport->dma_is_enabled) 1436 + imx_enable_dma(sport); 1432 1437 spin_unlock_irqrestore(&sport->port.lock, flags); 1433 1438 } 1434 1439
+23 -7
drivers/tty/serial/sc16is7xx.c
··· 354 354 (reg << SC16IS7XX_REG_SHIFT) | port->line, val); 355 355 } 356 356 357 + static void sc16is7xx_fifo_read(struct uart_port *port, unsigned int rxlen) 358 + { 359 + struct sc16is7xx_port *s = dev_get_drvdata(port->dev); 360 + u8 addr = (SC16IS7XX_RHR_REG << SC16IS7XX_REG_SHIFT) | port->line; 361 + 362 + regcache_cache_bypass(s->regmap, true); 363 + regmap_raw_read(s->regmap, addr, s->buf, rxlen); 364 + regcache_cache_bypass(s->regmap, false); 365 + } 366 + 367 + static void sc16is7xx_fifo_write(struct uart_port *port, u8 to_send) 368 + { 369 + struct sc16is7xx_port *s = dev_get_drvdata(port->dev); 370 + u8 addr = (SC16IS7XX_THR_REG << SC16IS7XX_REG_SHIFT) | port->line; 371 + 372 + regcache_cache_bypass(s->regmap, true); 373 + regmap_raw_write(s->regmap, addr, s->buf, to_send); 374 + regcache_cache_bypass(s->regmap, false); 375 + } 376 + 357 377 static void sc16is7xx_port_update(struct uart_port *port, u8 reg, 358 378 u8 mask, u8 val) 359 379 { ··· 528 508 s->buf[0] = sc16is7xx_port_read(port, SC16IS7XX_RHR_REG); 529 509 bytes_read = 1; 530 510 } else { 531 - regcache_cache_bypass(s->regmap, true); 532 - regmap_raw_read(s->regmap, SC16IS7XX_RHR_REG, 533 - s->buf, rxlen); 534 - regcache_cache_bypass(s->regmap, false); 511 + sc16is7xx_fifo_read(port, rxlen); 535 512 bytes_read = rxlen; 536 513 } 537 514 ··· 608 591 s->buf[i] = xmit->buf[xmit->tail]; 609 592 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); 610 593 } 611 - regcache_cache_bypass(s->regmap, true); 612 - regmap_raw_write(s->regmap, SC16IS7XX_THR_REG, s->buf, to_send); 613 - regcache_cache_bypass(s->regmap, false); 594 + 595 + sc16is7xx_fifo_write(port, to_send); 614 596 } 615 597 616 598 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
+2 -1
drivers/tty/serial/serial_core.c
··· 1418 1418 mutex_lock(&port->mutex); 1419 1419 uart_shutdown(tty, state); 1420 1420 tty_port_tty_set(port, NULL); 1421 - tty->closing = 0; 1421 + 1422 1422 spin_lock_irqsave(&port->lock, flags); 1423 1423 1424 1424 if (port->blocked_open) { ··· 1444 1444 mutex_unlock(&port->mutex); 1445 1445 1446 1446 tty_ldisc_flush(tty); 1447 + tty->closing = 0; 1447 1448 } 1448 1449 1449 1450 static void uart_wait_until_sent(struct tty_struct *tty, int timeout)
+1
drivers/tty/vt/selection.c
··· 356 356 schedule(); 357 357 continue; 358 358 } 359 + __set_current_state(TASK_RUNNING); 359 360 count = sel_buffer_lth - pasted; 360 361 count = tty_ldisc_receive_buf(ld, sel_buffer + pasted, NULL, 361 362 count);
+2
drivers/tty/vt/vt.c
··· 742 742 __module_get(vc->vc_sw->owner); 743 743 vc->vc_num = num; 744 744 vc->vc_display_fg = &master_display_fg; 745 + if (vc->vc_uni_pagedir_loc) 746 + con_free_unimap(vc); 745 747 vc->vc_uni_pagedir_loc = &vc->vc_uni_pagedir; 746 748 vc->vc_uni_pagedir = NULL; 747 749 vc->vc_hi_font_mask = 0;