Skip to content

Commit

Permalink
Merge tag 'tty-4.4-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 driver updates from Greg KH:
 "Here is the big tty and serial driver update for 4.4-rc1.

  Lots of serial driver updates and a few small tty core changes.  Full
  details in the shortlog.

  All of these have been in linux-next for a while"

* tag 'tty-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (148 commits)
  tty: Use unbound workqueue for all input workers
  tty: Abstract tty buffer work
  tty: Prevent tty teardown during tty_write_message()
  tty: core: Use correct spinlock flavor in tiocspgrp()
  tty: Combine SIGTTOU/SIGTTIN handling
  serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty()
  ttyFDC: Fix build problems due to use of module_{init,exit}
  tty: remove unneeded return statement
  serial: 8250_mid: add support for DMA engine handling from UART MMIO
  dmaengine: hsu: remove platform data
  dmaengine: hsu: introduce stubs for the exported functions
  dmaengine: hsu: make the UART driver in control of selecting this driver
  serial: fix mctrl helper functions
  serial: 8250_pci: Intel MID UART support to its own driver
  serial: fsl_lpuart: add earlycon support
  tty: disable unbind for old 74xx based serial/mpsc console port
  serial: pl011: Spelling s/clocks-names/clock-names/
  n_tty: Remove reader wakeups for TTY_BREAK/TTY_PARITY chars
  tty: synclink, fix indentation
  serial: at91, fix rs485 properties
  ...
  • Loading branch information
torvalds committed Nov 5, 2015
2 parents 3d6f478 + e052c6d commit fd0d351
Show file tree
Hide file tree
Showing 82 changed files with 2,734 additions and 1,941 deletions.
3 changes: 2 additions & 1 deletion Documentation/devicetree/bindings/serial/ingenic,uart.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
* Ingenic SoC UART

Required properties:
- compatible : "ingenic,jz4740-uart" or "ingenic,jz4780-uart"
- compatible : "ingenic,jz4740-uart", "ingenic,jz4760-uart",
"ingenic,jz4775-uart" or "ingenic,jz4780-uart"
- reg : offset and length of the register set for the device.
- interrupts : should contain uart interrupt.
- clocks : phandles to the module & baud clocks.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/serial/pl011.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Optional properties:
must correspond to the PCLK clocking the internal logic
of the block. Just listing one clock (the first one) is
deprecated.
- clocks-names:
- clock-names:
When present, the first clock listed must be named
"uartclk" and the second clock listed must be named
"apb_pclk"
Expand Down
6 changes: 6 additions & 0 deletions Documentation/devicetree/bindings/serial/qcom,msm-uartdm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ Required properties:
Optional properties:
- dmas: Should contain dma specifiers for transmit and receive channels
- dma-names: Should contain "tx" for transmit and "rx" for receive channels
- qcom,tx-crci: Identificator <u32> for Client Rate Control Interface to be
used with TX DMA channel. Required when using DMA for transmission
with UARTDM v1.3 and bellow.
- qcom,rx-crci: Identificator <u32> for Client Rate Control Interface to be
used with RX DMA channel. Required when using DMA for reception
with UARTDM v1.3 and bellow.

Note: Aliases may be defined to ensure the correct ordering of the UARTs.
The alias serialN will result in the UART being assigned port N. If any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Required properties:
- "renesas,scifa-r8a7794" for R8A7794 (R-Car E2) SCIFA compatible UART.
- "renesas,scifb-r8a7794" for R8A7794 (R-Car E2) SCIFB compatible UART.
- "renesas,hscif-r8a7794" for R8A7794 (R-Car E2) HSCIF compatible UART.
- "renesas,scif-r8a7795" for R8A7795 (R-Car H3) SCIF compatible UART.
- "renesas,hscif-r8a7795" for R8A7795 (R-Car H3) HSCIF compatible UART.
- "renesas,scifa-sh73a0" for SH73A0 (SH-Mobile AG5) SCIFA compatible UART.
- "renesas,scifb-sh73a0" for SH73A0 (SH-Mobile AG5) SCIFB compatible UART.
- "renesas,scif" for generic SCIF compatible UART.
Expand Down
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/serial/snps-dw-apb-uart.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ The supplying peripheral clock can also be handled, needing a second property
Required elements: "baudclk", "apb_pclk"

