Skip to content

Commit

Permalink
Merge tag 'tty-3.8-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 merge from Greg Kroah-Hartman:
 "Here's the big tty/serial tree set of changes for 3.8-rc1.

  Contained in here is a bunch more reworks of the tty port layer from
  Jiri and bugfixes from Alan, along with a number of other tty and
  serial driver updates by the various driver authors.

  Also, Jiri has been coerced^Wconvinced to be the co-maintainer of the
  TTY layer, which is much appreciated by me.

  All of these have been in the linux-next tree for a while.

  Signed-off-by: Greg Kroah-Hartman <[email protected]>"

Fixed up some trivial conflicts in the staging tree, due to the fwserial
driver having come in both ways (but fixed up a bit in the serial tree),
and the ioctl handling in the dgrp driver having been done slightly
differently (staging tree got that one right, and removed both
TIOCGSOFTCAR and TIOCSSOFTCAR).

* tag 'tty-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (146 commits)
  staging: sb105x: fix potential NULL pointer dereference in mp_chars_in_buffer()
  staging/fwserial: Remove superfluous free
  staging/fwserial: Use WARN_ONCE when port table is corrupted
  staging/fwserial: Destruct embedded tty_port on teardown
  staging/fwserial: Fix build breakage when !CONFIG_BUG
  staging: fwserial: Add TTY-over-Firewire serial driver
  drivers/tty/serial/serial_core.c: clean up HIGH_BITS_OFFSET usage
  staging: dgrp: dgrp_tty.c: Audit the return values of get/put_user()
  staging: dgrp: dgrp_tty.c: Remove the TIOCSSOFTCAR ioctl handler from dgrp driver
  serial: ifx6x60: Add modem power off function in the platform reboot process
  serial: mxs-auart: unmap the scatter list before we copy the data
  serial: mxs-auart: disable the Receive Timeout Interrupt when DMA is enabled
  serial: max310x: Setup missing "can_sleep" field for GPIO
  tty/serial: fix ifx6x60.c declaration warning
  serial: samsung: add devicetree properties for non-Exynos SoCs
  serial: samsung: fix potential soft lockup during uart write
  tty: vt: Remove redundant null check before kfree.
  tty/8250 Add check for pci_ioremap_bar failure
  tty/8250 Add support for Commtech's Fastcom Async-335 and Fastcom Async-PCIe cards
  tty/8250 Add XR17D15x devices to the exar_handle_irq override
  ...
  • Loading branch information
torvalds committed Dec 11, 2012
2 parents 8966961 + b0ab023 commit c6bd5bc
Show file tree
Hide file tree
Showing 166 changed files with 8,146 additions and 1,782 deletions.
112 changes: 112 additions & 0 deletions Documentation/ABI/testing/sysfs-tty
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,115 @@ Description:
UART port in serial_core, that is bound to TTY like ttyS0.
uartclk = 16 * baud_base

These sysfs values expose the TIOCGSERIAL interface via
sysfs rather than via ioctls.

What: /sys/class/tty/ttyS0/type
Date: October 2012
Contact: Alan Cox <[email protected]>
Description:
Shows the current tty type for this port.

These sysfs values expose the TIOCGSERIAL interface via
sysfs rather than via ioctls.

What: /sys/class/tty/ttyS0/line
Date: October 2012
Contact: Alan Cox <[email protected]>
Description:
Shows the current tty line number for this port.

These sysfs values expose the TIOCGSERIAL interface via
sysfs rather than via ioctls.

What: /sys/class/tty/ttyS0/port
Date: October 2012
Contact: Alan Cox <[email protected]>
Description:
Shows the current tty port I/O address for this port.

These sysfs values expose the TIOCGSERIAL interface via
sysfs rather than via ioctls.

What: /sys/class/tty/ttyS0/irq
Date: October 2012
Contact: Alan Cox <[email protected]>
Description:
Shows the current primary interrupt for this port.

These sysfs values expose the TIOCGSERIAL interface via
sysfs rather than via ioctls.

What: /sys/class/tty/ttyS0/flags
Date: October 2012
Contact: Alan Cox <[email protected]>
Description:
Show the tty port status flags for this port.

