diff options
author | Claudiu Manoil <claudiu.manoil@freescale.com> | 2014-10-07 11:44:35 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-09 09:40:37 +0400 |
commit | d55398ba81139bc826a8c2417a01280e99f08cf3 (patch) | |
tree | 915fd2223bcf421e0576f41ed9ce240024e972b1 /drivers/net/ethernet/freescale/gianfar.h | |
parent | a4feee89ce4590c7a4aead49ca5a4853dc6ea5dc (diff) | |
download | linux-d55398ba81139bc826a8c2417a01280e99f08cf3.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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/gianfar.h')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.h | 16 |
1 files changed, 16 insertions, 0 deletions
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) 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); |