Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b52c85a7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull tty/serial fixes from Greg KH:
 "Here are some tty and serial driver fixes for reported issues for
  4.17-rc3.

  Nothing major, but a number of small things:

   - device tree fixes/updates for serial ports

   - earlycon fixes

   - n_gsm fixes

   - tty core change reverted to help resolve syszkaller reports

   - other serial driver small fixes

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

* tag 'tty-4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  tty: Use __GFP_NOFAIL for tty_ldisc_get()
  tty: serial: xuartps: Setup early console when uartclk is also passed
  tty: Don't call panic() at tty_ldisc_init()
  tty: Avoid possible error pointer dereference at tty_ldisc_restore().
  dt-bindings: mvebu-uart: DT fix s/interrupts-names/interrupt-names/
  tty: serial: qcom_geni_serial: Use signed variable to get IRQ
  earlycon: Use a pointer table to fix __earlycon_table stride
  serial: sh-sci: Document r8a77470 bindings
  dt-bindings: meson-uart: DT fix s/clocks-names/clock-names/
  serial: imx: fix cached UCR2 read on software reset
  serial: imx: warn user when using unsupported configuration
  serial: mvebu-uart: Fix local flags handling on termios update
  tty: n_gsm: Fix DLCI handling for ADM mode if debug & 2 is not set
  tty: n_gsm: Fix long delays with control frame timeouts in ADM mode
parents 79a17dd9 bcdd0ca8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ Required properties:
- interrupts : identifier to the device interrupt
- clocks : a list of phandle + clock-specifier pairs, one for each
	   entry in clock names.
- clocks-names :
- clock-names :
   * "xtal" for external xtal clock identifier
   * "pclk" for the bus core clock, either the clk81 clock or the gate clock
   * "baud" for the source of the baudrate generator, can be either the xtal
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ Required properties:
    - Must contain two elements for the extended variant of the IP
      (marvell,armada-3700-uart-ext): "uart-tx" and "uart-rx",
      respectively the UART TX interrupt and the UART RX interrupt. A
      corresponding interrupts-names property must be defined.
      corresponding interrupt-names property must be defined.
    - For backward compatibility reasons, a single element interrupts
      property is also supported for the standard variant of the IP,
      containing only the UART sum interrupt. This form is deprecated
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ Required properties:
    - "renesas,scifa-r8a7745" for R8A7745 (RZ/G1E) SCIFA compatible UART.
    - "renesas,scifb-r8a7745" for R8A7745 (RZ/G1E) SCIFB compatible UART.
    - "renesas,hscif-r8a7745" for R8A7745 (RZ/G1E) HSCIF compatible UART.
    - "renesas,scif-r8a77470" for R8A77470 (RZ/G1C) SCIF compatible UART.
    - "renesas,hscif-r8a77470" for R8A77470 (RZ/G1C) HSCIF compatible UART.
    - "renesas,scif-r8a7778" for R8A7778 (R-Car M1) SCIF compatible UART.
    - "renesas,scif-r8a7779" for R8A7779 (R-Car H1) SCIF compatible UART.
    - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.
+5 −2
Original line number Diff line number Diff line
@@ -942,7 +942,7 @@ int __init early_init_dt_scan_chosen_stdout(void)
	int offset;
	const char *p, *q, *options = NULL;
	int l;
	const struct earlycon_id *match;
	const struct earlycon_id **p_match;
	const void *fdt = initial_boot_params;

	offset = fdt_path_offset(fdt, "/chosen");
@@ -969,7 +969,10 @@ int __init early_init_dt_scan_chosen_stdout(void)
		return 0;
	}

	for (match = __earlycon_table; match < __earlycon_table_end; match++) {
	for (p_match = __earlycon_table; p_match < __earlycon_table_end;
	     p_match++) {
		const struct earlycon_id *match = *p_match;

		if (!match->compatible[0])
			continue;

+22 −1
Original line number Diff line number Diff line
@@ -121,6 +121,9 @@ struct gsm_dlci {
	struct mutex mutex;

	/* Link layer */
	int mode;
#define DLCI_MODE_ABM		0	/* Normal Asynchronous Balanced Mode */
#define DLCI_MODE_ADM		1	/* Asynchronous Disconnected Mode */
	spinlock_t lock;	/* Protects the internal state */
	struct timer_list t1;	/* Retransmit timer for SABM and UA */
	int retries;
@@ -1364,7 +1367,13 @@ static struct gsm_control *gsm_control_send(struct gsm_mux *gsm,
	ctrl->data = data;
	ctrl->len = clen;
	gsm->pending_cmd = ctrl;

	/* If DLCI0 is in ADM mode skip retries, it won't respond */
	if (gsm->dlci[0]->mode == DLCI_MODE_ADM)
		gsm->cretries = 1;
	else
		gsm->cretries = gsm->n2;

	mod_timer(&gsm->t2_timer, jiffies + gsm->t2 * HZ / 100);
	gsm_control_transmit(gsm, ctrl);
	spin_unlock_irqrestore(&gsm->control_lock, flags);
@@ -1472,6 +1481,7 @@ static void gsm_dlci_t1(struct timer_list *t)
			if (debug & 8)
				pr_info("DLCI %d opening in ADM mode.\n",
					dlci->addr);
			dlci->mode = DLCI_MODE_ADM;
			gsm_dlci_open(dlci);
		} else {
			gsm_dlci_close(dlci);
@@ -2861,11 +2871,22 @@ static int gsmtty_modem_update(struct gsm_dlci *dlci, u8 brk)
static int gsm_carrier_raised(struct tty_port *port)
{
	struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port);
	struct gsm_mux *gsm = dlci->gsm;

	/* Not yet open so no carrier info */
	if (dlci->state != DLCI_OPEN)
		return 0;
	if (debug & 2)
		return 1;

	/*
	 * Basic mode with control channel in ADM mode may not respond
	 * to CMD_MSC at all and modem_rx is empty.
	 */
	if (gsm->encoding == 0 && gsm->dlci[0]->mode == DLCI_MODE_ADM &&
	    !dlci->modem_rx)
		return 1;

	return dlci->modem_rx & TIOCM_CD;
}

Loading