Commit cc432aee authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull tty/serial fixes from Greg KH:
 "Here are some small tty/serial fixes for 5.6-rc5

  Just some small serial driver fixes, and a vt core fixup, full details
  are:

   - vt fixes for issues found by syzbot

   - serdev fix for Apple boxes

   - fsl_lpuart serial driver fixes

   - MAINTAINER update for incorrect serial files

   - new device ids for 8250_exar driver

   - mvebu-uart fix

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

* tag 'tty-5.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  tty: serial: fsl_lpuart: free IDs allocated by IDA
  Revert "tty: serial: fsl_lpuart: drop EARLYCON_DECLARE"
  serdev: Fix detection of UART devices on Apple machines.
  MAINTAINERS: Add missed files related to Synopsys DesignWare UART
  serial: 8250_exar: add support for ACCES cards
  tty:serial:mvebu-uart:fix a wrong return
  vt: selection, push sel_lock up
  vt: selection, push console lock down
parents fd3f6cc9 2b2e71fe
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -16080,6 +16080,8 @@ SYNOPSYS DESIGNWARE 8250 UART DRIVER
R:	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
S:	Maintained
F:	drivers/tty/serial/8250/8250_dw.c
F:	drivers/tty/serial/8250/8250_dwlib.*
F:	drivers/tty/serial/8250/8250_lpss.c
SYNOPSYS DESIGNWARE APB GPIO DRIVER
M:	Hoan Tran <hoan@os.amperecomputing.com>
+0 −2
Original line number Diff line number Diff line
@@ -51,9 +51,7 @@ static void __speakup_set_selection(struct work_struct *work)
		goto unref;
	}

	console_lock();
	set_selection_kernel(&sel, tty);
	console_unlock();

unref:
	tty_kref_put(tty);
+10 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/sched.h>
#include <linux/serdev.h>
#include <linux/slab.h>
#include <linux/platform_data/x86/apple.h>

