net: stmmac: dwmac4: fix PCS duplex mode decode
Subsystems (4)
PATCH v2 1/1 net: stmmac: dwmac4: fix PCS duplex mode decode
dwmac4 was decoding the duplex mode from the GMAC_PHYIF_CONTROL_STATUS register incorrectly, using GMAC_PHYIF_CTRLSTATUS_LNKMOD_MASK (value 1) rather than GMAC_PHYIF_CTRLSTATUS_LNKMOD (bit 16). Fix this.
---
Changes since v1:
- remove GMAC_PHYIF_CTRLSTATUS_LNKMOD_MASK definition
- add reviewed-bys
drivers/net/ethernet/stmicro/stmmac/dwmac4.h | 2 -- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac4.h +0 -2
@@ -573,8 +573,6 @@ static inline u32 mtl_low_credx_base_addr(const struct dwmac4_addrs *addrs,#define GMAC_PHYIF_CTRLSTATUS_LNKSTS BIT(19)#define GMAC_PHYIF_CTRLSTATUS_JABTO BIT(20)#define GMAC_PHYIF_CTRLSTATUS_FALSECARDET BIT(21) -/* LNKMOD */ -#define GMAC_PHYIF_CTRLSTATUS_LNKMOD_MASK 0x1/* LNKSPEED */ #define GMAC_PHYIF_CTRLSTATUS_SPEED_125 0x2#define GMAC_PHYIF_CTRLSTATUS_SPEED_25 0x1
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +1 -1
@@ -786,7 +786,7 @@ static void dwmac4_phystatus(void __iomem *ioaddr, struct stmmac_extra_stats *x)else x->pcs_speed =SPEED_10 ; - x->pcs_duplex = (status &GMAC_PHYIF_CTRLSTATUS_LNKMOD_MASK ); + x->pcs_duplex = (status &GMAC_PHYIF_CTRLSTATUS_LNKMOD );pr_info ("Link is Up - %d/%s\n" , (int )x->pcs_speed, x->pcs_duplex ?"Full" :"Half" );
Signature · 1 line
2.30.2
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Tue, 06 Aug 2024 14:08:41 +0100 you wrote:
dwmac4 was decoding the duplex mode from the
GMAC_PHYIF_CONTROL_STATUSregister incorrectly, usingGMAC_PHYIF_CTRLSTATUS_LNKMOD_MASK(value 1) rather thanGMAC_PHYIF_CTRLSTATUS_LNKMOD(bit 16). Fix this.Fixes 70523e639bf8c ("drivers: net: stmmac: reworking the PCS code.")Reviewed-by Andrew Halaney <[email protected]>Reviewed-by Andrew Lunn <[email protected]>Reviewed-by Serge Semin <[email protected]>Signed-off-by Russell King (Oracle) <[email protected]>[...]
Here is the summary with links:
- [net,v2] net: stmmac: dwmac4: fix PCS duplex mode decode
https://git.kernel.org/netdev/net/c/85ba108a529d
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html