These sysfs values expose the TIOCGSERIAL interface via
sysfs rather than via ioctls.

What: /sys/class/tty/ttyS0/xmit_fifo_size
Date: October 2012
Contact: Alan Cox <[email protected]>
Description:
Show the transmit FIFO size for this port.

These sysfs values expose the TIOCGSERIAL interface via
sysfs rather than via ioctls.

What: /sys/class/tty/ttyS0/close_delay
Date: October 2012
Contact: Alan Cox <[email protected]>
Description:
Show the closing delay time for this port in ms.

These sysfs values expose the TIOCGSERIAL interface via
sysfs rather than via ioctls.

What: /sys/class/tty/ttyS0/closing_wait
Date: October 2012
Contact: Alan Cox <[email protected]>
Description:
Show the close wait time for this port in ms.

These sysfs values expose the TIOCGSERIAL interface via
sysfs rather than via ioctls.

What: /sys/class/tty/ttyS0/custom_divisor
Date: October 2012
Contact: Alan Cox <[email protected]>
Description:
Show the custom divisor if any that is set on this port.

These sysfs values expose the TIOCGSERIAL interface via
sysfs rather than via ioctls.

What: /sys/class/tty/ttyS0/io_type
Date: October 2012
Contact: Alan Cox <[email protected]>
Description:
Show the I/O type that is to be used with the iomem base
address.

These sysfs values expose the TIOCGSERIAL interface via
sysfs rather than via ioctls.

What: /sys/class/tty/ttyS0/iomem_base
Date: October 2012
Contact: Alan Cox <[email protected]>
Description:
The I/O memory base for this port.

These sysfs values expose the TIOCGSERIAL interface via
sysfs rather than via ioctls.

What: /sys/class/tty/ttyS0/iomem_reg_shift
Date: October 2012
Contact: Alan Cox <[email protected]>
Description:
Show the register shift indicating the spacing to be used
for accesses on this iomem address.

These sysfs values expose the TIOCGSERIAL interface via
sysfs rather than via ioctls.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@ Required properties:
- reg : Address and length of the register set for the device
- interrupts : Should contain the auart interrupt numbers

Optional properties:
- fsl,auart-dma-channel : The DMA channels, the first is for RX, the other
is for TX. If you add this property, it also means that you
will enable the DMA support for the auart.
Note: due to the hardware bug in imx23(see errata : 2836),
only the imx28 can enable the DMA support for the auart.

Example:
auart0: serial@8006a000 {
compatible = "fsl,imx28-auart", "fsl,imx23-auart";
reg = <0x8006a000 0x2000>;
interrupts = <112 70 71>;
fsl,auart-dma-channel = <8 9>;
};

Note: Each auart port should have an alias correctly numbered in "aliases"
Expand Down
5 changes: 4 additions & 1 deletion Documentation/devicetree/bindings/tty/serial/of-serial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ Required properties:
- "serial" if the port type is unknown.
- reg : offset and length of the register set for the device.
- interrupts : should contain uart interrupt.
- clock-frequency : the input clock frequency for the UART.
- clock-frequency : the input clock frequency for the UART
or
clocks phandle to refer to the clk used as per Documentation/devicetree
/bindings/clock/clock-bindings.txt

Optional properties:
- current-speed : the current active speed of the UART.
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -7430,6 +7430,7 @@ K: ^Subject:.*(?i)trivial

TTY LAYER
M: Greg Kroah-Hartman <[email protected]>
M: Jiri Slaby <[email protected]>
S: Supported
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
F: drivers/tty/
Expand Down
3 changes: 3 additions & 0 deletions arch/alpha/include/asm/ioctls.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
#define TIOCVHANGUP 0x5437
#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */

