Skip to content

Commit f6b8e86

Browse files
committed
Merge tag 'tty-6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty / serial updates from Greg KH: "Here is the big set of tty/serial driver changes for 6.10-rc1. Included in here are: - Usual good set of api cleanups and evolution by Jiri Slaby to make the serial interfaces move out of the 1990's by using kfifos instead of hand-rolling their own logic. - 8250_exar driver updates - max3100 driver updates - sc16is7xx driver updates - exar driver updates - sh-sci driver updates - tty ldisc api addition to help refuse bindings - other smaller serial driver updates All of these have been in linux-next for a while with no reported issues" * tag 'tty-6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (113 commits) serial: Clear UPF_DEAD before calling tty_port_register_device_attr_serdev() serial: imx: Raise TX trigger level to 8 serial: 8250_pnp: Simplify "line" related code serial: sh-sci: simplify locking when re-issuing RXDMA fails serial: sh-sci: let timeout timer only run when DMA is scheduled serial: sh-sci: describe locking requirements for invalidating RXDMA serial: sh-sci: protect invalidating RXDMA on shutdown tty: add the option to have a tty reject a new ldisc serial: core: Call device_set_awake_path() for console port dt-bindings: serial: brcm,bcm2835-aux-uart: convert to dtschema tty: serial: uartps: Add support for uartps controller reset arm64: zynqmp: Add resets property for UART nodes dt-bindings: serial: cdns,uart: Add optional reset property serial: 8250_pnp: Switch to DEFINE_SIMPLE_DEV_PM_OPS() serial: 8250_exar: Keep the includes sorted serial: 8250_exar: Make type of bit the same in exar_ee_*_bit() serial: 8250_exar: Use BIT() in exar_ee_read() serial: 8250_exar: Switch to use dev_err_probe() serial: 8250_exar: Return directly from switch-cases serial: 8250_exar: Decrease indentation level ...
2 parents 89601f6 + e21de14 commit f6b8e86

Some content is hidden

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

98 files changed

+3139
-1806
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,25 @@
788788
Documentation/networking/netconsole.rst for an
789789
alternative.
790790

