]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mrf24j40: avoid uninitialized byte in SPI transfer to radio.
authorWalter Mack <wmack@componentsw.com>
Tue, 12 Jul 2016 03:02:16 +0000 (20:02 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 12 Jul 2016 09:54:53 +0000 (11:54 +0200)
isr function issues SPI read command to mrf to obtain INTSTAT.
SPI transfer is 2 bytes, but value of 2nd byte is not defined.
This had the effect that only the first ISR worked as intended. The
second ISR read incorrect INTSTAT values. Observed on Raspberry PI B+.

Signed-off-by: Walter Mack <wmack@componentsw.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/net/ieee802154/mrf24j40.c

index f446db82856128f5b462ace90e9fcb83f9f7304f..7b131f8e40937000a273cfabbbf04a03a4af2f17 100644 (file)
@@ -1054,6 +1054,8 @@ static irqreturn_t mrf24j40_isr(int irq, void *data)
        disable_irq_nosync(irq);
 
        devrec->irq_buf[0] = MRF24J40_READSHORT(REG_INTSTAT);
+       devrec->irq_buf[1] = 0;
+
        /* Read the interrupt status */
        ret = spi_async(devrec->spi, &devrec->irq_msg);
        if (ret) {