#define TIOCSERCONFIG 0x5453
#define TIOCSERGWILD 0x5454
Expand Down
5 changes: 4 additions & 1 deletion arch/alpha/kernel/srmcons.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ static const struct tty_operations srmcons_ops = {
static int __init
srmcons_init(void)
{
tty_port_init(&srmcons_singleton.port);
setup_timer(&srmcons_singleton.timer, srmcons_receive_chars,
(unsigned long)&srmcons_singleton);
if (srm_is_registered_console) {
Expand All @@ -215,6 +214,9 @@ srmcons_init(void)
driver = alloc_tty_driver(MAX_SRM_CONSOLE_DEVICES);
if (!driver)
return -ENOMEM;

tty_port_init(&srmcons_singleton.port);

driver->driver_name = "srm";
driver->name = "srm";
driver->major = 0; /* dynamic */
Expand All @@ -227,6 +229,7 @@ srmcons_init(void)
err = tty_register_driver(driver);
if (err) {
put_tty_driver(driver);
tty_port_destroy(&srmcons_singleton.port);
return err;
}
srmcons_driver = driver;
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/imx28.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@
compatible = "fsl,imx28-auart", "fsl,imx23-auart";
reg = <0x8006a000 0x2000>;
interrupts = <112 70 71>;
fsl,auart-dma-channel = <8 9>;
clocks = <&clks 45>;
status = "disabled";
};
Expand Down
9 changes: 0 additions & 9 deletions arch/arm/plat-omap/include/plat/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,6 @@
#define OMAP5UART4 OMAP4UART4
#define ZOOM_UART 95 /* Only on zoom2/3 */

/* This is only used by 8250.c for omap1510 */
#define is_omap_port(pt) ({int __ret = 0; \
if ((pt)->port.mapbase == OMAP1_UART1_BASE || \
(pt)->port.mapbase == OMAP1_UART2_BASE || \
(pt)->port.mapbase == OMAP1_UART3_BASE) \
__ret = 1; \
__ret; \
})

#ifndef __ASSEMBLER__

struct omap_board_data;
Expand Down
1 change: 1 addition & 0 deletions arch/ia64/hp/sim/simserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ static int __init simrs_init(void)
return 0;
err_free_tty:
put_tty_driver(hp_simserial_driver);
tty_port_destroy(&state->port);
return retval;
}

Expand Down
6 changes: 4 additions & 2 deletions arch/m68k/emu/nfcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ static int __init nfcon_init(void)
{
int res;

tty_port_init(&nfcon_tty_port);

stderr_id = nf_get_id("NF_STDERR");
if (!stderr_id)
return -ENODEV;
Expand All @@ -130,6 +128,8 @@ static int __init nfcon_init(void)
if (!nfcon_tty_driver)
return -ENOMEM;

tty_port_init(&nfcon_tty_port);

nfcon_tty_driver->driver_name = "nfcon";
nfcon_tty_driver->name = "nfcon";
nfcon_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM;
Expand All @@ -143,6 +143,7 @@ static int __init nfcon_init(void)
if (res) {
pr_err("failed to register nfcon tty driver\n");
put_tty_driver(nfcon_tty_driver);
tty_port_destroy(&nfcon_tty_port);
return res;
}

Expand All @@ -157,6 +158,7 @@ static void __exit nfcon_exit(void)
unregister_console(&nf_console);
tty_unregister_driver(nfcon_tty_driver);
put_tty_driver(nfcon_tty_driver);
tty_port_destroy(&nfcon_tty_port);
}

module_init(nfcon_init);
Expand Down
3 changes: 3 additions & 0 deletions arch/mips/include/uapi/asm/ioctls.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
#define TIOCGDEV _IOR('T', 0x32, unsigned int) /* Get primary device node of /dev/console */
#define TIOCSIG _IOW('T', 0x36, int) /* Generate signal on Pty slave */
#define TIOCVHANGUP 0x5437
#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */

/* I hope the range from 0x5480 on is free ... */
#define TIOCSCTTY 0x5480 /* become controlling tty */
Expand Down
3 changes: 3 additions & 0 deletions arch/parisc/include/uapi/asm/ioctls.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
#define TIOCGDEV _IOR('T',0x32, int) /* Get primary device node of /dev/console */
#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
#define TIOCVHANGUP 0x5437
#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */

#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
#define FIOCLEX 0x5451
Expand Down
5 changes: 3 additions & 2 deletions arch/parisc/kernel/pdc_cons.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ static int __init pdc_console_tty_driver_init(void)
printk(KERN_INFO "The PDC console driver is still registered, removing CON_BOOT flag\n");
pdc_cons.flags &= ~CON_BOOT;

