Skip to content

Commit dd6f9b1

Browse files
committed
Merge tag 'tty-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial driver updates from Greg KH: "Here is the "big" set of tty/serial driver changes for 6.2-rc1. As in previous kernel releases, nothing big here at all, just some small incremental serial/tty layer cleanups and some individual driver additions and fixes. Highlights are: - serial helper macros from Jiri Slaby to reduce the amount of duplicated code in serial drivers - api cleanups and consolidations from Ilpo Järvinen in lots of serial drivers - the usual set of n_gsm fixes from Daniel Starke as that code gets exercised more - TIOCSTI is finally able to be disabled if requested (security hardening feature from Kees Cook) - fsl_lpuart driver fixes and features added - other small serial driver additions and fixes All of these have been in linux-next for a while with no reported problems" * tag 'tty-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (97 commits) serial: atmel: don't stop the transmitter when doing PIO serial: atmel: cleanup atmel_start+stop_tx() tty: serial: fsl_lpuart: switch to new dmaengine_terminate_* API serial: sunsab: Fix error handling in sunsab_init() serial: altera_uart: fix locking in polling mode serial: pch: Fix PCI device refcount leak in pch_request_dma() tty: serial: fsl_lpuart: Use pm_ptr() to avoid need to make pm __maybe_unused tty: serial: fsl_lpuart: Add runtime pm support tty: serial: fsl_lpuart: enable wakeup source for lpuart serdev: Replace poll loop by readx_poll_timeout() macro tty: synclink_gt: unwind actions in error path of net device open serial: stm32: move dma_request_chan() before clk_prepare_enable() dt-bindings: serial: xlnx,opb-uartlite: Drop 'contains' from 'xlnx,use-parity' serial: pl011: Do not clear RX FIFO & RX interrupt in unthrottle. serial: amba-pl011: avoid SBSA UART accessing DMACR register tty: serial: altera_jtaguart: remove struct altera_jtaguart tty: serial: altera_jtaguart: use uart_port::read_status_mask tty: serial: altera_jtaguart: remove unused altera_jtaguart::sigs tty: serial: altera_jtaguart: remove flag from altera_jtaguart_rx_chars() n_tty: Rename tail to old_tail in n_tty_read() ...
2 parents b83a708 + 6373ab4 commit dd6f9b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1447
-1246
lines changed

Documentation/devicetree/bindings/serial/ingenic,uart.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ properties:
2020
oneOf:
2121
- enum:
2222
- ingenic,jz4740-uart
23+
- ingenic,jz4750-uart
2324
- ingenic,jz4760-uart
2425
- ingenic,jz4780-uart
2526
- ingenic,x1000-uart
@@ -31,6 +32,9 @@ properties:
3132
- items:
3233
- const: ingenic,jz4725b-uart
3334
- const: ingenic,jz4740-uart
35+
- items:
36+
- const: ingenic,jz4755-uart
37+
- const: ingenic,jz4750-uart
3438

3539
reg:
3640
maxItems: 1

Documentation/devicetree/bindings/serial/renesas,scif.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ properties:
6767
- enum:
6868
- renesas,scif-r8a779a0 # R-Car V3U
6969
- renesas,scif-r8a779f0 # R-Car S4-8
70+
- renesas,scif-r8a779g0 # R-Car V4H
7071
- const: renesas,rcar-gen4-scif # R-Car Gen4
7172
- const: renesas,scif # generic SCIF compatible UART
7273

Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ allOf:
6767
- if:
6868
properties:
6969
xlnx,use-parity:
70-
contains:
71-
const: 1
70+
const: 1
7271
then:
7372
required:
7473
- xlnx,odd-parity

Documentation/driver-api/serial/driver.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ Other functions
7878
uart_get_lsr_info uart_handle_dcd_change uart_handle_cts_change
7979
uart_try_toggle_sysrq uart_get_console
8080

81+
.. kernel-doc:: include/linux/serial_core.h
82+
:identifiers: uart_port_tx_limited uart_port_tx
83+
8184
Other notes
8285
-----------
8386

Documentation/driver-api/serial/serial-rs485.rst

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,28 @@ RS485 Serial Communications
2929
3. Data Structures Already Available in the Kernel
3030
==================================================
3131

32-
The Linux kernel provides the serial_rs485 structure (see [1]) to handle
33-
RS485 communications. This data structure is used to set and configure RS485
32+
The Linux kernel provides the struct serial_rs485 to handle RS485
33+
communications. This data structure is used to set and configure RS485
3434
parameters in the platform data and in ioctls.
3535