static bool is_registered;
static DEFINE_IDA(ctrl_ida);
@@ -631,6 +632,15 @@ static int acpi_serdev_check_resources(struct serdev_controller *ctrl,
	if (ret)
		return ret;

	/*
	 * Apple machines provide an empty resource template, so on those
	 * machines just look for immediate children with a "baud" property
	 * (from the _DSM method) instead.
	 */
	if (!lookup.controller_handle && x86_apple_machine &&
	    !acpi_dev_get_property(adev, "baud", ACPI_TYPE_BUFFER, NULL))
		acpi_get_parent(adev->handle, &lookup.controller_handle);

	/* Make sure controller and ResourceSource handle match */
	if (ACPI_HANDLE(ctrl->dev.parent) != lookup.controller_handle)
		return -ENODEV;
+33 −0
Original line number Diff line number Diff line
@@ -25,6 +25,14 @@

#include "8250.h"

#define PCI_DEVICE_ID_ACCES_COM_2S		0x1052
#define PCI_DEVICE_ID_ACCES_COM_4S		0x105d
#define PCI_DEVICE_ID_ACCES_COM_8S		0x106c
#define PCI_DEVICE_ID_ACCES_COM232_8		0x10a8
#define PCI_DEVICE_ID_ACCES_COM_2SM		0x10d2
#define PCI_DEVICE_ID_ACCES_COM_4SM		0x10db
#define PCI_DEVICE_ID_ACCES_COM_8SM		0x10ea

#define PCI_DEVICE_ID_COMMTECH_4224PCI335	0x0002
#define PCI_DEVICE_ID_COMMTECH_4222PCI335	0x0004
#define PCI_DEVICE_ID_COMMTECH_2324PCI335	0x000a
@@ -677,6 +685,22 @@ static int __maybe_unused exar_resume(struct device *dev)

static SIMPLE_DEV_PM_OPS(exar_pci_pm, exar_suspend, exar_resume);

static const struct exar8250_board acces_com_2x = {
	.num_ports	= 2,
	.setup		= pci_xr17c154_setup,
};

static const struct exar8250_board acces_com_4x = {
	.num_ports	= 4,
	.setup		= pci_xr17c154_setup,
};

static const struct exar8250_board acces_com_8x = {
	.num_ports	= 8,
	.setup		= pci_xr17c154_setup,
};


static const struct exar8250_board pbn_fastcom335_2 = {
	.num_ports	= 2,
	.setup		= pci_fastcom335_setup,
@@ -745,6 +769,15 @@ static const struct exar8250_board pbn_exar_XR17V8358 = {
	}

static const struct pci_device_id exar_pci_tbl[] = {
	EXAR_DEVICE(ACCESSIO, ACCES_COM_2S, acces_com_2x),
	EXAR_DEVICE(ACCESSIO, ACCES_COM_4S, acces_com_4x),
	EXAR_DEVICE(ACCESSIO, ACCES_COM_8S, acces_com_8x),
	EXAR_DEVICE(ACCESSIO, ACCES_COM232_8, acces_com_8x),
	EXAR_DEVICE(ACCESSIO, ACCES_COM_2SM, acces_com_2x),
	EXAR_DEVICE(ACCESSIO, ACCES_COM_4SM, acces_com_4x),
	EXAR_DEVICE(ACCESSIO, ACCES_COM_8SM, acces_com_8x),


	CONNECT_DEVICE(XR17C152, UART_2_232, pbn_connect),
	CONNECT_DEVICE(XR17C154, UART_4_232, pbn_connect),
	CONNECT_DEVICE(XR17C158, UART_8_232, pbn_connect),
+26 −15
Original line number Diff line number Diff line
@@ -264,6 +264,7 @@ struct lpuart_port {
	int			rx_dma_rng_buf_len;
	unsigned int		dma_tx_nents;
	wait_queue_head_t	dma_wait;
	bool			id_allocated;
};

struct lpuart_soc_data {
@@ -2390,6 +2391,8 @@ static int __init lpuart32_imx_early_console_setup(struct earlycon_device *devic
OF_EARLYCON_DECLARE(lpuart, "fsl,vf610-lpuart", lpuart_early_console_setup);
OF_EARLYCON_DECLARE(lpuart32, "fsl,ls1021a-lpuart", lpuart32_early_console_setup);
OF_EARLYCON_DECLARE(lpuart32, "fsl,imx7ulp-lpuart", lpuart32_imx_early_console_setup);
EARLYCON_DECLARE(lpuart, lpuart_early_console_setup);
EARLYCON_DECLARE(lpuart32, lpuart32_early_console_setup);

#define LPUART_CONSOLE	(&lpuart_console)
#define LPUART32_CONSOLE	(&lpuart32_console)
@@ -2420,19 +2423,6 @@ static int lpuart_probe(struct platform_device *pdev)
	if (!sport)
		return -ENOMEM;

	ret = of_alias_get_id(np, "serial");
	if (ret < 0) {
		ret = ida_simple_get(&fsl_lpuart_ida, 0, UART_NR, GFP_KERNEL);
		if (ret < 0) {
			dev_err(&pdev->dev, "port line is full, add device failed\n");
			return ret;
		}
	}
	if (ret >= ARRAY_SIZE(lpuart_ports)) {
		dev_err(&pdev->dev, "serial%d out of range\n", ret);
		return -EINVAL;
	}
	sport->port.line = ret;
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	sport->port.membase = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(sport->port.membase))
@@ -2477,9 +2467,25 @@ static int lpuart_probe(struct platform_device *pdev)
		}
	}

	ret = of_alias_get_id(np, "serial");
	if (ret < 0) {
		ret = ida_simple_get(&fsl_lpuart_ida, 0, UART_NR, GFP_KERNEL);
		if (ret < 0) {
			dev_err(&pdev->dev, "port line is full, add device failed\n");
			return ret;
		}
		sport->id_allocated = true;
	}
	if (ret >= ARRAY_SIZE(lpuart_ports)) {
		dev_err(&pdev->dev, "serial%d out of range\n", ret);
		ret = -EINVAL;
		goto failed_out_of_range;
	}
	sport->port.line = ret;

	ret = lpuart_enable_clks(sport);
	if (ret)
		return ret;
		goto failed_clock_enable;
	sport->port.uartclk = lpuart_get_baud_clk_rate(sport);

	lpuart_ports[sport->port.line] = sport;
@@ -2529,6 +2535,10 @@ static int lpuart_probe(struct platform_device *pdev)
failed_attach_port:
failed_irq_request:
	lpuart_disable_clks(sport);
failed_clock_enable:
failed_out_of_range:
	if (sport->id_allocated)
		ida_simple_remove(&fsl_lpuart_ida, sport->port.line);
	return ret;
}

@@ -2538,6 +2548,7 @@ static int lpuart_remove(struct platform_device *pdev)

	uart_remove_one_port(&lpuart_reg, &sport->port);

	if (sport->id_allocated)
		ida_simple_remove(&fsl_lpuart_ida, sport->port.line);

	lpuart_disable_clks(sport);
Loading