Optional properties:
- snps,uart-16550-compatible : reflects the value of UART_16550_COMPATIBLE
configuration parameter. Define this if your UART does not implement the busy
functionality.
- resets : phandle to the parent reset controller.
- reg-shift : quantity to shift the register offsets by. If this property is
not present then the register offsets are not shifted.
Expand Down
7 changes: 7 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
serial port must already be setup and configured.
Options are not yet supported.

lpuart,<addr>
lpuart32,<addr>
Use early console provided by Freescale LP UART driver
found on Freescale Vybrid and QorIQ LS1021A processors.
A valid base address must be provided, and the serial
port must already be setup and configured.

earlyprintk= [X86,SH,BLACKFIN,ARM,M68k]
earlyprintk=vga
earlyprintk=efi
Expand Down
10 changes: 9 additions & 1 deletion Documentation/serial/driver
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,13 @@ Modem control lines via GPIO

Some helpers are provided in order to set/get modem control lines via GPIO.

mctrl_gpio_init(dev, idx):
mctrl_gpio_init(port, idx):
This will get the {cts,rts,...}-gpios from device tree if they are
present and request them, set direction etc, and return an
allocated structure. devm_* functions are used, so there's no need
to call mctrl_gpio_free().
As this sets up the irq handling make sure to not handle changes to the
gpio input lines in your driver, too.

mctrl_gpio_free(dev, gpios):
This will free the requested gpios in mctrl_gpio_init().
Expand All @@ -458,3 +460,9 @@ mctrl_gpio_set(gpios, mctrl):

mctrl_gpio_get(gpios, mctrl):
This will update mctrl with the gpios values.

mctrl_gpio_enable_ms(gpios):
Enables irqs and handling of changes to the ms lines.

mctrl_gpio_disable_ms(gpios):
Disables irqs and handling of changes to the ms lines.
60 changes: 39 additions & 21 deletions Documentation/serial/tty.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ TTY side interfaces:
open() - Called when the line discipline is attached to
the terminal. No other call into the line
discipline for this tty will occur until it
completes successfully. Returning an error will
prevent the ldisc from being attached. Can sleep.
completes successfully. Should initialize any
state needed by the ldisc, and set receive_room
in the tty_struct to the maximum amount of data
the line discipline is willing to accept from the
driver with a single call to receive_buf().
Returning an error will prevent the ldisc from
being attached. Can sleep.

close() - This is called on a terminal when the line
discipline is being unplugged. At the point of
Expand All @@ -52,9 +57,16 @@ hangup() - Called when the tty line is hung up.
No further calls into the ldisc code will occur.
The return value is ignored. Can sleep.

write() - A process is writing data through the line
discipline. Multiple write calls are serialized
by the tty layer for the ldisc. May sleep.
read() - (optional) A process requests reading data from
the line. Multiple read calls may occur in parallel
and the ldisc must deal with serialization issues.
If not defined, the process will receive an EIO
error. May sleep.

write() - (optional) A process requests writing data to the
line. Multiple write calls are serialized by the
tty layer for the ldisc. If not defined, the
process will receive an EIO error. May sleep.

flush_buffer() - (optional) May be called at any point between
open and close, and instructs the line discipline
Expand All @@ -69,27 +81,33 @@ set_termios() - (optional) Called on termios structure changes.
termios semaphore so allowed to sleep. Serialized
against itself only.

read() - Move data from the line discipline to the user.
Multiple read calls may occur in parallel and the
ldisc must deal with serialization issues. May
sleep.

poll() - Check the status for the poll/select calls. Multiple
poll calls may occur in parallel. May sleep.
poll() - (optional) Check the status for the poll/select
calls. Multiple poll calls may occur in parallel.
May sleep.

ioctl() - Called when an ioctl is handed to the tty layer
that might be for the ldisc. Multiple ioctl calls
may occur in parallel. May sleep.
ioctl() - (optional) Called when an ioctl is handed to the
tty layer that might be for the ldisc. Multiple
ioctl calls may occur in parallel. May sleep.

