Commit 85b722085574a327e617f049423dab3faac64a04

Authored by Florian Fainelli
Committed by Greg Kroah-Hartman
1 parent c59231c878

net: dsa: bcm_sf2: Fix 64-bits register writes

[ Upstream commit 03679a14739a0d4c14b52ba65a69ff553bfba73b ]

The macro to write 64-bits quantities to the 32-bits register swapped
the value and offsets arguments, we want to preserve the ordering of the
arguments with respect to how writel() is implemented for instance:
value first, offset/base second.

Fixes: 246d7f773c13 ("net: dsa: add Broadcom SF2 switch driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

drivers/net/dsa/bcm_sf2.h
... ... @@ -112,8 +112,8 @@
112 112 spin_unlock(&priv->indir_lock); \
113 113 return (u64)indir << 32 | dir; \
114 114 } \
115   -static inline void name##_writeq(struct bcm_sf2_priv *priv, u32 off, \
116   - u64 val) \
  115 +static inline void name##_writeq(struct bcm_sf2_priv *priv, u64 val, \
  116 + u32 off) \
117 117 { \
118 118 spin_lock(&priv->indir_lock); \
119 119 reg_writel(priv, upper_32_bits(val), REG_DIR_DATA_WRITE); \