Skip to content

Commit

Permalink
Merge tag 'tty-6.10-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 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
  ...
  • Loading branch information
torvalds committed May 22, 2024
2 parents 89601f6 + e21de14 commit f6b8e86
Show file tree
Hide file tree
Showing 98 changed files with 3,139 additions and 1,806 deletions.
19 changes: 19 additions & 0 deletions Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,25 @@
Documentation/networking/netconsole.rst for an
alternative.

<DEVNAME>:<n>.<n>[,options]
Use the specified serial port on the serial core bus.
The addressing uses DEVNAME of the physical serial port
device, followed by the serial core controller instance,
and the serial port instance. The options are the same
as documented for the ttyS addressing above.

The mapping of the serial ports to the tty instances
can be viewed with:

$ ls -d /sys/bus/serial-base/devices/*:*.*/tty/*
/sys/bus/serial-base/devices/00:04:0.0/tty/ttyS0

In the above example, the console can be addressed with
console=00:04:0.0. Note that a console addressed this
way will only get added when the related device driver
is ready. The use of an earlycon parameter in addition to
the console may be desired for console output early on.

uart[8250],io,<addr>[,options]
uart[8250],mmio,<addr>[,options]
uart[8250],mmio16,<addr>[,options]
Expand Down
9 changes: 9 additions & 0 deletions Documentation/admin-guide/sysrq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ Command Function
will be printed to your console. (``0``, for example would make
it so that only emergency messages like PANICs or OOPSes would
make it to your console.)

``R`` Replay the kernel log messages on consoles.
=========== ===================================================================

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

``Replay logs(R)`` is useful to view the kernel log messages when system is hung
or you are not able to use dmesg command to view the messages in printk buffer.
User may have to press the key combination multiple times if console system is
busy. If it is completely locked up, then messages won't be printed. Output
messages depend on current console loglevel, which can be modified using
sysrq[0-9] (see above).

Sometimes SysRq seems to get 'stuck' after using it, what can I do?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
16 changes: 0 additions & 16 deletions Documentation/devicetree/bindings/serial/actions,owl-uart.txt

This file was deleted.

48 changes: 48 additions & 0 deletions Documentation/devicetree/bindings/serial/actions,owl-uart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/serial/actions,owl-uart.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Actions Semi Owl UART

maintainers:
- Kanak Shilledar <[email protected]>

allOf:
- $ref: serial.yaml

properties:
compatible:
items:
- enum:
- actions,s500-uart
- actions,s900-uart
- const: actions,owl-uart

reg:
maxItems: 1

interrupts:
maxItems: 1

clocks:
maxItems: 1

required:
- compatible
- reg
- interrupts

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/clock/actions,s500-cmu.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
uart0: serial@b0126000 {
compatible = "actions,s500-uart", "actions,owl-uart";
reg = <0xb0126000 0x1000>;
clocks = <&cmu CLK_UART0>;
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
};
18 changes: 0 additions & 18 deletions Documentation/devicetree/bindings/serial/brcm,bcm2835-aux-uart.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/serial/brcm,bcm2835-aux-uart.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: BCM2835 AUXILIARY UART

maintainers:
- Pratik Farkase <[email protected]>
- Florian Fainelli <[email protected]>
- Stefan Wahren <[email protected]>

allOf:
- $ref: serial.yaml

properties:
compatible:
const: brcm,bcm2835-aux-uart

reg:
maxItems: 1

interrupts:
maxItems: 1

clocks:
maxItems: 1

required:
- compatible
- reg
- interrupts
- clocks

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/clock/bcm2835-aux.h>
serial@7e215040 {
compatible = "brcm,bcm2835-aux-uart";
reg = <0x7e215040 0x40>;
interrupts = <1 29>;
clocks = <&aux BCM2835_AUX_CLOCK_UART>;
};
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/serial/cdns,uart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ properties:
power-domains:
maxItems: 1

resets:
maxItems: 1

required:
- compatible
- reg
Expand Down
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/serial/renesas,scif.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ properties:
- renesas,scif-r8a779a0 # R-Car V3U
- renesas,scif-r8a779f0 # R-Car S4-8
- renesas,scif-r8a779g0 # R-Car V4H
- renesas,scif-r8a779h0 # R-Car V4M
- const: renesas,rcar-gen4-scif # R-Car Gen4
- const: renesas,scif # generic SCIF compatible UART

Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/xilinx/zynqmp.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@
reg = <0x0 0xff000000 0x0 0x1000>;
clock-names = "uart_clk", "pclk";
power-domains = <&zynqmp_firmware PD_UART_0>;
resets = <&zynqmp_reset ZYNQMP_RESET_UART0>;
};

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

usb0: usb@ff9d0000 {
Expand Down
8 changes: 7 additions & 1 deletion drivers/tty/amiserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,13 @@ static void __exit amiga_serial_remove(struct platform_device *pdev)
free_irq(IRQ_AMIGA_RBF, state);
}

static struct platform_driver amiga_serial_driver = {
/*
* amiga_serial_remove() lives in .exit.text. For drivers registered via
* module_platform_driver_probe() this is ok because they cannot get unbound at
* runtime. So mark the driver struct with __refdata to prevent modpost
* triggering a section mismatch warning.
*/
static struct platform_driver amiga_serial_driver __refdata = {
.remove_new = __exit_p(amiga_serial_remove),
.driver = {
.name = "amiga-serial",
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/hvc/hvc_xen.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ static void xencons_backend_changed(struct xenbus_device *dev,
break;
fallthrough; /* Missed the backend's CLOSING state */
case XenbusStateClosing: {
struct xencons_info *info = dev_get_drvdata(&dev->dev);;
struct xencons_info *info = dev_get_drvdata(&dev->dev);

/*
* Don't tear down the evtchn and grant ref before the other
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/n_gsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -4010,7 +4010,7 @@ static int gsm_create_network(struct gsm_dlci *dlci, struct gsm_netconfig *nc)
mux_net = netdev_priv(net);
mux_net->dlci = dlci;
kref_init(&mux_net->ref);
strncpy(nc->if_name, net->name, IFNAMSIZ); /* return net name */
strscpy(nc->if_name, net->name); /* return net name */

/* reconfigure dlci for network */
dlci->prev_adaption = dlci->adaption;
Expand Down
14 changes: 6 additions & 8 deletions drivers/tty/serial/8250/8250_bcm7271.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,20 +413,18 @@ static int stop_tx_dma(struct uart_8250_port *p)
static int brcmuart_tx_dma(struct uart_8250_port *p)
{
struct brcmuart_priv *priv = p->port.private_data;
struct circ_buf *xmit = &p->port.state->xmit;
struct tty_port *tport = &p->port.state->port;
u32 tx_size;

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

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

if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
if (kfifo_len(&tport->xmit_fifo) < WAKEUP_CHARS)
uart_write_wakeup(&p->port);

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

if (isr & UDMA_INTR_TX_ABORT) {
if (priv->tx_running)
dev_err(dev, "Unexpected TX_ABORT interrupt\n");
return;
}
priv->tx_running = false;
if (!uart_circ_empty(xmit) && !uart_tx_stopped(up))
if (!kfifo_is_empty(&tport->xmit_fifo) && !uart_tx_stopped(up))
brcmuart_tx_dma(port_8250);
}

Expand Down
8 changes: 7 additions & 1 deletion drivers/tty/serial/8250/8250_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include <linux/acpi.h>
#include <linux/cleanup.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/ioport.h>
Expand All @@ -41,6 +42,8 @@

#include <asm/irq.h>

#include "../serial_base.h" /* For serial_base_add_isa_preferred_console() */

#include "8250.h"

/*
Expand Down Expand Up @@ -280,7 +283,8 @@ static void serial8250_backup_timeout(struct timer_list *t)
*/
lsr = serial_lsr_in(up);
if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) &&
(!uart_circ_empty(&up->port.state->xmit) || up->port.x_char) &&
(!kfifo_is_empty(&up->port.state->port.xmit_fifo) ||
up->port.x_char) &&
(lsr & UART_LSR_THRE)) {
iir &= ~(UART_IIR_ID | UART_IIR_NO_INT);
iir |= UART_IIR_THRI;
Expand Down Expand Up @@ -559,6 +563,8 @@ static void __init serial8250_isa_init_ports(void)
port->irqflags |= irqflag;
if (serial8250_isa_config != NULL)
serial8250_isa_config(i, &up->port, &up->capabilities);

serial_base_add_isa_preferred_console(serial8250_reg.dev_name, i);
}
}

Expand Down
Loading

0 comments on commit f6b8e86

Please sign in to comment.