791+
<DEVNAME>:<n>.<n>[,options]
792+
Use the specified serial port on the serial core bus.
793+
The addressing uses DEVNAME of the physical serial port
794+
device, followed by the serial core controller instance,
795+
and the serial port instance. The options are the same
796+
as documented for the ttyS addressing above.
797+
798+
The mapping of the serial ports to the tty instances
799+
can be viewed with:
800+
801+
$ ls -d /sys/bus/serial-base/devices/*:*.*/tty/*
802+
/sys/bus/serial-base/devices/00:04:0.0/tty/ttyS0
803+
804+
In the above example, the console can be addressed with
805+
console=00:04:0.0. Note that a console addressed this
806+
way will only get added when the related device driver
807+
is ready. The use of an earlycon parameter in addition to
808+
the console may be desired for console output early on.
809+
791810
uart[8250],io,<addr>[,options]
792811
uart[8250],mmio,<addr>[,options]
793812
uart[8250],mmio16,<addr>[,options]

Documentation/admin-guide/sysrq.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ Command Function
161161
will be printed to your console. (``0``, for example would make
162162
it so that only emergency messages like PANICs or OOPSes would
163163
make it to your console.)
164+
165+
``R`` Replay the kernel log messages on consoles.
164166
=========== ===================================================================
165167

166168
Okay, so what can I use them for?
@@ -211,6 +213,13 @@ processes.
211213
"just thaw ``it(j)``" is useful if your system becomes unresponsive due to a
212214
frozen (probably root) filesystem via the FIFREEZE ioctl.
213215

216+
``Replay logs(R)`` is useful to view the kernel log messages when system is hung
217+
or you are not able to use dmesg command to view the messages in printk buffer.
218+
User may have to press the key combination multiple times if console system is
219+
busy. If it is completely locked up, then messages won't be printed. Output
220+
messages depend on current console loglevel, which can be modified using
221+
sysrq[0-9] (see above).
222+
214223
Sometimes SysRq seems to get 'stuck' after using it, what can I do?
215224
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216225

Documentation/devicetree/bindings/serial/actions,owl-uart.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/serial/actions,owl-uart.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Actions Semi Owl UART
8+
9+
maintainers:
10+
- Kanak Shilledar <[email protected]>
11+
12+
allOf:
13+
- $ref: serial.yaml
14+
15+
properties:
16+
compatible:
17+
items:
18+
- enum:
19+
- actions,s500-uart
20+
- actions,s900-uart
21+
- const: actions,owl-uart
22+
23+
reg:
24+
maxItems: 1
25+
26+
interrupts:
27+
maxItems: 1
28+
29+
clocks:
30+
maxItems: 1
31+
32+
required:
33+
- compatible
34+
- reg
35+
- interrupts
36+
37+
unevaluatedProperties: false
38+
39+
examples:
40+
- |
41+
#include <dt-bindings/clock/actions,s500-cmu.h>
42+
#include <dt-bindings/interrupt-controller/arm-gic.h>
43+
uart0: serial@b0126000 {
44+
compatible = "actions,s500-uart", "actions,owl-uart";
45+
reg = <0xb0126000 0x1000>;
46+
clocks = <&cmu CLK_UART0>;
47+
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
48+
};

Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/serial/brcm,bcm2835-aux-uart.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: BCM2835 AUXILIARY UART
8+
9+
maintainers:
10+
- Pratik Farkase <[email protected]>
11+
- Florian Fainelli <[email protected]>
12+
- Stefan Wahren <[email protected]>
13+
14+
allOf:
15+
- $ref: serial.yaml
16+
17+
properties:
18+
compatible:
19+
const: brcm,bcm2835-aux-uart
20+
21+
reg:
22+
maxItems: 1
23+
24+
interrupts:
25+
maxItems: 1
26+
27+
clocks:
28+
maxItems: 1
29+
30+
required:
31+
- compatible
32+
- reg
33+
- interrupts
34+
- clocks
35+
36+
unevaluatedProperties: false
37+
38+
examples:
39+
- |
40+
#include <dt-bindings/clock/bcm2835-aux.h>
41+
serial@7e215040 {
42+
compatible = "brcm,bcm2835-aux-uart";
43+
reg = <0x7e215040 0x40>;
44+
interrupts = <1 29>;
45+
clocks = <&aux BCM2835_AUX_CLOCK_UART>;
46+
};

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ properties:
4646
power-domains:
4747
maxItems: 1
4848

49+
resets:
50+
maxItems: 1
51+
4952
required:
5053
- compatible
5154
- reg

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

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

arch/arm64/boot/dts/xilinx/zynqmp.dtsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@
906906
reg = <0x0 0xff000000 0x0 0x1000>;
907907
clock-names = "uart_clk", "pclk";
908908
power-domains = <&zynqmp_firmware PD_UART_0>;
909+
resets = <&zynqmp_reset ZYNQMP_RESET_UART0>;
909910
};
910911

911912
uart1: serial@ff010000 {
@@ -917,6 +918,7 @@
917918
reg = <0x0 0xff010000 0x0 0x1000>;
918919
clock-names = "uart_clk", "pclk";
919920
power-domains = <&zynqmp_firmware PD_UART_1>;
921+
resets = <&zynqmp_reset ZYNQMP_RESET_UART1>;
920922
};
921923

922924
usb0: usb@ff9d0000 {

drivers/tty/amiserial.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,13 @@ static void __exit amiga_serial_remove(struct platform_device *pdev)
15781578
free_irq(IRQ_AMIGA_RBF, state);
15791579
}
15801580

1581-
static struct platform_driver amiga_serial_driver = {
1581+
/*
1582+
* amiga_serial_remove() lives in .exit.text. For drivers registered via
1583+
* module_platform_driver_probe() this is ok because they cannot get unbound at
1584+
* runtime. So mark the driver struct with __refdata to prevent modpost
1585+
* triggering a section mismatch warning.
1586+
*/
1587+
static struct platform_driver amiga_serial_driver __refdata = {
15821588
.remove_new = __exit_p(amiga_serial_remove),
15831589
.driver = {
15841590
.name = "amiga-serial",

drivers/tty/hvc/hvc_xen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ static void xencons_backend_changed(struct xenbus_device *dev,
558558
break;
559559
fallthrough; /* Missed the backend's CLOSING state */
560560
case XenbusStateClosing: {
561-
struct xencons_info *info = dev_get_drvdata(&dev->dev);;
561+
struct xencons_info *info = dev_get_drvdata(&dev->dev);
562562

563563
/*
564564
* Don't tear down the evtchn and grant ref before the other

drivers/tty/n_gsm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4010,7 +4010,7 @@ static int gsm_create_network(struct gsm_dlci *dlci, struct gsm_netconfig *nc)
40104010
mux_net = netdev_priv(net);
40114011
mux_net->dlci = dlci;
40124012
kref_init(&mux_net->ref);
4013-
strncpy(nc->if_name, net->name, IFNAMSIZ); /* return net name */
4013+
strscpy(nc->if_name, net->name); /* return net name */
40144014

40154015
/* reconfigure dlci for network */
40164016
dlci->prev_adaption = dlci->adaption;

drivers/tty/serial/8250/8250_bcm7271.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -413,20 +413,18 @@ static int stop_tx_dma(struct uart_8250_port *p)
413413
static int brcmuart_tx_dma(struct uart_8250_port *p)
414414
{
415415
struct brcmuart_priv *priv = p->port.private_data;
416-
struct circ_buf *xmit = &p->port.state->xmit;
416+
struct tty_port *tport = &p->port.state->port;
417417
u32 tx_size;
418418

419419
if (uart_tx_stopped(&p->port) || priv->tx_running ||
420-
uart_circ_empty(xmit)) {
420+
kfifo_is_empty(&tport->xmit_fifo)) {
421421
return 0;
422422
}
423-
tx_size = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
424423

425424
priv->dma.tx_err = 0;
426-
memcpy(priv->tx_buf, &xmit->buf[xmit->tail], tx_size);
427-
uart_xmit_advance(&p->port, tx_size);
425+
tx_size = uart_fifo_out(&p->port, priv->tx_buf, UART_XMIT_SIZE);
428426

429-
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
427+
if (kfifo_len(&tport->xmit_fifo) < WAKEUP_CHARS)
430428
uart_write_wakeup(&p->port);
431429

432430
udma_writel(priv, REGS_DMA_TX, UDMA_TX_TRANSFER_LEN, tx_size);
@@ -540,15 +538,15 @@ static void brcmuart_tx_isr(struct uart_port *up, u32 isr)
540538
struct brcmuart_priv *priv = up->private_data;
541539
struct device *dev = up->dev;
542540
struct uart_8250_port *port_8250 = up_to_u8250p(up);
543-
struct circ_buf *xmit = &port_8250->port.state->xmit;
541+
struct tty_port *tport = &port_8250->port.state->port;
544542

545543
if (isr & UDMA_INTR_TX_ABORT) {
546544
if (priv->tx_running)
547545
dev_err(dev, "Unexpected TX_ABORT interrupt\n");
548546
return;
549547
}
550548
priv->tx_running = false;
551-
if (!uart_circ_empty(xmit) && !uart_tx_stopped(up))
549+
if (!kfifo_is_empty(&tport->xmit_fifo) && !uart_tx_stopped(up))
552550
brcmuart_tx_dma(port_8250);
553551
}
554552

drivers/tty/serial/8250/8250_core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
#include <linux/acpi.h>
18+
#include <linux/cleanup.h>
1819
#include <linux/module.h>
1920
#include <linux/moduleparam.h>
2021
#include <linux/ioport.h>
@@ -41,6 +42,8 @@
4142

4243
#include <asm/irq.h>
4344

45+
#include "../serial_base.h" /* For serial_base_add_isa_preferred_console() */
46+
4447
#include "8250.h"
4548

4649
/*
@@ -280,7 +283,8 @@ static void serial8250_backup_timeout(struct timer_list *t)
280283
*/
281284
lsr = serial_lsr_in(up);
282285
if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) &&
283-
(!uart_circ_empty(&up->port.state->xmit) || up->port.x_char) &&
286+
(!kfifo_is_empty(&up->port.state->port.xmit_fifo) ||
287+
up->port.x_char) &&
284288
(lsr & UART_LSR_THRE)) {
285289
iir &= ~(UART_IIR_ID | UART_IIR_NO_INT);
286290
iir |= UART_IIR_THRI;
@@ -559,6 +563,8 @@ static void __init serial8250_isa_init_ports(void)
559563
port->irqflags |= irqflag;
560564
if (serial8250_isa_config != NULL)
561565
serial8250_isa_config(i, &up->port, &up->capabilities);
566+
567+
serial_base_add_isa_preferred_console(serial8250_reg.dev_name, i);
562568
}
563569
}
564570

0 commit comments

Comments
 (0)