diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-10-07 12:38:31 +0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-25 09:56:23 +0400 |
commit | 35e92a8e1b9058a5f7da271a7a60264a4888f4b9 (patch) | |
tree | 05369199c4918deaecee3431cfe1af0391399279 | |
parent | e93102112c1659bd3b5991adc213816c792b9fbd (diff) | |
download | linux-35e92a8e1b9058a5f7da271a7a60264a4888f4b9.tar.xz |
at86rf230: fix race condition
When the driver waits for a tx completion currently the driver direct
enables the irq. When we switching to RX_AACK_ON some steps afterwards
the driver could receive a new frame and request resources which are
already in use, for example irq state change resource.
To be sure there are no new interrupts when we switching to RX_AACK_ON,
we enable the irq when state change to RX_AACK_ON was completed.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | drivers/net/ieee802154/at86rf230.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index 8754f158abbf..5dbec64eb786 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c @@ -705,6 +705,7 @@ at86rf230_tx_complete(void *context) struct at86rf230_state_change *ctx = context; struct at86rf230_local *lp = ctx->lp; + enable_irq(lp->spi->irq); complete(&lp->tx_complete); } @@ -860,7 +861,6 @@ at86rf230_irq_trx_end(struct at86rf230_local *lp) if (lp->is_tx) { lp->is_tx = 0; spin_unlock(&lp->lock); - enable_irq(lp->spi->irq); if (lp->tx_aret) return at86rf230_async_state_change(lp, &lp->irq, |