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

Commit 80e5c4dd authored by Sasha Levin's avatar Sasha Levin
Browse files

Revert "tty: fix stall caused by missing memory barrier in drivers/tty/n_tty.c"



This reverts commit af32cc7b.

The commit was incorrectly backported and was causing hangs.

Reported-by: default avatarCorey Wright <undefined@pobox.com>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent 8341455f
Loading
Loading
Loading
Loading
+10 −6
Original line number Original line Diff line number Diff line
@@ -364,7 +364,7 @@ static void n_tty_packet_mode_flush(struct tty_struct *tty)
	spin_lock_irqsave(&tty->ctrl_lock, flags);
	spin_lock_irqsave(&tty->ctrl_lock, flags);
	if (tty->link->packet) {
	if (tty->link->packet) {
		tty->ctrl_status |= TIOCPKT_FLUSHREAD;
		tty->ctrl_status |= TIOCPKT_FLUSHREAD;
		spin_unlock_irqrestore(&tty->ctrl_lock, flags);
		if (waitqueue_active(&tty->link->read_wait))
			wake_up_interruptible(&tty->link->read_wait);
			wake_up_interruptible(&tty->link->read_wait);
	}
	}
	spin_unlock_irqrestore(&tty->ctrl_lock, flags);
	spin_unlock_irqrestore(&tty->ctrl_lock, flags);
@@ -1387,6 +1387,7 @@ handle_newline:
			put_tty_queue(c, ldata);
			put_tty_queue(c, ldata);
			ldata->canon_head = ldata->read_head;
			ldata->canon_head = ldata->read_head;
			kill_fasync(&tty->fasync, SIGIO, POLL_IN);
			kill_fasync(&tty->fasync, SIGIO, POLL_IN);
			if (waitqueue_active(&tty->read_wait))
				wake_up_interruptible_poll(&tty->read_wait, POLLIN);
				wake_up_interruptible_poll(&tty->read_wait, POLLIN);
			return 0;
			return 0;
		}
		}
@@ -1670,6 +1671,7 @@ static void __receive_buf(struct tty_struct *tty, const unsigned char *cp,
	if ((!ldata->icanon && (read_cnt(ldata) >= ldata->minimum_to_wake)) ||
	if ((!ldata->icanon && (read_cnt(ldata) >= ldata->minimum_to_wake)) ||
		L_EXTPROC(tty)) {
		L_EXTPROC(tty)) {
		kill_fasync(&tty->fasync, SIGIO, POLL_IN);
		kill_fasync(&tty->fasync, SIGIO, POLL_IN);
		if (waitqueue_active(&tty->read_wait))
			wake_up_interruptible_poll(&tty->read_wait, POLLIN);
			wake_up_interruptible_poll(&tty->read_wait, POLLIN);
	}
	}
}
}
@@ -1889,7 +1891,9 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
	}
	}


	/* The termios change make the tty ready for I/O */
	/* The termios change make the tty ready for I/O */
	if (waitqueue_active(&tty->write_wait))
		wake_up_interruptible(&tty->write_wait);
		wake_up_interruptible(&tty->write_wait);
	if (waitqueue_active(&tty->read_wait))
		wake_up_interruptible(&tty->read_wait);
		wake_up_interruptible(&tty->read_wait);
}
}