aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
AgeCommit message (Collapse)Author
2016-06-25tty: xuartps: disable clocks when not usedShubhrajyoti Datta
Currently the clocks are enabled at probe and disabled at remove. Instead enable the clocks when used. Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty/serial: atmel: fix RS485 half duplex with DMAAlexandre Belloni
When using DMA, half duplex doesn't work properly because rx is not stopped before starting tx. Ensure we call atmel_stop_rx() in the DMA case. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty/serial: atmel: add comment for the ring buffer size macroLudovic Desroches
There is a macro named ATMEL_SERIAL_RINGSIZE which suggesting that it corresponds to the real size of the ring buffer. Let warn people that there is a factor of four since allocation size is sizeof(struct atmel_uart_char) * ATMEL_SERIAL_RINGSIZE. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty/serial: atmel: split tx and rx pathsNicolas Ferre
Split TX and RX paths to not schedule RX tasklet on TX events and vice versa. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty/serial: atmel: re-integrate status check in irq handlerNicolas Ferre
The IRQ status check and related actions was done in the tasklet without benefit. So, move it back to the IRQ context to simplify IRQ handling and having the possibility to split the tasklet in two separated ones for receive and transmit actions. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: vt: Fix soft lockup in fbcon cursor blink timer.David Daney
We are getting somewhat random soft lockups with this signature: [ 86.992215] [<fffffc00080935e0>] el1_irq+0xa0/0x10c [ 86.997082] [<fffffc000841822c>] cursor_timer_handler+0x30/0x54 [ 87.002991] [<fffffc000810ec44>] call_timer_fn+0x54/0x1a8 [ 87.008378] [<fffffc000810ef88>] run_timer_softirq+0x1c4/0x2bc [ 87.014200] [<fffffc000809077c>] __do_softirq+0x114/0x344 [ 87.019590] [<fffffc00080af45c>] irq_exit+0x74/0x98 [ 87.024458] [<fffffc00080fac20>] __handle_domain_irq+0x98/0xfc [ 87.030278] [<fffffc000809056c>] gic_handle_irq+0x94/0x190 This is caused by the vt visual_init() function calling into fbcon_init() with a vc_cur_blink_ms value of zero. This is a transient condition, as it is later set to a non-zero value. But, if the timer happens to expire while the blink rate is zero, it goes into an endless loop, and we get soft lockup. The fix is to initialize vc_cur_blink_ms before calling the con_init() function. Signed-off-by: David Daney <david.daney@cavium.com> Cc: stable@vger.kernel.org Acked-by: Pavel Machek <pavel@ucw.cz> Tested-by: Ming Lei <ming.lei@canonical.com> Acked-by: Scot Doyle <lkml14@scotdoyle.com> Tested-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty/vt/keyboard: use memdup_user().Muhammad Falak R Wani
Use memdup_user to duplicate a memory region from user-space to kernel-space, instead of open coding using kmalloc & copy_from_user. Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: serial_core: Perform NULL checks for release/request_port opsFabio Estevam
Doing the following UART bind/unbind sequence on a i.mx platform causes a kernel crash due to NULL pointer dereference: echo 21f4000.serial > /sys/bus/platform/drivers/imx-uart/bind echo 21f4000.serial > /sys/bus/platform/drivers/imx-uart/unbind Fix this problem by adding NULL checks prior to calling release/request_port ops. Reported-by: Fugang Duan <fugang.duan@nxp.com> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Tested-by: Fugang Duan <fugang.duan@nxp.com> Acked-by: Fugang Duan <fugang.duan@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: Make SERIAL_MPS2_UART depend on ARCH_MPS2Geert Uytterhoeven
Enabling support for the UART on the ARM MPS2 platform only make sense when compiling for the ARM MPS2 platform, unless compile-testing. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: serial: msm: fix definition of msm_stop_dmaBen Dooks
The msm_stop_dma() is not exported from the driver, so make it static to stop the following warning: drivers/tty/serial/msm_serial.c:84:6: warning: symbol 'msm_stop_dma' was not declared. Should it be static? Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Acked-by: Andy Gross <andy.gross@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: serial: msm: Don't read off end of tx fifoBjorn Andersson
For dm uarts in pio mode tx data is transferred to the fifo register 4 bytes at a time, but care is not taken when these 4 bytes spans the end of the xmit buffer so the loop might read up to 3 bytes past the buffer and then skip the actual data at the beginning of the buffer. Fix this by, analogous to the DMA case, make sure the chunk doesn't wrap the xmit buffer. Fixes: 3a878c430fd6 ("tty: serial: msm: Add TX DMA support") Cc: Ivan Ivanov <iivanov.xz@gmail.com> Cc: stable@vger.kernel.org Reported-by: Frank Rowand <frowand.list@gmail.com> Reported-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Acked-by: Andy Gross <andy.gross@linaro.org> Tested-by: Frank Rowand <frank.rowand@am.sony.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty:serial:msm:Do not restore Rx interrupts in DMACharanya Venkatraman
Avoid data corruption issues that result in CRC errors during file transfers over serial ports at higher baud rates. The current msm_serial driver masks the FIFO Rx interrupts in msm_start_rx_dma() since Rx FIFO interrupts are not required in DMA mode. However, msm_complete_rx_dma() re-enables the Rx FIFO interrupts which could cause RXSTALE event to be processed when a TXLEV interrupt occurs. The following is the sequence of events that could occur resulting in data corruption. msm_start_rx_dma -> msm_complete_rx_dma --> spin_unlock_irqrestore(&port->lock) --> msm_uart_irq()(For TXLEV interrupt) --> msm_handle_rx_dm() (Read from FIFO resulting in data corruption) The patch fixes the issue by not restoring the RXLEV and RXSTALE interrupts in msm_complete_rx_dma(). These interrupts are required only in FIFO mode. Signed-off-by: Charanya Venkatraman <charanya@codeaurora.org> Acked-by: Andy Gross <andy.gross@linaro.org> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: serial: msm: Cleanup include usageStephen Boyd
The hrtimer include isn't used and neither is serial. Drop those ones. The irq.h header really should be interrupt.h because this is an interrupt user and not an interrupt chip. Finally add wait.h for the wake_up*() usage in this driver and kernel.h for container_of(). Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Andy Gross <andy.gross@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: serial: msm: Only configure MND registers on hw that has itStephen Boyd
The registers that msm_serial_set_mnd_regs() writes only exist on the non-uartdm hardware, so let's return early here if this function is called on uartdm hardware. This also prevents us from messing up the uartclk variable if the uartclk rate happens to be 19.2 or 4.8 MHz. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Andy Gross <andy.gross@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: serial: msm: Move header file into driverStephen Boyd
This header file is only used by the driver, so let's merge the two together to reduce files and make it easier to see the whole driver without flipping through two files. This also makes it easier to use the structures defined in msm_serial.c in the functions that are defined in msm_serial.h by placing them in the proper locations. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Andy Gross <andy.gross@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: 8250_early: Add earlycon support for Synopsys DesignWare ABP UARTKefeng Wang
Some board like Hisilicon D02 uses Synopsys DesignWare ABP UART, declare an OF early console for it, so early console device can be enabled with comand line "earlycon"(without option) via the "stdout-path" property in device-tree. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Tested-by: Jon Mason <jon.mason@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: sh-sci: Clear (H)SCIF timeout and overrun during resetGeert Uytterhoeven
Add the missing timeout bit definition for (H)SCIF. Clear the timeout and overrun flag bits during UART reset, cfr. the initialization flowchart in the datasheet. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: sh-sci: Clear RX, error, and break flags during resetGeert Uytterhoeven
Setting the FIFO reset bits is not sufficient to reset the RX FIFO. After this the status register's RDF flag bit may still be set, causing the reception of one stale byte of data. To fix this, clear all status flag bits related to reception, error, and break handling, cfr. the initialization flowchart in the datasheet. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: sh-sci: Do not start transfers from sci_startup()Geert Uytterhoeven
FIFO reset is done in sci_reset(), called from sci_set_termios(), while sci_start_tx() and sci_start_rx() are called before, from sci_startup(). However, starting transfers before the UART's FIFOs have been reset may cause reading of stale data. Remove the calls to sci_start_tx() and sci_start_rx() from sci_startup() to fix this. Transfers are still started when needed: - sci_start_rx() is called from sci_set_termios() after FIFO reset, if the CREAD flag is set, - sci_start_tx() is called from uart_change_speed() immediately thereafter, if transmission is enabled. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: sh-sci: Add DT support for dedicated RTS/CTSGeert Uytterhoeven
Add support for indicating the availability of dedicated lines for RTS/CTS hardware flow control, using the standard "uart-has-rtscts" DT property. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: sh-sci: Fix support for hardware-assisted RTS/CTSGeert Uytterhoeven
The existing support for hardware-assisted RTS/CTS is rudimentary and doesn't work. Add support for hardware-assisted RTS/CTS hardware flow control for the (H)SCIF, SCIFA, and SCIFB variants. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: sh-sci: Add pin initialization for SCIFA/SCIFBGeert Uytterhoeven
Before, the driver relied on initialization by the boot loader, or by implicit reset state. Note that unlike on (H)SCIF, the RTS/CTS bits exist only if dedicated RTS/CTS pins are available, which depends on the SoC and UART instance. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: sh-sci: Correct pin initialization on (H)SCIFGeert Uytterhoeven
Correct pin initialization on (H)SCIF: - RTS must be deasserted (it's active low), - SCK must be an input, as it may be used as the optional external clock input. Initial pin configuration must always be done: - Regardless of the presence of dedicated RTS and CTS pins: if the register exists, the RTS/CTS bits exist, too, - Regardless of hardware flow control being enabled or not: RTS must be deasserted. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: sh-sci: Add more Serial Port Control/Data Register documentationGeert Uytterhoeven
Improve documentation for the SCIFA/SCIFB Serial Port Control and Data Registers: - State clearly that the RTS and CTS lines are active-low, - Document the bits related to the serial port's SCK, RXD, and TXD pins. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: sh-sci: Add more Serial Port Register documentationGeert Uytterhoeven
Improve documentation for the (H)SCIF Serial Port Register: - Make it clear the RTS and CTS lines are active-low, - Document the bits related to the serial port's clock pin. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: sh-sci: Do not open-code sci_getreg()Geert Uytterhoeven
Replace open-coded variants of sci_getreg() by function calls, and drop intermediate variables where appropriate. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: sh-sci: Add support for GPIO-controlled modem linesGeert Uytterhoeven
Enhance the Renesas SCI UART driver to add support for GPIO-controlled modem lines (CTS, DSR, DCD, RNG, RTS, DTR), using the serial_mctrl_gpio helpers. GPIO-controlled modem lines can be used when dedicated modem lines are not available. Invalid configurations specifying both GPIO RTS/CTS and dedicated RTS/CTS are rejected. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25serial: sh-sci: Always set TIOCM_CTS in .get_mctrl() callbackGeert Uytterhoeven
Documentation/serial/driver clearly states: If the port does not support CTS, DCD or DSR, the driver should indicate that the signal is permanently active. Hence always set TIOCM_CTS, as we currently don't look at the CTS hardware line state at all. FWIW, this fixes the transmit path when hardware-assisted flow control is enabled, and userspace enables CRTSCTS. The receive path is still broken, as RTS is never asserted. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: vt, remove unused vc_deccolmJiri Slaby
vc_deccolm is only set and never read, remove the member from vc_data. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: vt, ignore PIO_UNIMAPCLR paramJiri Slaby
We do not do hashtables for unicode fonts since 1995 (1.3.28). So it is time to remove the second parameter of con_clear_unimap and ignore the advice from userspace completely. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: vt, convert more macros to functionsJiri Slaby
Namely convert: * IS_FG -> con_is_fg * DO_UPDATE -> con_should_update * CON_IS_VISIBLE -> con_is_visible DO_UPDATE was a weird name for a yes/no answer, so the new name is con_should_update. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Thomas Winischhofer <thomas@winischhofer.net> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Cc: linux-usb@vger.kernel.org Cc: linux-fbdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: vt, whitespace cleanup in csi_mJiri Slaby
Flush the switch cases to be aligned with the switch. Mostly everything can now fit to the 80-chars terminal. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: vt, too many commands per line in rgb_foregroundJiri Slaby
Do not opencode max3, use the macro. Separate commands. Until now, I have not noticed the comma. Make it one line, one command. And make the code obvious. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: vt, do not pass structure over stackJiri Slaby
The compiler noticed passing structure over stack. Even though rgb is a small structure, let us define one and pass that over all the functions wherever needed. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: vt, separate T.416 high colors handlerJiri Slaby
The code with T.416 high colors handling is flushed to the right and hard to read. Move the code to a separate function and remove code duplication for foreground & background colors. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: vt, get rid of ugly FLUSH macroJiri Slaby
It's a macro accessing and changing some local variables. And the code uses it without appending semicolon which confuses everybody too. Switch from this bad guy to a sane standard function. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: vt, drop VT_BUF_VRAM_ONLYJiri Slaby
It is never defined. And I spent quite some time looking into the history and cannot find how this was ever used. Given it was not used in the history, I doubt it currently works as expected after the years of changes all over the code. So kill it. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: vt, consw->con_set_palette cleanupJiri Slaby
* allow NULL consw->con_set_palette (some consoles define an empty hook) * => remove empty hooks now * return value of consw->con_set_palette is never checked => make the function void * document consw->con_set_palette a bit Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Thomas Winischhofer <thomas@winischhofer.net> Cc: linux-usb@vger.kernel.org Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Cc: linux-fbdev@vger.kernel.org Cc: linux-parisc@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: vt, consw->con_scrolldelta cleanupJiri Slaby
* allow NULL consw->con_scrolldelta (some consoles define an empty hook) * => remove empty hooks now * return value of consw->con_scrolldelta is never checked => make the function void * document consw->con_scrolldelta a bit Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Thomas Winischhofer <thomas@winischhofer.net> Cc: linux-usb@vger.kernel.org Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Cc: linux-fbdev@vger.kernel.org Cc: linux-parisc@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25vt: remove lines parameter from scrollbackJiri Slaby
It is always called with 0, so remove the parameter and pass the default down to scrolldelta without checking. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: 8250, remove shadow and unused variablesJiri Slaby
The compiler complains about variables that are set, but never used: * intX variables in exar_handle_irq drivers/tty/serial/8250/8250_port.c:1864:34: warning: variable ‘int3’ set but not used [-Wunused-but-set-variable] * val variable in pci_quatech_wqopr drivers/tty/serial/8250/8250_pci.c:1139:10: warning: variable ‘val’ set but not used [-Wunused-but-set-variable] And about a shadow variable: * tmout in wait_for_xmitr is defined twice with the same type. Both of them are also initialized before use. Remove all of them. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Matt Schulte <matts@commtech-fastcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25TTY: serial, handle platform_get_irq retval properlyJiri Slaby
platform_get_irq can fail, so we should handle negative value when returned. [v2] platform_get_irq can actually return zero on some platforms. So do not remove checks for irq == 0 there. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Russell King <linux@arm.linux.org.uk> Cc: "Uwe Kleine-König" <kernel@pengutronix.de> Cc: Russell King <linux@armlinux.org.uk> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Laxman Dewangan <ldewangan@nvidia.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Alexandre Courbot <gnurou@gmail.com> Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-tegra@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: 8250, kill DEBUG_INTRJiri Slaby
Convert DEBUG_INTR to pr_debug: * defined semantics (DEBUG, DYNAMIC_DEBUG) * KERN_DEBUG level instead of KERN_DEFAULT * emit __func__ and \n * verified 'fmt' even when !DEBUG I wonder if anybody ever used that or whether we should just drop the lines. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: 8250, drop unused members from struct old_serial_portJiri Slaby
hub6 and irqflags from struct old_serial_port are nowhere set. Drop them from the structure and replace the reads by zeros. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: stop defining STD_COM_FLAGS in driversJiri Slaby
STD_COM_FLAGS is mostly a bad name for what the drivers thinks it is. Stop using it and pass the flags directly. cyclades defines it as 0, so we do not assign anything to freshly tty_port_init'ed structure. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: cyclades+mxser, do not initialize to zeroJiri Slaby
Do not initialize members of initialized structures to zero. They are zeroed automatically. Part of hub6 cleanup series. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-25tty: ipwireless, cleanup TIOCGSERIALJiri Slaby
In ipwireless_get_serial_info, struct serial_struct is memset to 0 and then some members set to 0 explicitly. Remove the latter as it is obviously superfluous. And remove the retinfo check against NULL. copy_to_user will take care of that. Part of hub6 cleanup series. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Jiri Kosina <jikos@kernel.org> Acked-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-05devpts: Make each mount of devpts an independent filesystem.Eric W. Biederman
The /dev/ptmx device node is changed to lookup the directory entry "pts" in the same directory as the /dev/ptmx device node was opened in. If there is a "pts" entry and that entry is a devpts filesystem /dev/ptmx uses that filesystem. Otherwise the open of /dev/ptmx fails. The DEVPTS_MULTIPLE_INSTANCES configuration option is removed, so that userspace can now safely depend on each mount of devpts creating a new instance of the filesystem. Each mount of devpts is now a separate and equal filesystem. Reserved ttys are now available to all instances of devpts where the mounter is in the initial mount namespace. A new vfs helper path_pts is introduced that finds a directory entry named "pts" in the directory of the passed in path, and changes the passed in path to point to it. The helper path_pts uses a function path_parent_directory that was factored out of follow_dotdot. In the implementation of devpts: - devpts_mnt is killed as it is no longer meaningful if all mounts of devpts are equal. - pts_sb_from_inode is replaced by just inode->i_sb as all cached inodes in the tty layer are now from the devpts filesystem. - devpts_add_ref is rolled into the new function devpts_ptmx. And the unnecessary inode hold is removed. - devpts_del_ref is renamed devpts_release and reduced to just a deacrivate_super. - The newinstance mount option continues to be accepted but is now ignored. In devpts_fs.h definitions for when !CONFIG_UNIX98_PTYS are removed as they are never used. Documentation/filesystems/devices.txt is updated to describe the current situation. This has been verified to work properly on openwrt-15.05, centos5, centos6, centos7, debian-6.0.2, debian-7.9, debian-8.2, ubuntu-14.04.3, ubuntu-15.10, fedora23, magia-5, mint-17.3, opensuse-42.1, slackware-14.1, gentoo-20151225 (13.0?), archlinux-2015-12-01. With the caveat that on centos6 and on slackware-14.1 that there wind up being two instances of the devpts filesystem mounted on /dev/pts, the lower copy does not end up getting used. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Greg KH <greg@kroah.com> Cc: Peter Hurley <peter@hurleysoftware.com> Cc: Peter Anvin <hpa@zytor.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Serge Hallyn <serge.hallyn@ubuntu.com> Cc: Willy Tarreau <w@1wt.eu> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> Cc: Jann Horn <jann@thejh.net> Cc: Jiri Slaby <jslaby@suse.com> Cc: Florian Weimer <fw@deneb.enyo.de> Cc: Konstantin Khlebnikov <koct9i@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-27remove lots of IS_ERR_VALUE abusesArnd Bergmann
Most users of IS_ERR_VALUE() in the kernel are wrong, as they pass an 'int' into a function that takes an 'unsigned long' argument. This happens to work because the type is sign-extended on 64-bit architectures before it gets converted into an unsigned type. However, anything that passes an 'unsigned short' or 'unsigned int' argument into IS_ERR_VALUE() is guaranteed to be broken, as are 8-bit integers and types that are wider than 'unsigned long'. Andrzej Hajda has already fixed a lot of the worst abusers that were causing actual bugs, but it would be nice to prevent any users that are not passing 'unsigned long' arguments. This patch changes all users of IS_ERR_VALUE() that I could find on 32-bit ARM randconfig builds and x86 allmodconfig. For the moment, this doesn't change the definition of IS_ERR_VALUE() because there are probably still architecture specific users elsewhere. Almost all the warnings I got are for files that are better off using 'if (err)' or 'if (err < 0)'. The only legitimate user I could find that we get a warning for is the (32-bit only) freescale fman driver, so I did not remove the IS_ERR_VALUE() there but changed the type to 'unsigned long'. For 9pfs, I just worked around one user whose calling conventions are so obscure that I did not dare change the behavior. I was using this definition for testing: #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \ unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO)) which ends up making all 16-bit or wider types work correctly with the most plausible interpretation of what IS_ERR_VALUE() was supposed to return according to its users, but also causes a compile-time warning for any users that do not pass an 'unsigned long' argument. I suggested this approach earlier this year, but back then we ended up deciding to just fix the users that are obviously broken. After the initial warning that caused me to get involved in the discussion (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus asked me to send the whole thing again. [ Updated the 9p parts as per Al Viro - Linus ] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Andrzej Hajda <a.hajda@samsung.com> Cc: Andrew Morton <akpm@linux-foundation.org> Link: https://lkml.org/lkml/2016/1/7/363 Link: https://lkml.org/lkml/2016/5/27/486 Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> # For nvmem part Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-20Merge tag 'tty-4.7-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty and serial driver updates from Greg KH: "Here's the large TTY and Serial driver update for 4.7-rc1. A few new serial drivers are added here, and Peter has fixed a bunch of long-standing bugs in the tty layer and serial drivers as normal. Full details in the shortlog. All of these have been in linux-next for a while with no reported issues" * tag 'tty-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (88 commits) MAINTAINERS: 8250: remove website reference serial: core: Fix port mutex assert if lockdep disabled serial: 8250_dw: fix wrong logic in dw8250_check_lcr() tty: vt, finish looping on duplicate tty: vt, return error when con_startup fails QE-UART: add "fsl,t1040-ucc-uart" to of_device_id serial: mctrl_gpio: Drop support for out1-gpios and out2-gpios serial: 8250dw: Add device HID for future AMD UART controller Fix OpenSSH pty regression on close serial: mctrl_gpio: add IRQ locking serial: 8250: Integrate Fintek into 8250_base serial: mps2-uart: add support for early console serial: mps2-uart: add MPS2 UART driver dt-bindings: document the MPS2 UART bindings serial: sirf: Use generic uart-has-rtscts DT property serial: sirf: Introduce helper variable struct device_node *np serial: mxs-auart: Use generic uart-has-rtscts DT property serial: imx: Use generic uart-has-rtscts DT property doc: DT: Add Generic Serial Device Tree Bindings serial: 8250: of: Make tegra_serial_handle_break() static ...