compat_ioctl() - Called when a 32 bit ioctl is handed to the tty layer
that might be for the ldisc. Multiple ioctl calls
may occur in parallel. May sleep.
compat_ioctl() - (optional) Called when a 32 bit ioctl is handed
to the tty layer that might be for the ldisc.
Multiple ioctl calls may occur in parallel.
May sleep.

Driver Side Interfaces:

receive_buf() - Hand buffers of bytes from the driver to the ldisc
for processing. Semantics currently rather
mysterious 8(
receive_buf() - (optional) Called by the low-level driver to hand
a buffer of received bytes to the ldisc for
processing. The number of bytes is guaranteed not
to exceed the current value of tty->receive_room.
All bytes must be processed.

receive_buf2() - (optional) Called by the low-level driver to hand
a buffer of received bytes to the ldisc for
processing. Returns the number of bytes processed.

If both receive_buf() and receive_buf2() are
defined, receive_buf2() should be preferred.

write_wakeup() - May be called at any point between open and close.
The TTY_DO_WRITE_WAKEUP flag indicates if a call
Expand Down
55 changes: 55 additions & 0 deletions arch/arm64/include/asm/dcc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* Copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* A call to __dcc_getchar() or __dcc_putchar() is typically followed by
* a call to __dcc_getstatus(). We want to make sure that the CPU does
* not speculative read the DCC status before executing the read or write
* instruction. That's what the ISBs are for.
*
* The 'volatile' ensures that the compiler does not cache the status bits,
* and instead reads the DCC register every time.
*/
#ifndef __ASM_DCC_H
#define __ASM_DCC_H

#include <asm/barrier.h>

static inline u32 __dcc_getstatus(void)
{
u32 ret;

asm volatile("mrs %0, mdccsr_el0" : "=r" (ret));

return ret;
}

static inline char __dcc_getchar(void)
{
char c;

asm volatile("mrs %0, dbgdtrrx_el0" : "=r" (c));
isb();

return c;
}

static inline void __dcc_putchar(char c)
{
/*
* The typecast is to make absolutely certain that 'c' is
* zero-extended.
*/
asm volatile("msr dbgdtrtx_el0, %0"
: : "r" ((unsigned long)(unsigned char)c));
isb();
}

#endif
9 changes: 0 additions & 9 deletions drivers/char/pcmcia/synclink_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2507,15 +2507,6 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp)
printk("%s(%d):mgslpc_open(%s), old ref count = %d\n",
__FILE__, __LINE__, tty->driver->name, port->count);

/* If port is closing, signal caller to try again */
if (port->flags & ASYNC_CLOSING){
wait_event_interruptible_tty(tty, port->close_wait,
!(port->flags & ASYNC_CLOSING));
retval = ((port->flags & ASYNC_HUP_NOTIFY) ?
-EAGAIN : -ERESTARTSYS);
goto cleanup;
}

port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0;

spin_lock_irqsave(&info->netlock, flags);
Expand Down
9 changes: 2 additions & 7 deletions drivers/dma/hsu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,5 @@ config HSU_DMA
select DMA_VIRTUAL_CHANNELS

config HSU_DMA_PCI
tristate "High Speed UART DMA PCI driver"
depends on PCI
select HSU_DMA
help
Support the High Speed UART DMA on the platfroms that
enumerate it as a PCI device. For example, Intel Medfield
has integrated this HSU DMA controller.
tristate
depends on HSU_DMA && PCI
24 changes: 7 additions & 17 deletions drivers/dma/hsu/hsu.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ irqreturn_t hsu_dma_irq(struct hsu_dma_chip *chip, unsigned short nr)
u32 sr;

/* Sanity check */
if (nr >= chip->pdata->nr_channels)
if (nr >= chip->hsu->nr_channels)
return IRQ_NONE;

