diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-03-05 01:09:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-06 02:47:04 -0500 |
commit | 0b176ce3a7cbfa92eceddf3896f1a504877d974a (patch) | |
tree | fe3b0e5154f51ba4a8a87dc6bd4dbd00e47270b6 /net/irda/ircomm | |
parent | 2f7c069b96ed7b1f6236f2fa7b0bc06f4f54f2d9 (diff) |
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>
Diffstat (limited to 'net/irda/ircomm')
-rw-r--r-- | net/irda/ircomm/ircomm_tty.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index d282bbea710e..522543d9264a 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c | |||
@@ -324,7 +324,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, | |||
324 | if (tty->termios.c_cflag & CBAUD) | 324 | if (tty->termios.c_cflag & CBAUD) |
325 | tty_port_raise_dtr_rts(port); | 325 | tty_port_raise_dtr_rts(port); |
326 | 326 | ||
327 | current->state = TASK_INTERRUPTIBLE; | 327 | set_current_state(TASK_INTERRUPTIBLE); |
328 | 328 | ||
329 | if (tty_hung_up_p(filp) || | 329 | if (tty_hung_up_p(filp) || |
330 | !test_bit(ASYNCB_INITIALIZED, &port->flags)) { | 330 | !test_bit(ASYNCB_INITIALIZED, &port->flags)) { |