Skip to contentSkip to conversation

Subject: [RFC][PATCH 04/11] stmmac: fix breakage in stmmac_hw_setup()

PATCH Al Viro 3 participants 3 messages Jan 5, 2018 – Jan 25, 2018

Subsystems (4)
lore
Share & tools
lore

Al Viro

author
#0 lore raw

Since "drivers: net: stmmac: reworking the PCS code" ->pcs_ctrl_ane() had been taking iomem address to access as the first argument; its predecessor (->ctrl_ane()) used to take struct mac_device_info instead.

One of the callers had not been converted; as the result, instead of reading and modifying a word in card iomem we read and modify a word in (or near) the in-core strucct mac_device_info.

Fixes 70523e639bf8 (drivers: net: stmmac: reworking the PCS code)
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -1
index d9c98fd810bb..68ed903f0ac8 100644
@@ -2571,7 +2571,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
 	}
 
 	if (priv->hw->pcs && priv->hw->mac->pcs_ctrl_ane)
-		priv->hw->mac->pcs_ctrl_ane(priv->hw, 1, priv->hw->ps, 0);
+		priv->hw->mac->pcs_ctrl_ane(priv->ioaddr, 1, priv->hw->ps, 0);
 
 	/* set TX and RX rings length */
 	stmmac_set_rings_length(priv);
Signature · 1 line
2.11.0
maintainer
#1 lore raw

From: Al Viro <[email protected]>
Date: Fri, 05 Jan 2018 19:31:58 +0000

Quoted 11 lines

Since "drivers: net: stmmac: reworking the PCS code" ->pcs_ctrl_ane() had been taking iomem address to access as the first argument; its predecessor (->ctrl_ane()) used to take struct mac_device_info instead.

One of the callers had not been converted; as the result, instead of reading and modifying a word in card iomem we read and modify a word in (or near) the in-core strucct mac_device_info.

Fixes 70523e639bf8 (drivers: net: stmmac: reworking the PCS code)

Yikes...

Al, can you split the bug fixes like this one into a separate series for me to pull into my net GIT tree?

Don't include the pure annotation or partial endianness conversion ones, those should go to net-next.

#2 lore raw
Quoted 11 lines · David Miller

From: Al Viro <[email protected]>
Date: Fri, 05 Jan 2018 19:31:58 +0000

Quoted 8 lines

Since "drivers: net: stmmac: reworking the PCS code" ->pcs_ctrl_ane() had been taking iomem address to access as the first argument; its predecessor (->ctrl_ane()) used to take struct mac_device_info instead.

One of the callers had not been converted; as the result, instead of reading and modifying a word in card iomem we read and modify a word in (or near) the in-core strucct mac_device_info.

Quoted 8 lines
Quoted 3 lines
Fixes 70523e639bf8 (drivers: net: stmmac: reworking the PCS code)

Yikes...

Al, can you split the bug fixes like this one into a separate series for me to pull into my net GIT tree?

This looks like a nasty bug,
I haven't seen a resubmission of this.
Would be a shame if it just went forgotten.

Regards,
Niklas