hsuc = &chip->hsu->chan[nr];
Expand Down Expand Up @@ -375,7 +375,6 @@ static void hsu_dma_free_chan_resources(struct dma_chan *chan)
int hsu_dma_probe(struct hsu_dma_chip *chip)
{
struct hsu_dma *hsu;
struct hsu_dma_platform_data *pdata = chip->pdata;
void __iomem *addr = chip->regs + chip->offset;
unsigned short i;
int ret;
Expand All @@ -386,25 +385,16 @@ int hsu_dma_probe(struct hsu_dma_chip *chip)

chip->hsu = hsu;

if (!pdata) {
pdata = devm_kzalloc(chip->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;
/* Calculate nr_channels from the IO space length */
hsu->nr_channels = (chip->length - chip->offset) / HSU_DMA_CHAN_LENGTH;

chip->pdata = pdata;

/* Guess nr_channels from the IO space length */
pdata->nr_channels = (chip->length - chip->offset) /
HSU_DMA_CHAN_LENGTH;
}

hsu->chan = devm_kcalloc(chip->dev, pdata->nr_channels,
hsu->chan = devm_kcalloc(chip->dev, hsu->nr_channels,
sizeof(*hsu->chan), GFP_KERNEL);
if (!hsu->chan)
return -ENOMEM;

INIT_LIST_HEAD(&hsu->dma.channels);
for (i = 0; i < pdata->nr_channels; i++) {
for (i = 0; i < hsu->nr_channels; i++) {
struct hsu_dma_chan *hsuc = &hsu->chan[i];

hsuc->vchan.desc_free = hsu_dma_desc_free;
Expand Down Expand Up @@ -440,7 +430,7 @@ int hsu_dma_probe(struct hsu_dma_chip *chip)
if (ret)
return ret;

dev_info(chip->dev, "Found HSU DMA, %d channels\n", pdata->nr_channels);
dev_info(chip->dev, "Found HSU DMA, %d channels\n", hsu->nr_channels);
return 0;
}
EXPORT_SYMBOL_GPL(hsu_dma_probe);
Expand All @@ -452,7 +442,7 @@ int hsu_dma_remove(struct hsu_dma_chip *chip)

dma_async_device_unregister(&hsu->dma);

for (i = 0; i < chip->pdata->nr_channels; i++) {
for (i = 0; i < hsu->nr_channels; i++) {
struct hsu_dma_chan *hsuc = &hsu->chan[i];

tasklet_kill(&hsuc->vchan.task);
Expand Down
1 change: 1 addition & 0 deletions drivers/dma/hsu/hsu.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ struct hsu_dma {

/* channels */
struct hsu_dma_chan *chan;
unsigned short nr_channels;
};

static inline struct hsu_dma *to_hsu_dma(struct dma_device *ddev)
Expand Down
2 changes: 1 addition & 1 deletion drivers/dma/hsu/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static irqreturn_t hsu_pci_irq(int irq, void *dev)
irqreturn_t ret = IRQ_NONE;

dmaisr = readl(chip->regs + HSU_PCI_DMAISR);
for (i = 0; i < chip->pdata->nr_channels; i++) {
for (i = 0; i < chip->hsu->nr_channels; i++) {
if (dmaisr & 0x1)
ret |= hsu_dma_irq(chip, i);
dmaisr >>= 1;
Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/i4l/isdn_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
* line status register.
*/
if (port->flags & ASYNC_INITIALIZED) {
tty_wait_until_sent_from_close(tty, 3000); /* 30 seconds timeout */
tty_wait_until_sent(tty, 3000); /* 30 seconds timeout */
/*
* Before we drop DTR, make sure the UART transmitter
* has completely drained; this is especially
Expand Down
9 changes: 0 additions & 9 deletions drivers/tty/cyclades.c
Original file line number Diff line number Diff line change
Expand Up @@ -1576,15 +1576,6 @@ static int cy_open(struct tty_struct *tty, struct file *filp)
current->pid, info->port.count);
#endif

/*
* If the port is the middle of closing, bail out now
*/
if (info->port.flags & ASYNC_CLOSING) {
wait_event_interruptible_tty(tty, info->port.close_wait,
!(info->port.flags & ASYNC_CLOSING));
return (info->port.flags & ASYNC_HUP_NOTIFY) ? -EAGAIN: -ERESTARTSYS;
}

/*
* Start up serial port
*/
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/hvc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ config HVC_UDBG

config HVC_DCC
bool "ARM JTAG DCC console"
depends on ARM
depends on ARM || ARM64
select HVC_DRIVER
help
This console uses the JTAG DCC on ARM to create a console under the HVC
Expand Down
Loading

0 comments on commit fd0d351

Please sign in to comment.