36-
The device tree can also provide RS485 boot time parameters (see [2]
37-
for bindings). The driver is in charge of filling this data structure from
38-
the values given by the device tree.
36+
The device tree can also provide RS485 boot time parameters
37+
[#DT-bindings]_. The serial core fills the struct serial_rs485 from the
38+
values given by the device tree when the driver calls
39+
uart_get_rs485_mode().
3940

4041
Any driver for devices capable of working both as RS232 and RS485 should
41-
implement the rs485_config callback and provide rs485_supported in the
42-
uart_port structure. The serial core calls rs485_config to do the device
43-
specific part in response to TIOCSRS485 ioctl (see below). The rs485_config
44-
callback receives a pointer to a sanitizated serial_rs485 structure. The
45-
serial_rs485 userspace provides is sanitized before calling rs485_config
46-
using rs485_supported that indicates what RS485 features the driver supports
47-
for the uart_port. TIOCGRS485 ioctl can be used to read back the
48-
serial_rs485 structure matching to the current configuration.
42+
implement the ``rs485_config`` callback and provide ``rs485_supported``
43+
in the ``struct uart_port``. The serial core calls ``rs485_config`` to do
44+
the device specific part in response to TIOCSRS485 ioctl (see below). The
45+
``rs485_config`` callback receives a pointer to a sanitizated struct
46+
serial_rs485. The struct serial_rs485 userspace provides is sanitized
47+
before calling ``rs485_config`` using ``rs485_supported`` that indicates
48+
what RS485 features the driver supports for the ``struct uart_port``.
49+
TIOCGRS485 ioctl can be used to read back the struct serial_rs485
50+
matching to the current configuration.
51+
52+
.. kernel-doc:: include/uapi/linux/serial.h
53+
:identifiers: serial_rs485 uart_get_rs485_mode
4954

5055
4. Usage from user-level
5156
========================
@@ -103,29 +108,28 @@ RS485 Serial Communications
103108
========================
104109

105110
The Linux kernel provides addressing mode for multipoint RS-485 serial
106-
communications line. The addressing mode is enabled with SER_RS485_ADDRB
107-
flag in serial_rs485. Struct serial_rs485 has two additional flags and
108-
fields for enabling receive and destination addresses.
111+
communications line. The addressing mode is enabled with
112+
``SER_RS485_ADDRB`` flag in struct serial_rs485. The struct serial_rs485
113+
has two additional flags and fields for enabling receive and destination
114+
addresses.
109115

110116
Address mode flags:
111-
- SER_RS485_ADDRB: Enabled addressing mode (sets also ADDRB in termios).
112-
- SER_RS485_ADDR_RECV: Receive (filter) address enabled.
113-
- SER_RS485_ADDR_DEST: Set destination address.
117+
- ``SER_RS485_ADDRB``: Enabled addressing mode (sets also ADDRB in termios).
118+
- ``SER_RS485_ADDR_RECV``: Receive (filter) address enabled.
119+
- ``SER_RS485_ADDR_DEST``: Set destination address.
114120

115-
Address fields (enabled with corresponding SER_RS485_ADDR_* flag):
116-
- addr_recv: Receive address.
117-
- addr_dest: Destination address.
121+
Address fields (enabled with corresponding ``SER_RS485_ADDR_*`` flag):
122+
- ``addr_recv``: Receive address.
123+
- ``addr_dest``: Destination address.
118124

119125
Once a receive address is set, the communication can occur only with the
120126
particular device and other peers are filtered out. It is left up to the
121127
receiver side to enforce the filtering. Receive address will be cleared
122-
if SER_RS485_ADDR_RECV is not set.
128+
if ``SER_RS485_ADDR_RECV`` is not set.
123129

124130
Note: not all devices supporting RS485 support multipoint addressing.
125131

126132
6. References
127133
=============
128134

129-
[1] include/uapi/linux/serial.h
130-
131-
[2] Documentation/devicetree/bindings/serial/rs485.txt
135+
.. [#DT-bindings] Documentation/devicetree/bindings/serial/rs485.txt

drivers/tty/Kconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,25 @@ config LEGACY_PTY_COUNT
149149
When not in use, each legacy PTY occupies 12 bytes on 32-bit
150150
architectures and 24 bytes on 64-bit architectures.
151151

152+
config LEGACY_TIOCSTI
153+
bool "Allow legacy TIOCSTI usage"
154+
default y
155+
help
156+
Historically the kernel has allowed TIOCSTI, which will push
157+
characters into a controlling TTY. This continues to be used
158+
as a malicious privilege escalation mechanism, and provides no
159+
meaningful real-world utility any more. Its use is considered
160+
a dangerous legacy operation, and can be disabled on most
161+
systems.
162+
163+
Say 'Y here only if you have confirmed that your system's
164+
userspace depends on this functionality to continue operating
165+
normally.
166+
167+
This functionality can be changed at runtime with the
168+
dev.tty.legacy_tiocsti sysctl. This configuration option sets
169+
the default value of the sysctl.
170+
152171
config LDISC_AUTOLOAD
153172
bool "Automatically load TTY Line Disciplines"
154173
default y

drivers/tty/ehv_bytechan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static int find_console_handle(void)
118118
return 0;
119119

120120
stdout_irq = irq_of_parse_and_map(np, 0);
121-
if (stdout_irq == NO_IRQ) {
121+
if (!stdout_irq) {
122122
pr_err("ehv-bc: no 'interrupts' property in %pOF node\n", np);
123123
return 0;
124124
}
@@ -696,7 +696,7 @@ static int ehv_bc_tty_probe(struct platform_device *pdev)
696696

697697
bc->rx_irq = irq_of_parse_and_map(np, 0);
698698
bc->tx_irq = irq_of_parse_and_map(np, 1);
699-
if ((bc->rx_irq == NO_IRQ) || (bc->tx_irq == NO_IRQ)) {
699+
if (!bc->rx_irq || !bc->tx_irq) {
700700
dev_err(&pdev->dev, "no 'interrupts' property in %pOFn node\n",
701701
np);
702702
ret = -ENODEV;

drivers/tty/hvc/hvc_rtas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "hvc_console.h"
2727

2828
#define hvc_rtas_cookie 0x67781e15
29-
struct hvc_struct *hvc_rtas_dev;
29+
static struct hvc_struct *hvc_rtas_dev;
3030

3131
static int rtascons_put_char_token = RTAS_UNKNOWN_SERVICE;
3232
static int rtascons_get_char_token = RTAS_UNKNOWN_SERVICE;

0 commit comments

Comments
 (0)