diff options
author | Arnd Bergmann <arnd@arndb.de> | 2014-02-26 12:01:53 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-02-26 22:06:13 +0100 |
commit | c728cc88cec52a6bf97679ed4353bc42ff25e6ab (patch) | |
tree | 37d77f03a9d6a9046ad8e850d65a26ea8b23a208 /drivers/isdn/hisax/elsa_ser.c | |
parent | isdn: pcbit: fix interruptible_sleep_on race (diff) | |
download | linux-c728cc88cec52a6bf97679ed4353bc42ff25e6ab.tar.xz linux-c728cc88cec52a6bf97679ed4353bc42ff25e6ab.zip |
isdn: hisax/elsa: fix sleep_on race in elsa FSM
The state machine code in the elsa driver uses interruptible_sleep_on
to wait for state changes, which is racy. A closer look at the possible
states reveals that it is always used to wait for getting back into
ARCOFI_NOP, so we can use wait_event_interruptible instead.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/hisax/elsa_ser.c')
-rw-r--r-- | drivers/isdn/hisax/elsa_ser.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c index 3f84dd8f1757..a2a358c1dc8e 100644 --- a/drivers/isdn/hisax/elsa_ser.c +++ b/drivers/isdn/hisax/elsa_ser.c @@ -573,7 +573,8 @@ modem_l2l1(struct PStack *st, int pr, void *arg) test_and_clear_bit(BC_FLG_ACTIV, &bcs->Flag); bcs->cs->dc.isac.arcofi_bc = st->l1.bc; arcofi_fsm(bcs->cs, ARCOFI_START, &ARCOFI_XOP_0); - interruptible_sleep_on(&bcs->cs->dc.isac.arcofi_wait); + wait_event_interruptible(bcs->cs->dc.isac.arcofi_wait, + bcs->cs->dc.isac.arcofi_state == ARCOFI_NOP); bcs->cs->hw.elsa.MFlag = 1; } else { printk(KERN_WARNING "ElsaSer: unknown pr %x\n", pr); |