at86rf230: fix race condition
authorAlexander Aring <alex.aring@gmail.com>
Tue, 7 Oct 2014 08:38:31 +0000 (10:38 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 25 Oct 2014 05:56:23 +0000 (07:56 +0200)
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>
drivers/net/ieee802154/at86rf230.c

index 8754f158abbf57a6211f165d934f149325c358e6..5dbec64eb7868f9bcf307ad8b26a663d8d8e5c09 100644 (file)
@@ -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,
This page took 0.026562 seconds and 5 git commands to generate.