diff options
author | Claudiu Manoil <claudiu.manoil@freescale.com> | 2014-03-24 10:22:55 (GMT) |
---|---|---|
committer | Matthew Weigel <Matthew.Weigel@freescale.com> | 2014-12-11 18:37:58 (GMT) |
commit | 8c8e0182d2ac7aa4e8fb9424414788db935648cd (patch) | |
tree | 956844cf73ce7caaf2e470a3504d714ce8af7bee /drivers/net/ethernet/freescale/gianfar.h | |
parent | 46fc094f93b41b935291736ef7caa2f97a5d6bc7 (diff) | |
download | linux-fsl-qoriq-8c8e0182d2ac7aa4e8fb9424414788db935648cd.tar.xz |
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>
---
Cherry-picked from commit: d55398ba81139bc826a8c2417a01280e99f08cf3
---
Change-Id: I6cd072cf6e28fc81a686afab8bc42921da2e5020
Reviewed-on: http://git.am.freescale.net:8181/21172
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Zhengxiong Jin <Jason.Jin@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/gianfar.h')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h index e1a8b01..69c4196 100644 --- a/drivers/net/ethernet/freescale/gianfar.h +++ b/drivers/net/ethernet/freescale/gianfar.h @@ -1439,6 +1439,22 @@ static inline int gfar_is_rx_dma_stopped(struct gfar_private *priv) return gfar_read(®s->ievent) & IEVENT_GRSC; } +static inline void gfar_wmb(void) +{ +#if defined(CONFIG_PPC) + /* The powerpc-specific eieio() is used, as wmb() has too strong + * semantics (it requires synchronization between cacheable and + * uncacheable mappings, which eieio() doesn't provide and which we + * don't need), thus requiring a more expensive sync instruction. At + * some point, the set of architecture-independent barrier functions + * should be expanded to include weaker barriers. + */ + eieio(); +#else + wmb(); /* order write acesses for BD (or FCB) fields */ +#endif +} + irqreturn_t gfar_receive(int irq, void *dev_id); int startup_gfar(struct net_device *dev); void stop_gfar(struct net_device *dev); @@ -1570,7 +1586,7 @@ static inline void gfar_init_rxbdp(struct gfar_priv_rx_q *rx_queue, if (bdp == rx_queue->rx_bd_base + rx_queue->rx_ring_size - 1) lstatus |= BD_LFLAG(RXBD_WRAP); - eieio(); + gfar_wmb(); bdp->lstatus = lstatus; } |