tty_port_init(&tty_port);

pdc_console_tty_driver = alloc_tty_driver(1);

if (!pdc_console_tty_driver)
return -ENOMEM;

tty_port_init(&tty_port);

pdc_console_tty_driver->driver_name = "pdc_cons";
pdc_console_tty_driver->name = "ttyB";
pdc_console_tty_driver->major = MUX_MAJOR;
Expand All @@ -207,6 +207,7 @@ static int __init pdc_console_tty_driver_init(void)
err = tty_register_driver(pdc_console_tty_driver);
if (err) {
printk(KERN_ERR "Unable to register the PDC console TTY driver\n");
tty_port_destroy(&tty_port);
return err;
}

Expand Down
3 changes: 3 additions & 0 deletions arch/powerpc/include/uapi/asm/ioctls.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
#define TIOCVHANGUP 0x5437
#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */

#define TIOCSERCONFIG 0x5453
#define TIOCSERGWILD 0x5454
Expand Down
3 changes: 3 additions & 0 deletions arch/sh/include/uapi/asm/ioctls.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
#define TIOCVHANGUP _IO('T', 0x37)
#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */

#define TIOCSERCONFIG _IO('T', 83) /* 0x5453 */
#define TIOCSERGWILD _IOR('T', 84, int) /* 0x5454 */
Expand Down
3 changes: 3 additions & 0 deletions arch/sparc/include/uapi/asm/ioctls.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#define TCSETSF2 _IOW('T', 15, struct termios2)
#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
#define TIOCVHANGUP _IO('T', 0x37)
#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */

/* Note that all the ioctls that are not available in Linux have a
* double underscore on the front to: a) avoid some programs to
Expand Down
17 changes: 2 additions & 15 deletions arch/um/drivers/chan_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,8 @@ static const struct chan_ops not_configged_ops = {

static void tty_receive_char(struct tty_struct *tty, char ch)
{
if (tty == NULL)
return;

if (I_IXON(tty) && !I_IXOFF(tty) && !tty->raw) {
if (ch == STOP_CHAR(tty)) {
stop_tty(tty);
return;
}
else if (ch == START_CHAR(tty)) {
start_tty(tty);
return;
}
}

tty_insert_flip_char(tty, ch, TTY_NORMAL);
if (tty)
tty_insert_flip_char(tty, ch, TTY_NORMAL);
}

static int open_one_chan(struct chan *chan)
Expand Down
2 changes: 2 additions & 0 deletions arch/um/drivers/line.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,8 @@ int register_lines(struct line_driver *line_driver,
printk(KERN_ERR "register_lines : can't register %s driver\n",
line_driver->name);
put_tty_driver(driver);
for (i = 0; i < nlines; i++)
tty_port_destroy(&lines[i].port);
return err;
}

Expand Down
3 changes: 3 additions & 0 deletions arch/x86/platform/ce4100/ce4100.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ static void ce4100_serial_fixup(int port, struct uart_port *up,
up->membase =
(void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
up->membase += up->mapbase & ~PAGE_MASK;
up->mapbase += port * 0x100;
up->membase += port * 0x100;
up->iotype = UPIO_MEM32;
up->regshift = 2;
up->irq = 4;
}
#endif
up->iobase = 0;
Expand Down
3 changes: 3 additions & 0 deletions arch/xtensa/include/uapi/asm/ioctls.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
#define TIOCVHANGUP _IO('T', 0x37)
#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */

#define TIOCSERCONFIG _IO('T', 83)
#define TIOCSERGWILD _IOR('T', 84, int)
Expand Down
1 change: 1 addition & 0 deletions arch/xtensa/platforms/iss/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ static __exit void rs_exit(void)
printk("ISS_SERIAL: failed to unregister serial driver (%d)\n",
error);
put_tty_driver(serial_driver);
tty_port_destroy(&serial_port);
}


Expand Down
Loading

0 comments on commit c6bd5bc

Please sign in to comment.