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

Commit a3369558 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: u_serial: Fix spin lockup issue"

parents e54464ab f158ebf5
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -615,11 +615,24 @@ static void gs_rx_push(struct work_struct *w)
		port->read_started--;
	}

	/* Push from tty to ldisc; without low_latency set this is handled by
	 * a workqueue, so we won't get callbacks and can hold port_lock
	/*
	 * Push from tty to ldisc:
	 * With low_latency set to 0:
	 * this is handled by a workqueue, so we won't get callbacks
	 * (tty->ops->flush_chars i.e. gs_flush_chars) and can hold
	 * port_lock.
	 * With low_latency set to 1:
	 * gs_flush_chars (tty->ops->flush_chars) is called synchronosly
	 * with port_lock held. Hence we need to release it temporarily
	 * to avoid recursive spinlock.
	 */
	if (do_push)
	if (do_push) {
		if (port->port.low_latency)
			spin_unlock(&port->port_lock);
		tty_flip_buffer_push(&port->port);
		if (port->port.low_latency)
			spin_lock(&port->port_lock);
	}

	/* We want our data queue to become empty ASAP, keeping data
	 * in the tty and ldisc (not here).  If we couldn't push any