diff options
author | Claudiu Manoil <claudiu.manoil@freescale.com> | 2014-10-07 03:44:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-09 01:40:37 -0400 |
commit | d55398ba81139bc826a8c2417a01280e99f08cf3 (patch) | |
tree | 915fd2223bcf421e0576f41ed9ce240024e972b1 | |
parent | a4feee89ce4590c7a4aead49ca5a4853dc6ea5dc (diff) |
gianfar: Replace eieio with wmb for non-PPC archs
Replace PPC specific eieio() with arch independent wmb()
for other architectures, i.e. ARM.
The eieio() macro is not defined on ARM and generates
build error.
Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.c | 13 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.h | 16 |
2 files changed, 19 insertions, 10 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index 356a9982d014..379b1a578d3d 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
@@ -165,7 +165,7 @@ static void gfar_init_rxbdp(struct gfar_priv_rx_q *rx_queue, struct rxbd8 *bdp, | |||
165 | if (bdp == rx_queue->rx_bd_base + rx_queue->rx_ring_size - 1) | 165 | if (bdp == rx_queue->rx_bd_base + rx_queue->rx_ring_size - 1) |
166 | lstatus |= BD_LFLAG(RXBD_WRAP); | 166 | lstatus |= BD_LFLAG(RXBD_WRAP); |
167 | 167 | ||
168 | eieio(); | 168 | gfar_wmb(); |
169 | 169 | ||
170 | bdp->lstatus = lstatus; | 170 | bdp->lstatus = lstatus; |
171 | } | 171 | } |
@@ -2371,18 +2371,11 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2371 | */ | 2371 | */ |
2372 | spin_lock_irqsave(&tx_queue->txlock, flags); | 2372 | spin_lock_irqsave(&tx_queue->txlock, flags); |
2373 | 2373 | ||
2374 | /* The powerpc-specific eieio() is used, as wmb() has too strong | 2374 | gfar_wmb(); |
2375 | * semantics (it requires synchronization between cacheable and | ||
2376 | * uncacheable mappings, which eieio doesn't provide and which we | ||
2377 | * don't need), thus requiring a more expensive sync instruction. At | ||
2378 | * some point, the set of architecture-independent barrier functions | ||
2379 | * should be expanded to include weaker barriers. | ||
2380 | */ | ||
2381 | eieio(); | ||
2382 | 2375 | ||
2383 | txbdp_start->lstatus = lstatus; | 2376 | txbdp_start->lstatus = lstatus; |
2384 | 2377 | ||
2385 | eieio(); /* force lstatus write before tx_skbuff */ | 2378 | gfar_wmb(); /* force lstatus write before tx_skbuff */ |
2386 | 2379 | ||
2387 | tx_queue->tx_skbuff[tx_queue->skb_curtx] = skb; | 2380 | tx_queue->tx_skbuff[tx_queue->skb_curtx] = skb; |
2388 | 2381 | ||
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h index 0b3772217a9a..2805cfbf1765 100644 --- a/drivers/net/ethernet/freescale/gianfar.h +++ b/drivers/net/ethernet/freescale/gianfar.h | |||
@@ -1241,6 +1241,22 @@ static inline int gfar_is_rx_dma_stopped(struct gfar_private *priv) | |||
1241 | return gfar_read(®s->ievent) & IEVENT_GRSC; | 1241 | return gfar_read(®s->ievent) & IEVENT_GRSC; |
1242 | } | 1242 | } |
1243 | 1243 | ||
1244 | static inline void gfar_wmb(void) | ||
1245 | { | ||
1246 | #if defined(CONFIG_PPC) | ||
1247 | /* The powerpc-specific eieio() is used, as wmb() has too strong | ||
1248 | * semantics (it requires synchronization between cacheable and | ||
1249 | * uncacheable mappings, which eieio() doesn't provide and which we | ||
1250 | * don't need), thus requiring a more expensive sync instruction. At | ||
1251 | * some point, the set of architecture-independent barrier functions | ||
1252 | * should be expanded to include weaker barriers. | ||
1253 | */ | ||
1254 | eieio(); | ||
1255 | #else | ||
1256 | wmb(); /* order write acesses for BD (or FCB) fields */ | ||
1257 | #endif | ||
1258 | } | ||
1259 | |||
1244 | irqreturn_t gfar_receive(int irq, void *dev_id); | 1260 | irqreturn_t gfar_receive(int irq, void *dev_id); |
1245 | int startup_gfar(struct net_device *dev); | 1261 | int startup_gfar(struct net_device *dev); |
1246 | void stop_gfar(struct net_device *dev); | 1262 | void stop_gfar(struct net_device *dev); |