diff options
author | Alexander Aring <alex.aring@gmail.com> | 2015-03-26 07:46:29 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-03-27 14:18:50 -0400 |
commit | 3ff7092bc83b50e831c43d83141084756f4e6ae1 (patch) | |
tree | dc8fc9b0c9dd44926a8dfb3ebd31353ea272df89 | |
parent | 8bf9538a5de5f6496993fb294ef606e453232ea4 (diff) |
at86rf230: remove unnecessary spinlock
This spinlock isn't necessary because if we are in TX_ON/TX_ARET_ON
state the transceiver can't be interrupted e.g. by receiving a frame
when a SHR was detected. In this time the transceiver doesn't leave
the TX_ON/TX_ARET_ON state until the tx complete irq change the state
into RX_AACK_ON again. This means a receiving interrupt in state
TX_ON/TX_ARET_ON can't happen and is_tx is protected by transceiver.
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 | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index cc5efa149da1..1278dd5ee187 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/irq.h> | 25 | #include <linux/irq.h> |
26 | #include <linux/gpio.h> | 26 | #include <linux/gpio.h> |
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <linux/spinlock.h> | ||
29 | #include <linux/spi/spi.h> | 28 | #include <linux/spi/spi.h> |
30 | #include <linux/spi/at86rf230.h> | 29 | #include <linux/spi/at86rf230.h> |
31 | #include <linux/regmap.h> | 30 | #include <linux/regmap.h> |
@@ -96,8 +95,6 @@ struct at86rf230_local { | |||
96 | unsigned long cal_timeout; | 95 | unsigned long cal_timeout; |
97 | s8 max_frame_retries; | 96 | s8 max_frame_retries; |
98 | bool is_tx; | 97 | bool is_tx; |
99 | /* spinlock for is_tx protection */ | ||
100 | spinlock_t lock; | ||
101 | u8 tx_retry; | 98 | u8 tx_retry; |
102 | struct sk_buff *tx_skb; | 99 | struct sk_buff *tx_skb; |
103 | struct at86rf230_state_change tx; | 100 | struct at86rf230_state_change tx; |
@@ -878,10 +875,8 @@ at86rf230_rx_trac_check(void *context) | |||
878 | static void | 875 | static void |
879 | at86rf230_irq_trx_end(struct at86rf230_local *lp) | 876 | at86rf230_irq_trx_end(struct at86rf230_local *lp) |
880 | { | 877 | { |
881 | spin_lock(&lp->lock); | ||
882 | if (lp->is_tx) { | 878 | if (lp->is_tx) { |
883 | lp->is_tx = 0; | 879 | lp->is_tx = 0; |
884 | spin_unlock(&lp->lock); | ||
885 | 880 | ||
886 | if (lp->tx_aret) | 881 | if (lp->tx_aret) |
887 | at86rf230_async_state_change(lp, &lp->irq, | 882 | at86rf230_async_state_change(lp, &lp->irq, |
@@ -894,7 +889,6 @@ at86rf230_irq_trx_end(struct at86rf230_local *lp) | |||
894 | at86rf230_tx_complete, | 889 | at86rf230_tx_complete, |
895 | true); | 890 | true); |
896 | } else { | 891 | } else { |
897 | spin_unlock(&lp->lock); | ||
898 | at86rf230_async_read_reg(lp, RG_TRX_STATE, &lp->irq, | 892 | at86rf230_async_read_reg(lp, RG_TRX_STATE, &lp->irq, |
899 | at86rf230_rx_trac_check, true); | 893 | at86rf230_rx_trac_check, true); |
900 | } | 894 | } |
@@ -964,9 +958,7 @@ at86rf230_write_frame(void *context) | |||
964 | u8 *buf = ctx->buf; | 958 | u8 *buf = ctx->buf; |
965 | int rc; | 959 | int rc; |
966 | 960 | ||
967 | spin_lock(&lp->lock); | ||
968 | lp->is_tx = 1; | 961 | lp->is_tx = 1; |
969 | spin_unlock(&lp->lock); | ||
970 | 962 | ||
971 | buf[0] = CMD_FB | CMD_WRITE; | 963 | buf[0] = CMD_FB | CMD_WRITE; |
972 | buf[1] = skb->len + 2; | 964 | buf[1] = skb->len + 2; |
@@ -1698,7 +1690,6 @@ static int at86rf230_probe(struct spi_device *spi) | |||
1698 | if (rc < 0) | 1690 | if (rc < 0) |
1699 | goto free_dev; | 1691 | goto free_dev; |
1700 | 1692 | ||
1701 | spin_lock_init(&lp->lock); | ||
1702 | init_completion(&lp->state_complete); | 1693 | init_completion(&lp->state_complete); |
1703 | 1694 | ||
1704 | spi_set_drvdata(spi, lp); | 1695 | spi_set_drvdata(spi, lp); |