Commit 9b9ab1b3 authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

tty: r3964: Use tty->read_wait waitqueue

The tty core provides read_wait waitqueue specifically for line
disciplines to wait readers; otherwise, the line discipline may
miss wakeups generated by the tty core.

NB: The tty core already provides serialization for the line discipline's
close() method, and guarantees no readers or writers will be using the
closing instance of the line discipline. Completely remove that wakeup.
Signed-off-by: 's avatarPeter Hurley <>
Signed-off-by: 's avatarGreg Kroah-Hartman <>
parent cc2aaabf
......@@ -276,7 +276,7 @@ static void remove_from_tx_queue(struct r3964_info *pInfo, int error_code)
add_msg(pHeader->owner, R3964_MSG_ACK, pHeader->length,
error_code, NULL);
spin_lock_irqsave(&pInfo->lock, flags);
......@@ -542,7 +542,7 @@ static void on_receive_block(struct r3964_info *pInfo)
pInfo->state = R3964_IDLE;
......@@ -979,7 +979,6 @@ static int r3964_open(struct tty_struct *tty)
pInfo->tty = tty;
pInfo->priority = R3964_MASTER;
pInfo->rx_first = pInfo->rx_last = NULL;
pInfo->tx_first = pInfo->tx_last = NULL;
......@@ -1045,7 +1044,6 @@ static void r3964_close(struct tty_struct *tty)
/* Free buffers: */
TRACE_M("r3964_close - rx_buf kfree %p", pInfo->rx_buf);
......@@ -1077,7 +1075,7 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
goto unlock;
/* block until there is a message: */
wait_event_interruptible_tty(tty, pInfo->read_wait,
wait_event_interruptible_tty(tty, tty->read_wait,
(pMsg = remove_msg(pInfo, pClient)));
......@@ -1227,7 +1225,7 @@ static unsigned int r3964_poll(struct tty_struct *tty, struct file *file,
pClient = findClient(pInfo, task_pid(current));
if (pClient) {
poll_wait(file, &pInfo->read_wait, wait);
poll_wait(file, &tty->read_wait, wait);
spin_lock_irqsave(&pInfo->lock, flags);
pMsg = pClient->first_msg;
spin_unlock_irqrestore(&pInfo->lock, flags);
......@@ -152,9 +152,6 @@ struct r3964_info {
unsigned char *rx_buf; /* ring buffer */
unsigned char *tx_buf;
wait_queue_head_t read_wait;
//struct wait_queue *read_wait;
struct r3964_block_header *rx_first;
struct r3964_block_header *rx_last;
struct r3964_block_header *tx_first;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment