Skip to contentSkip to conversation

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

PATCH In review Florian Fainelli 3 participants 3 messages Sep 9, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: bcm_sf2: Fix 64-bits register writes

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")

---
David,

Can you also queue this one for -stable? Thanks!

 drivers/net/dsa/bcm_sf2.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/dsa/bcm_sf2.h +2 -2
index 22e2ebf31333..789d7b7737da 100644
@@ -112,8 +112,8 @@ static inline u64 name##_readq(struct bcm_sf2_priv *priv, u32 off)	\
 	spin_unlock(&priv->indir_lock);					\
 	return (u64)indir << 32 | dir;					\
 }									\
-static inline void name##_writeq(struct bcm_sf2_priv *priv, u32 off,	\
-							u64 val)	\
+static inline void name##_writeq(struct bcm_sf2_priv *priv, u64 val,	\
+							u32 off)	\
 {									\
 	spin_lock(&priv->indir_lock);					\
 	reg_writel(priv, upper_32_bits(val), REG_DIR_DATA_WRITE);	\
Signature · 1 line
2.1.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Florian Fainelli

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")
maintainer
#2 lore raw
In reply to Florian Fainelli

From: Florian Fainelli <[email protected]>
Date: Tue, 8 Sep 2015 20:06:41 -0700

Quoted 11 lines

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")

---
David,

Can you also queue this one for -stable? Thanks!

Applied and queued up for -stable, thanks.