Unverified Commit 4a032c30 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!6851 serial/pmac_zilog: Remove flawed mitigation for rx irq flood

parents 56e267ca 7e40e827
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -217,7 +217,6 @@ static bool pmz_receive_chars(struct uart_pmac_port *uap)
{
	struct tty_port *port;
	unsigned char ch, r1, drop, flag;
	int loops = 0;

	/* Sanity check, make sure the old bug is no longer happening */
	if (uap->port.state == NULL) {
@@ -298,24 +297,11 @@ static bool pmz_receive_chars(struct uart_pmac_port *uap)
		if (r1 & Rx_OVR)
			tty_insert_flip_char(port, 0, TTY_OVERRUN);
	next_char:
		/* We can get stuck in an infinite loop getting char 0 when the
		 * line is in a wrong HW state, we break that here.
		 * When that happens, I disable the receive side of the driver.
		 * Note that what I've been experiencing is a real irq loop where
		 * I'm getting flooded regardless of the actual port speed.
		 * Something strange is going on with the HW
		 */
		if ((++loops) > 1000)
			goto flood;
		ch = read_zsreg(uap, R0);
		if (!(ch & Rx_CH_AV))
			break;
	}

	return true;
 flood:
	pmz_interrupt_control(uap, 0);
	pmz_error("pmz: rx irq flood !\n");
	return true;
}