Skip to content

Commit

Permalink
Merge tag 'tty-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/gregkh/tty

Pull tty/serial updates from Greg KH:
 "Here's the big tty/serial driver pull request for 4.6-rc1.

  Lots of changes in here, Peter has been on a tear again, with lots of
  refactoring and bugs fixes, many thanks to the great work he has been
  doing.  Lots of driver updates and fixes as well, full details in the
  shortlog.

  All have been in linux-next for a while with no reported issues"

* tag 'tty-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (220 commits)
  serial: 8250: describe CONFIG_SERIAL_8250_RSA
  serial: samsung: optimize UART rx fifo access routine
  serial: pl011: add mark/space parity support
  serial: sa1100: make sa1100_register_uart_fns a function
  tty: serial: 8250: add MOXA Smartio MUE boards support
  serial: 8250: convert drivers to use up_to_u8250p()
  serial: 8250/mediatek: fix building with SERIAL_8250=m
  serial: 8250/ingenic: fix building with SERIAL_8250=m
  serial: 8250/uniphier: fix modular build
  Revert "drivers/tty/serial: make 8250/8250_ingenic.c explicitly non-modular"
  Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular"
  serial: mvebu-uart: initial support for Armada-3700 serial port
  serial: mctrl_gpio: Add missing module license
  serial: ifx6x60: avoid uninitialized variable use
  tty/serial: at91: fix bad offset for UART timeout register
  tty/serial: at91: restore dynamic driver binding
  serial: 8250: Add hardware dependency to RT288X option
  TTY, devpts: document pty count limiting
  tty: goldfish: support platform_device with id -1
  drivers: tty: goldfish: Add device tree bindings
  ...
  • Loading branch information
torvalds committed Mar 17, 2016
2 parents 8eee93e + a95fc9c commit 96b9b1c
Show file tree
Hide file tree
Showing 139 changed files with 3,447 additions and 3,701 deletions.
17 changes: 17 additions & 0 deletions Documentation/devicetree/bindings/goldfish/tty.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Android Goldfish TTY

Android goldfish tty device generated by android emulator.

Required properties:

- compatible : should contain "google,goldfish-tty" to match emulator
- reg : <registers mapping>
- interrupts : <interrupt mapping>

Example:

goldfish_tty@1f004000 {
compatible = "google,goldfish-tty";
reg = <0x1f004000 0x1000>;
interrupts = <0xc>;
};
18 changes: 18 additions & 0 deletions Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
* BCM2835 AUXILIAR UART

Required properties:

- compatible: "brcm,bcm2835-aux-uart"
- reg: The base address of the UART register bank.
- interrupts: A single interrupt specifier.
- clocks: Clock driving the hardware; used to figure out the baud rate
divisor.

Example:

