Commit 3e334486 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull tty / serial / console fixes from Greg KH:
 "Here are a bunch of fixes/reverts for 6.10-rc6.  Include in here are:

   - revert the bunch of tty/serial/console changes that landed in -rc1
     that didn't quite work properly yet.

     Everyone agreed to just revert them for now and will work on making
     them better for a future release instead of trying to quick fix the
     existing changes this late in the release cycle

   - 8250 driver port count bugfix

   - Other tiny serial port bugfixes for reported issues

  All of these have been in linux-next this week with no reported
  issues"

* tag 'tty-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  Revert "printk: Save console options for add_preferred_console_match()"
  Revert "printk: Don't try to parse DEVNAME:0.0 console options"
  Revert "printk: Flag register_console() if console is set on command line"
  Revert "serial: core: Add support for DEVNAME:0.0 style naming for kernel console"
  Revert "serial: core: Handle serial console options"
  Revert "serial: 8250: Add preferred console in serial8250_isa_init_ports()"
  Revert "Documentation: kernel-parameters: Add DEVNAME:0.0 format for serial ports"
  Revert "serial: 8250: Fix add preferred console for serial8250_isa_init_ports()"
  Revert "serial: core: Fix ifdef for serial base console functions"
  serial: bcm63xx-uart: fix tx after conversion to uart_port_tx_limited()
  serial: core: introduce uart_port_tx_limited_flags()
  Revert "serial: core: only stop transmit when HW fifo is empty"
  serial: imx: set receiver level before starting uart
  tty: mcf: MCF54418 has 10 UARTS
  serial: 8250_omap: Implementation of Errata i2310
  tty: serial: 8250: Fix port count mismatch with the device
parents 2c01c3d5 cc8d5a2f
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -788,25 +788,6 @@
			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]
+0 −5
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
 */

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

#include <asm/irq.h>

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

#include "8250.h"

/*
@@ -563,8 +560,6 @@ 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);
	}
}

+20 −5
Original line number Diff line number Diff line
@@ -115,6 +115,10 @@
/* RX FIFO occupancy indicator */
#define UART_OMAP_RX_LVL		0x19

/* Timeout low and High */
#define UART_OMAP_TO_L                 0x26
#define UART_OMAP_TO_H                 0x27

/*
 * Copy of the genpd flags for the console.
 * Only used if console suspend is disabled
@@ -663,13 +667,24 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id)

	/*
	 * On K3 SoCs, it is observed that RX TIMEOUT is signalled after
	 * FIFO has been drained, in which case a dummy read of RX FIFO
	 * is required to clear RX TIMEOUT condition.
	 * FIFO has been drained or erroneously.
	 * So apply solution of Errata i2310 as mentioned in
	 * https://www.ti.com/lit/pdf/sprz536
	 */
	if (priv->habit & UART_RX_TIMEOUT_QUIRK &&
	    (iir & UART_IIR_RX_TIMEOUT) == UART_IIR_RX_TIMEOUT &&
	    serial_port_in(port, UART_OMAP_RX_LVL) == 0) {
		serial_port_in(port, UART_RX);
		(iir & UART_IIR_RX_TIMEOUT) == UART_IIR_RX_TIMEOUT) {
		unsigned char efr2, timeout_h, timeout_l;

		efr2 = serial_in(up, UART_OMAP_EFR2);
		timeout_h = serial_in(up, UART_OMAP_TO_H);
		timeout_l = serial_in(up, UART_OMAP_TO_L);
		serial_out(up, UART_OMAP_TO_H, 0xFF);
		serial_out(up, UART_OMAP_TO_L, 0xFF);
		serial_out(up, UART_OMAP_EFR2, UART_OMAP_EFR2_TIMEOUT_BEHAVE);
		serial_in(up, UART_IIR);
		serial_out(up, UART_OMAP_EFR2, efr2);
		serial_out(up, UART_OMAP_TO_H, timeout_h);
		serial_out(up, UART_OMAP_TO_L, timeout_l);
	}

	/* Stop processing interrupts on input overrun */
+12 −1
Original line number Diff line number Diff line
@@ -1985,6 +1985,17 @@ enum {
	MOXA_SUPP_RS485 = BIT(2),
};

static unsigned short moxa_get_nports(unsigned short device)
{
	switch (device) {
	case PCI_DEVICE_ID_MOXA_CP116E_A_A:
	case PCI_DEVICE_ID_MOXA_CP116E_A_B:
		return 8;
	}

	return FIELD_GET(0x00F0, device);
}

static bool pci_moxa_is_mini_pcie(unsigned short device)
{
	if (device == PCI_DEVICE_ID_MOXA_CP102N	||
@@ -2038,7 +2049,7 @@ static int pci_moxa_init(struct pci_dev *dev)
{
	unsigned short device = dev->device;
	resource_size_t iobar_addr = pci_resource_start(dev, 2);
	unsigned int num_ports = (device & 0x00F0) >> 4, i;
	unsigned int i, num_ports = moxa_get_nports(device);
	u8 val, init_mode = MOXA_RS232;

	if (!(pci_moxa_supported_rs(dev) & MOXA_SUPP_RS232)) {
+5 −2
Original line number Diff line number Diff line
@@ -308,8 +308,8 @@ static void bcm_uart_do_tx(struct uart_port *port)

	val = bcm_uart_readl(port, UART_MCTL_REG);
	val = (val & UART_MCTL_TXFIFOFILL_MASK) >> UART_MCTL_TXFIFOFILL_SHIFT;

	pending = uart_port_tx_limited(port, ch, port->fifosize - val,
	pending = uart_port_tx_limited_flags(port, ch, UART_TX_NOSTOP,
		port->fifosize - val,
		true,
		bcm_uart_writel(port, ch, UART_FIFO_REG),
		({}));
@@ -320,6 +320,9 @@ static void bcm_uart_do_tx(struct uart_port *port)
	val = bcm_uart_readl(port, UART_IR_REG);
	val &= ~UART_TX_INT_MASK;
	bcm_uart_writel(port, val, UART_IR_REG);

	if (uart_tx_stopped(port))
		bcm_uart_stop_tx(port);
}

/*
Loading