aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty
AgeCommit message (Collapse)AuthorFilesLines
2016-02-06TTY: serial/m32r_sio, remove unused membersJiri Slaby1-33/+0
struct uart_sio_port has a lots of unused members. Some of them are set to some constant but never read. Remove all those. This includes removal of uart_ops->pm handler as we never handle pm (pm was never set). Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06TTY: serial/m32r_sio, remove debug macrosJiri Slaby1-20/+5
DEBUG_AUTOCONF is unused. Switch DEBUG_INTR to pr_debug. This is only enabled with DEBUG or dynamic debug when explicitly asked for. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06TTY: serial/m32r_sio, simplify old_serial_portJiri Slaby1-42/+15
The only variables in old_serial_port are port and irq. So make old_serial_port contain only those two and move the initialization of the rest to the place where old_serial_port is actually read. Also get rid of SERIAL_PORT_DFNS. It is ugly and having the initializer where it belongs makes more sense. Finally, use already defined UART_NR in the loop. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06TTY: serial/m32r_sio, disband m32r_sio.hJiri Slaby2-76/+10
The only needed information from the header is struct old_serial_port. Move it to m32r_sio.c, make it const and anonymous. And kill the rest from the header as it is dead stuff. Given m32r_sio_suspend_port and m32r_sio_resume_port are local to m32r_sio.c and unused, kill them from .c too. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06TTY: 8250_pnp, make checks boolJiri Slaby1-7/+7
Since check_name and check_resources return only 0/1, switch them to bool/true/false. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06TTY: 8250_pnp, constify tablesJiri Slaby1-4/+4
Make modem_names and base static const. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06TTY: serial/mpsc, remove unused fieldsJiri Slaby1-5/+0
c_iflag and c_cflag are set, but unused. Remove. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06TTY: serial/mpsc, clean up init/remove functionsJiri Slaby1-84/+79
There is a chain of up to 4 nested ifs in init and remove functions. Instead, make the code linear and use goto's to handle failures. Remove unneeded cast from mpsc_release_port by referencing pi->port directly. And finally, use dev_dbg instead of pr_debug given we have dev->dev node. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06TTY: serial/mpsc, stop leaking mappingsJiri Slaby1-5/+5
When mpsc_routing_base, sdma_intr_base, mpsc_base, sdma_base, and brg_base are mapped, they are never unmapped. The condition in the free paths is always 'if (!XXX_base) { unmap }'. Fix it by inverting the condition. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06serial: 8250_omap: Add omap8250 earlyconPeter Hurley1-0/+21
Add DT earlycon for 8250_omap driver. This boot console is included for kernels built with CONFIG_SERIAL_EARLYCON=y, CONFIG_OF=y, CONFIG_SERIAL_8250_OMAP=y, and CONFIG_OF_EARLY_FLATTREE=y. This boot console is enabled with the command line option "earlycon" (without "=<name>...") when the DT 'stdout-path' property matches a compatible uart. For example, / { chosen { stdout-path = "serial0:115200"; }; .... aliases { serial0 = &uart0; }; .... ocp : ocp { uart0 : serial@44e09000 { compatible = "ti,omap3-uart"; } }; }; Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06serial: 8250_early: Use port->regshiftPeter Hurley1-6/+10
earlycon initializes struct uart_port::regshift to the correct value for UPIO_MEM32 already. Use the port field rather than hard-coded value. This enables broader support for various i/o access methods in 8250 earlycon (eg., omap8250 earlycon). Acked-by: Rob Herring <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06serial: earlycon: Show the earlycon "driver" in bannerPeter Hurley1-6/+6
Output the earlycon "driver" from the just-parsed console 'name' and 'index' fields. NB: ->mapbase is a resource_size_t so use %pa format specifier Acked-by: Rob Herring <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06serial: earlycon: Common log banner for command line and DTPeter Hurley1-13/+14
Refactor the command line earlycon banner into earlycon_init() so both earlycon startup methods output an info banner. Acked-by: Rob Herring <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06of: earlycon: Move address translation to of_setup_earlycon()Peter Hurley1-3/+9
Cleanup the early DT/earlycon separation; remove the 'addr' parameter from of_setup_earlycon() and get the uart phys addr directly with a new wrapper function, of_flat_dt_translate_addr(). Limit fdt_translate_address() to file scope. Acked-by: Rob Herring <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06of: earlycon: Initialize port fields from DT propertiesPeter Hurley1-0/+31
Read the optional "reg-offset", "reg-shift", "reg-io-width" and endianness properties and initialize the respective struct uart_port field if found. NB: These bindings are common to several drivers and the values merely indicate the default value; the registering earlycon setup() method can simply override the values if required. Acked-by: Rob Herring <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06of: earlycon: Add options string handlingPeter Hurley1-2/+7
Pass-through any options string in the 'stdout-path' property to the earlycon "driver" setup. Acked-by: Rob Herring <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06of: earlycon: Fixup earlycon console name and indexPeter Hurley1-3/+3
Use the console name embedded in the OF earlycon table by the OF_EARLYCON_DECLARE() macro to initialize the struct console 'name' and 'index' fields. Acked-by: Rob Herring <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06serial: earlycon: Fixup earlycon console name and indexPeter Hurley1-3/+22
Properly initialize the struct console 'name' and 'index' fields for the registering earlycon. For earlycons w/o trailing numerals, the index is set to 0; otherwise, the index is set to the value of the trailing numeral. For example, the 'exynos4210' earlycon name == "exynos" and index == 4210. Earlycons with embedded numerals will have all non-trailing numerals as part of the name; for example, the 's3c2412' earlycon name == "s3c" and index == 2412. This ackward scheme was initially added for the uart8250 earlycon; adopt this scheme for the other earlycon "drivers". Introduce earlycon_init() which performs the string scanning and initializes the name and index fields; encapsulate the other console field initializations within. Acked-by: Rob Herring <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06earlycon: Use common framework for earlycon declarationsPeter Hurley6-21/+1
Use a single common table of struct earlycon_id for both command line and devicetree. Re-define OF_EARLYCON_DECLARE() macro to instance a unique earlycon declaration (the declaration is only guaranteed to be unique within a compilation unit; separate compilation units must still use unique earlycon names). The semantics of OF_EARLYCON_DECLARE() is different; it declares an earlycon which can matched either on the command line or by devicetree. EARLYCON_DECLARE() is semantically unchanged; it declares an earlycon which is matched by command line only. Remove redundant instances of EARLYCON_DECLARE(). This enables all earlycons to properly initialize struct console with the appropriate name and index, which improves diagnostics and enables direct earlycon-to-console handoff. Acked-by: Rob Herring <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06of: earlycon: of_setup_earlycon() requires CONFIG_OF_EARLY_FLATTREEPeter Hurley1-0/+4
DT earlycon is only supported for CONFIG_OF_EARLY_FLATTREE=y; exclude of_setup_earlycon() if not defined. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-06tty: Drop krefs for interrupted tty lockPeter Hurley2-3/+7
When the tty lock is interrupted on attempted re-open, 2 tty krefs are still held. Drop extra kref before returning failure from tty_lock_interruptible(), and drop lookup kref before returning failure from tty_open(). Fixes: 0bfd464d3fdd ("tty: Wait interruptibly for tty lock on reopen") Reported-by: Dmitry Vyukov <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-02-01Merge 4.5-rc2 into tty-nextGreg Kroah-Hartman2-0/+30
We want the tty/serial fixes in here as well to make merges easier. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-31Merge tag 'tty-4.5-rc2' of ↵Linus Torvalds4-11/+77
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial fixes from Greg KH: "Here are some small tty/serial driver fixes for 4.5-rc2. They resolve a number of reported problems (the ioctl one specifically has been pointed out by numerous people) and one patch adds some new device ids for the 8250_pci driver. All have been in linux-next successfully" * tag 'tty-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: 8250_pci: Add Intel Broadwell ports staging/speakup: Use tty_ldisc_ref() for paste kworker n_tty: Fix unsafe reference to "other" ldisc tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) tty: Retry failed reopen if tty teardown in-progress tty: Wait interruptibly for tty lock on reopen
2016-01-31Merge tag 'staging-4.5-rc2' of ↵Linus Torvalds1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging fixes from Greg KH: "Here are some small staging driver fixes for 4.5-rc2. One of them predated 4.4-final, but I missed that merge window due to the holliday. The others fix reported issues that have come up recently. The tty change is needed for the speakup driver fix and has the ack of the tty driver maintainer as well, i.e. myself :) All have been in linux-next with no reported issues" * tag 'staging-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: Staging: speakup: fix read scrolled-back VT Staging: speakup: Fix getting port information Revert "Staging: panel: usleep_range is preferred over udelay" iio: adis_buffer: Fix out-of-bounds memory access
2016-01-29serial: 8250_pci: Add Intel Broadwell portsMika Westerberg1-0/+29
Some recent (early 2015) macbooks have Intel Broadwell where LPSS UARTs are PCI enumerated instead of ACPI. The LPSS UART block is pretty much same as used on Intel Baytrail so we can reuse the existing Baytrail setup code. Add both Broadwell LPSS UART ports to the list of supported devices. Signed-off-by: Leif Liddy <[email protected]> Signed-off-by: Mika Westerberg <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28Staging: speakup: fix read scrolled-back VTSamuel Thibault1-0/+1
Previously, speakup would always read the non-scrolled part of the VT, even when the VT is scrolled back with shift-page. This patch makes vt.c export screen_pos so that speakup can use it to properly access the content of the scrolled-back VT. This was tested with both vgacon and fbcon. Signed-off-by: Samuel Thibault <[email protected]> Reviewed-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28tty: Remove ASYNC_CLOSINGPeter Hurley5-8/+4
The tty core no longer provides nor uses ASYNC_CLOSING; remove from tty_port_close_start() and tty_port_close_end() as well as tty drivers which open-code these state changes. Unfortunately, even though the bit is masked from userspace, its inclusion in a uapi header precludes removing the macro. Cc: Martin Schwidefsky <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: [email protected] Cc: Mikael Starvik <[email protected]> Cc: Jesper Nilsson <[email protected]> Cc: [email protected] Cc: Samuel Ortiz <[email protected]> Cc: "David S. Miller" <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28tty: mxser: Remove ASYNC_CLOSINGPeter Hurley1-4/+5
The tty core no longer provides ASYNC_CLOSING. Use private flag for same purpose, which is to clear the fifos at each and every interrupt during driver close(). The driver uses this sledgehammer approach because its close/shutdown sequence is hopelessly borked. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: core: Perform RTS signalling before soft flow ctrlPeter Hurley1-6/+6
When throttling, time is of the essence; try RTS signalling before soft flow control, which will take longer. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: core: Unfold < 80 char linesPeter Hurley1-10/+5
Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: core: Remove cast from void ptr in uart_open()Peter Hurley1-1/+1
void * promotes to any pointer type; remove type cast. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: core: Cleanup uart_open() exitPeter Hurley1-4/+1
If aborting uart_open() unsuccessfully, retval is non-zero, so the existing fall-through exit is equivalent. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: Fix ASYNC_* => UPF_* flags misusePeter Hurley1-1/+1
The UPF_* flags are the correct values to use for struct uart_port and struct old_serial_port/SERIAL_PORT_DFNS. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: core: Use tty->index for port # in debug messagesPeter Hurley1-3/+2
The uart port may have already been removed by uart_remove_one_port(); use equivalent tty->index (which is always valid in these contexts) instead. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: core: Fold do_uart_get_info() into callerPeter Hurley1-11/+7
do_uart_get_info() has a single caller: uart_get_info(). Manually inline do_uart_get_info(). Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: core: Fold __uart_put_char() into callerPeter Hurley1-9/+5
uart_put_char() is the required interface; manually inline __uart_put_char(). Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28tty: Use termios c_*flag macrosPeter Hurley16-111/+75
Expressions of the form "tty->termios.c_*flag & FLAG" are more clearly expressed with the termios flags macros, I_FLAG(), C_FLAG(), O_FLAG(), and L_FLAG(). Convert treewide. Signed-off-by: Peter Hurley <[email protected]> Acked-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28tty: Allow unreadable mess to be > 80 charsPeter Hurley1-4/+2
Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28tty: Unify receive_buf() code pathsPeter Hurley1-11/+28
Instead of two distinct code branches for receive_buf() handling, use tty_ldisc_receive_buf() as the single code path. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28n_tty: Ignore all read data when closingPeter Hurley1-2/+0
On final port close (and thus final tty close), only output flow control requests in the input data should be processed. Ignore all other input data, including parity errors, overruns and breaks. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28tty: rocket: Remove private close_waitPeter Hurley2-3/+0
This driver's private completion variable, close_wait, is no longer used for wait since "tty: Remove ASYNC_CLOSING checks in open()/hangup"; remove. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: 8250: Unfold < 80 char linesPeter Hurley1-7/+4
Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: 8250: Wait for irq to complete before shutdownPeter Hurley1-0/+4
After masking all interrupts, wait for the irq handler to complete before continuing shutdown. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: 8250: Unlink uart console ptr if console setup failsPeter Hurley1-1/+5
If console setup fails (eg., there is no valid port at that index), unlink the console ptr; otherwise, when the driver unloads, the console will be unregistered (even though setup, and thus registration, failed) and a console disabled message will be printed. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: 8250: Remove low_latency workaroundPeter Hurley1-2/+1
The defunct low_latency input steering executed flush_to_ldisc() directly from interrupt context so dropping the port lock was necessary to avoid deadlock. That steering was removed by commit a9c3f68f3cd8d55f809fbdb0c138ed061ea1bd25 Author: Peter Hurley <[email protected]> Date: Sat Feb 22 07:31:21 2014 -0500 tty: Fix low_latency BUG Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: 8250: Fix lost rx statePeter Hurley1-3/+4
When max_count is reached, the rx loop exits. However, UART_LSR has already been read so those char flags are lost, and subsequent rx status will be for the wrong byte until the rx fifo drains. Reported-by: George Spelvin <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28serial: 8250: Refactor serial8250_rx_chars() inner loopPeter Hurley1-58/+62
Factor the read/process one char inner loop to a separate helper function serial8250_read_char(). No functional change. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28tty: n_tty: fix SIGIO for outputPeter Hurley1-1/+1
According to fcntl(2), "a SIGIO signal is sent whenever input or output becomes possible on that file descriptor", i.e. after the output buffer was full and now has space for new data. But in fact SIGIO is sent after every write. n_tty_write() should set TTY_DO_WRITE_WAKEUP only when not all data could be written to the buffer. [pjh: Also fixes missed SIGIO if amt written just happens to be [ amount still to write Signed-off-by: Johannes Stezenbach <[email protected]> [pjh: minor patch edits and re-submit] Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28n_tty: Remove tty count checks from unthrottlePeter Hurley1-4/+0
Since n_tty_check_unthrottle() is only called from n_tty_read() which only originates from a userspace read(), the tty count cannot be 0; the read() guarantees the file descriptor has not yet been released. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-01-28n_tty: Fix stuck write wakeupPeter Hurley1-2/+2
If signal-driven i/o is disabled while write wakeup is pending (ie., n_tty_write() has set TTY_DO_WRITE_WAKEUP but then signal-driven i/o is disabled), the TTY_DO_WRITE_WAKEUP bit will never be cleared and will cause tty_wakeup() to always call n_tty_write_wakeup. Unconditionally clear the write wakeup, and since kill_fasync() already checks if the fasync ptr is null, call kill_fasync() unconditionally as well. Signed-off-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>