aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2010-11-10 18:46:40 +0000
committerBen Hutchings <bhutchings@solarflare.com>2010-12-06 22:54:18 +0000
commit51c56f40ef41ca780ff001d59727eda03fa39374 (patch)
treee3bee1ceed353fb1e9ad110e035a55dd138face4 /drivers/net/sfc
parentab28c12a8e6fea875b6757052e211772f62fa771 (diff)
downloadkernel_samsung_smdk4412-51c56f40ef41ca780ff001d59727eda03fa39374.tar.gz
kernel_samsung_smdk4412-51c56f40ef41ca780ff001d59727eda03fa39374.tar.bz2
kernel_samsung_smdk4412-51c56f40ef41ca780ff001d59727eda03fa39374.zip
sfc: Use ACCESS_ONCE when copying efx_tx_queue::read_count
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r--drivers/net/sfc/tx.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c
index 03194f7c095..fef22351ddb 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)
* of read_count. */
smp_mb();
tx_queue->old_read_count =
- *(volatile unsigned *)
- &tx_queue->read_count;
+ ACCESS_ONCE(tx_queue->read_count);
fill_level = (tx_queue->insert_count
- tx_queue->old_read_count);
q_space = efx->txq_entries - 1 - fill_level;
@@ -764,7 +763,7 @@ static int efx_tx_queue_insert(struct efx_tx_queue *tx_queue,
* stopped from the access of read_count. */
smp_mb();
tx_queue->old_read_count =
- *(volatile unsigned *)&tx_queue->read_count;
+ ACCESS_ONCE(tx_queue->read_count);
fill_level = (tx_queue->insert_count
- tx_queue->old_read_count);
q_space = efx->txq_entries - 1 - fill_level;