Skip to content

Commit 0b176ce

Browse files
peterhurleydavem330
authored andcommitted
net/irda: Use barrier to set task state
Without a memory and compiler barrier, the task state change can migrate relative to the condition testing in a blocking loop. However, the task state change must be visible across all cpus prior to testing those conditions. Failing to do this can result in the familiar 'lost wakeup' and this task will hang until killed. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2f7c069 commit 0b176ce

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/irda/ircomm/ircomm_tty.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
324324
if (tty->termios.c_cflag & CBAUD)
325325
tty_port_raise_dtr_rts(port);
326326

327-
current->state = TASK_INTERRUPTIBLE;
327+
set_current_state(TASK_INTERRUPTIBLE);
328328

329329
if (tty_hung_up_p(filp) ||
330330
!test_bit(ASYNCB_INITIALIZED, &port->flags)) {

0 commit comments

Comments
 (0)