diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-11-10 13:46:40 -0500 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2010-12-06 17:54:18 -0500 |
commit | 51c56f40ef41ca780ff001d59727eda03fa39374 (patch) | |
tree | e3bee1ceed353fb1e9ad110e035a55dd138face4 | |
parent | ab28c12a8e6fea875b6757052e211772f62fa771 (diff) |
sfc: Use ACCESS_ONCE when copying efx_tx_queue::read_count
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r-- | drivers/net/sfc/tx.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c index 03194f7c0954..fef22351ddbd 100644 --- a/drivers/net/sfc/tx.c +++ b/drivers/net/sfc/tx.c | |||
@@ -240,8 +240,7 @@ netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb) | |||
240 | * of read_count. */ | 240 | * of read_count. */ |
241 | smp_mb(); | 241 | smp_mb(); |
242 | tx_queue->old_read_count = | 242 | tx_queue->old_read_count = |
243 | *(volatile unsigned *) | 243 | ACCESS_ONCE(tx_queue->read_count); |
244 | &tx_queue->read_count; | ||
245 | fill_level = (tx_queue->insert_count | 244 | fill_level = (tx_queue->insert_count |
246 | - tx_queue->old_read_count); | 245 | - tx_queue->old_read_count); |
247 | q_space = efx->txq_entries - 1 - fill_level; | 246 | q_space = efx->txq_entries - 1 - fill_level; |
@@ -764,7 +763,7 @@ static int efx_tx_queue_insert(struct efx_tx_queue *tx_queue, | |||
764 | * stopped from the access of read_count. */ | 763 | * stopped from the access of read_count. */ |
765 | smp_mb(); | 764 | smp_mb(); |
766 | tx_queue->old_read_count = | 765 | tx_queue->old_read_count = |
767 | *(volatile unsigned *)&tx_queue->read_count; | 766 | ACCESS_ONCE(tx_queue->read_count); |
768 | fill_level = (tx_queue->insert_count | 767 | fill_level = (tx_queue->insert_count |
769 | - tx_queue->old_read_count); | 768 | - tx_queue->old_read_count); |
770 | q_space = efx->txq_entries - 1 - fill_level; | 769 | q_space = efx->txq_entries - 1 - fill_level; |