uart1: serial@7e215040 {
compatible = "brcm,bcm2835-aux-uart";
reg = <0x7e215040 0x40>;
interrupts = <1 29>;
clocks = <&aux BCM2835_AUX_CLOCK_UART>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Required properties:
- "renesas,scifa-r8a7791" for R8A7791 (R-Car M2-W) SCIFA compatible UART.
- "renesas,scifb-r8a7791" for R8A7791 (R-Car M2-W) SCIFB compatible UART.
- "renesas,hscif-r8a7791" for R8A7791 (R-Car M2-W) HSCIF compatible UART.
- "renesas,scif-r8a7792" for R8A7792 (R-Car V2H) SCIF compatible UART.
- "renesas,hscif-r8a7792" for R8A7792 (R-Car V2H) HSCIF compatible UART.
- "renesas,scif-r8a7793" for R8A7793 (R-Car M2-N) SCIF compatible UART.
- "renesas,scifa-r8a7793" for R8A7793 (R-Car M2-N) SCIFA compatible UART.
- "renesas,scifb-r8a7793" for R8A7793 (R-Car M2-N) SCIFB compatible UART.
Expand Down
13 changes: 13 additions & 0 deletions Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* Marvell UART : Non standard UART used in some of Marvell EBU SoCs (e.g., Armada-3700)

Required properties:
- compatible: "marvell,armada-3700-uart"
- reg: offset and length of the register set for the device.
- interrupts: device interrupt

Example:
serial@12000 {
compatible = "marvell,armada-3700-uart";
reg = <0x12000 0x400>;
interrupts = <43>;
};
9 changes: 9 additions & 0 deletions Documentation/filesystems/devpts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ where 'ns_exec -cm /bin/bash' calls clone() with CLONE_NEWNS flag and execs
/bin/bash in the child process. A pty created by the sshd is not visible in
the original mount of /dev/pts.

Total count of pty pairs in all instances is limited by sysctls:
kernel.pty.max = 4096 - global limit
kernel.pty.reserve = 1024 - reserve for initial instance
kernel.pty.nr - current count of ptys

Per-instance limit could be set by adding mount option "max=<count>".
This feature was added in kernel 3.4 together with sysctl kernel.pty.reserve.
In kernels older than 3.4 sysctl kernel.pty.max works as per-instance limit.

User-space changes
------------------

Expand Down
6 changes: 6 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
A valid base address must be provided, and the serial
port must already be setup and configured.

armada3700_uart,<addr>
Start an early, polled-mode console on the
Armada 3700 serial port at the specified
address. The serial port must already be setup
and configured. Options are not yet supported.

earlyprintk= [X86,SH,BLACKFIN,ARM,M68k]
earlyprintk=vga
earlyprintk=efi
Expand Down
3 changes: 0 additions & 3 deletions Documentation/serial/tty.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ flush_buffer() - (optional) May be called at any point between
open and close, and instructs the line discipline
to empty its input buffer.

chars_in_buffer() - (optional) Report the number of bytes in the input
buffer.

set_termios() - (optional) Called on termios structure changes.
The caller passes the old termios data and the
current data is in the tty. Called under the
Expand Down
1 change: 1 addition & 0 deletions Documentation/sysctl/kernel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ show up in /proc/sys/kernel:
- printk_delay
- printk_ratelimit
- printk_ratelimit_burst
- pty ==> Documentation/filesystems/devpts.txt
- randomize_va_space
- real-root-dev ==> Documentation/initrd.txt
- reboot-cmd [ SPARC only ]
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6068,7 +6068,7 @@ S: Maintained
F: drivers/media/platform/rcar_jpu.c

JSM Neo PCI based serial card
M: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
M: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
L: linux-serial@vger.kernel.org
S: Maintained
F: drivers/tty/serial/jsm/
Expand Down
8 changes: 4 additions & 4 deletions arch/alpha/include/asm/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

/* Standard COM flags (except for COM4, because of the 8514 problem) */
#ifdef CONFIG_SERIAL_8250_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
#define STD_COM_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ)
#define STD_COM4_FLAGS (UPF_BOOT_AUTOCONF | UPF_AUTO_IRQ)
#else
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
#define STD_COM_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST)
#define STD_COM4_FLAGS UPF_BOOT_AUTOCONF
#endif

#define SERIAL_PORT_DFNS \
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
info = omap_serial_default_info;

oh = uart->oh;
name = DRIVER_NAME;
name = OMAP_SERIAL_DRIVER_NAME;

omap_up.dma_enabled = info->dma_enabled;
omap_up.uartclk = OMAP24XX_BASE_BAUD * 16;
Expand Down
2 changes: 1 addition & 1 deletion arch/frv/include/asm/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
*/
#define BASE_BAUD 0

#define STD_COM_FLAGS ASYNC_BOOT_AUTOCONF
#define STD_COM_FLAGS UPF_BOOT_AUTOCONF

#define SERIAL_PORT_DFNS
7 changes: 5 additions & 2 deletions arch/ia64/kernel/unaligned.c
Original file line number Diff line number Diff line change
Expand Up @@ -1336,8 +1336,11 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
* Don't call tty_write_message() if we're in the kernel; we might
* be holding locks...
*/
if (user_mode(regs))
tty_write_message(current->signal->tty, buf);
if (user_mode(regs)) {
struct tty_struct *tty = get_current_tty();
tty_write_message(tty, buf);
tty_kref_put(tty);
}
buf[len-1] = '\0'; /* drop '\r' */
/* watch for command names containing %s */
printk(KERN_WARNING "%s", buf);
Expand Down
8 changes: 4 additions & 4 deletions arch/m68k/include/asm/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

/* Standard COM flags (except for COM4, because of the 8514 problem) */
#ifdef CONFIG_SERIAL_8250_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
#define STD_COM_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ)
#define STD_COM4_FLAGS (UPF_BOOT_AUTOCONF | UPF_AUTO_IRQ)
#else
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
#define STD_COM_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST)
#define STD_COM4_FLAGS UPF_BOOT_AUTOCONF
#endif

#ifdef CONFIG_ISA
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pmcs-msp71xx/msp_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void __init msp_serial_setup(void)
up.uartclk = uartclk;
up.regshift = 2;
up.iotype = UPIO_MEM;
up.flags = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
up.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST;
up.type = PORT_16550A;
up.line = 0;
up.serial_out = msp_serial_out;
Expand Down
10 changes: 5 additions & 5 deletions arch/mn10300/include/asm/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

/* Standard COM flags (except for COM4, because of the 8514 problem) */
#ifdef CONFIG_SERIAL_8250_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
#define STD_COM_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ)
#define STD_COM4_FLAGS (UPF_BOOT_AUTOCONF | UPF_AUTO_IRQ)
#else
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
#define STD_COM_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST)
#define STD_COM4_FLAGS UPF_BOOT_AUTOCONF
#endif

#ifdef CONFIG_SERIAL_8250_MANY_PORTS
#define FOURPORT_FLAGS ASYNC_FOURPORT
#define FOURPORT_FLAGS UPF_FOURPORT
#define ACCENT_FLAGS 0
#define BOCA_FLAGS 0
#define HUB6_FLAGS 0
Expand Down
4 changes: 0 additions & 4 deletions arch/xtensa/platforms/iss/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
#include <linux/tty.h>
#include <linux/tty_flip.h>

#ifdef SERIAL_INLINE
#define _INLINE_ inline
#endif

#define SERIAL_MAX_NUM_LINES 1
#define SERIAL_TIMER_VALUE (HZ / 10)

Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/platforms/xt2000/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void platform_heartbeat(void)
}

//#define RS_TABLE_SIZE 2
//#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
//#define STD_COM_FLAGS (UPF_BOOT_AUTOCONF|UPF_SKIP_TEST)

#define _SERIAL_PORT(_base,_irq) \
{ \
Expand Down
21 changes: 8 additions & 13 deletions drivers/char/pcmcia/synclink_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ static void shutdown(MGSLPC_INFO * info, struct tty_struct *tty)
/* TODO:disable interrupts instead of reset to preserve signal states */
reset_device(info);

if (!tty || tty->termios.c_cflag & HUPCL) {
if (!tty || C_HUPCL(tty)) {
info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
set_signals(info);
}
Expand Down Expand Up @@ -1390,7 +1390,7 @@ static void mgslpc_program_hw(MGSLPC_INFO *info, struct tty_struct *tty)
port_irq_enable(info, (unsigned char) PVR_DSR | PVR_RI);
get_signals(info);

if (info->netcount || (tty && (tty->termios.c_cflag & CREAD)))
if (info->netcount || (tty && C_CREAD(tty)))
rx_start(info);

spin_unlock_irqrestore(&info->lock, flags);
Expand Down Expand Up @@ -1733,7 +1733,7 @@ static void mgslpc_throttle(struct tty_struct * tty)
if (I_IXOFF(tty))
mgslpc_send_xchar(tty, STOP_CHAR(tty));

if (tty->termios.c_cflag & CRTSCTS) {
if (C_CRTSCTS(tty)) {
spin_lock_irqsave(&info->lock, flags);
info->serial_signals &= ~SerialSignal_RTS;
set_signals(info);
Expand Down Expand Up @@ -1762,7 +1762,7 @@ static void mgslpc_unthrottle(struct tty_struct * tty)
mgslpc_send_xchar(tty, START_CHAR(tty));
}

if (tty->termios.c_cflag & CRTSCTS) {
if (C_CRTSCTS(tty)) {
spin_lock_irqsave(&info->lock, flags);
info->serial_signals |= SerialSignal_RTS;
set_signals(info);
Expand Down Expand Up @@ -2306,30 +2306,25 @@ static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_term
mgslpc_change_params(info, tty);

/* Handle transition to B0 status */
if (old_termios->c_cflag & CBAUD &&
!(tty->termios.c_cflag & CBAUD)) {
if ((old_termios->c_cflag & CBAUD) && !C_BAUD(tty)) {
info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
spin_lock_irqsave(&info->lock, flags);
set_signals(info);
spin_unlock_irqrestore(&info->lock, flags);
}

/* Handle transition away from B0 status */
if (!(old_termios->c_cflag & CBAUD) &&
tty->termios.c_cflag & CBAUD) {
if (!(old_termios->c_cflag & CBAUD) && C_BAUD(tty)) {
info->serial_signals |= SerialSignal_DTR;
if (!(tty->termios.c_cflag & CRTSCTS) ||
!test_bit(TTY_THROTTLED, &tty->flags)) {
if (!C_CRTSCTS(tty) || !test_bit(TTY_THROTTLED, &tty->flags))
info->serial_signals |= SerialSignal_RTS;
}
spin_lock_irqsave(&info->lock, flags);
set_signals(info);
spin_unlock_irqrestore(&info->lock, flags);
}

/* Handle turning off CRTSCTS */
if (old_termios->c_cflag & CRTSCTS &&
!(tty->termios.c_cflag & CRTSCTS)) {
if (old_termios->c_cflag & CRTSCTS && !C_CRTSCTS(tty)) {
tty->hw_stopped = 0;
tx_release(tty);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/ttyprintk.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static const struct tty_operations ttyprintk_ops = {
.ioctl = tpk_ioctl,
};

static struct tty_port_operations null_ops = { };
static const struct tty_port_operations null_ops = { };

static struct tty_driver *ttyprintk_driver;

Expand Down
12 changes: 6 additions & 6 deletions drivers/isdn/i4l/isdn_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
#endif
return;
}
port->flags |= ASYNC_CLOSING;
info->closing = 1;

tty->closing = 1;
/*
Expand Down Expand Up @@ -1603,6 +1603,7 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
info->ncarrier = 0;

tty_port_close_end(port, tty);
info->closing = 0;
#ifdef ISDN_DEBUG_MODEM_OPEN
printk(KERN_DEBUG "isdn_tty_close normal exit\n");
#endif
Expand Down Expand Up @@ -2236,7 +2237,7 @@ isdn_tty_at_cout(char *msg, modem_info *info)
l = strlen(msg);

spin_lock_irqsave(&info->readlock, flags);
if (port->flags & ASYNC_CLOSING) {
if (info->closing) {
spin_unlock_irqrestore(&info->readlock, flags);
return;
}
Expand Down Expand Up @@ -2386,13 +2387,12 @@ isdn_tty_modem_result(int code, modem_info *info)
case RESULT_NO_CARRIER:
#ifdef ISDN_DEBUG_MODEM_HUP
printk(KERN_DEBUG "modem_result: NO CARRIER %d %d\n",
(info->port.flags & ASYNC_CLOSING),
(!info->port.tty));
info->closing, !info->port.tty);
#endif
m->mdmreg[REG_RINGCNT] = 0;
del_timer(&info->nc_timer);
info->ncarrier = 0;
if ((info->port.flags & ASYNC_CLOSING) || (!info->port.tty))
if (info->closing || !info->port.tty)
return;

#ifdef CONFIG_ISDN_AUDIO
Expand Down Expand Up @@ -2525,7 +2525,7 @@ isdn_tty_modem_result(int code, modem_info *info)
}
}
if (code == RESULT_NO_CARRIER) {
if ((info->port.flags & ASYNC_CLOSING) || (!info->port.tty))
if (info->closing || (!info->port.tty))
return;

if (info->port.flags & ASYNC_CHECK_CD)
Expand Down
Loading

0 comments on commit 96b9b1c

Please sign in to comment.