Skip to content

Fix broken link with TH1520 GMAC when linkspeed changes

Yao Zi linux-devicetree linux-riscv lkml netdev 3 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyApplied 3/3
  2. v23 patches 10 repliesSuperseded
  3. v13 patches 6 repliesSuperseded

Changes in v3 from the cover letter

- dt-binding: Drop the Tested-by tag
- driver
- Improve the commit message to mention the dt-compatibility problem
- Add a comment about the dt-compatibility problem
- Emit a warning when failed to get APB clock
- Stop using the optional clock-getting API since it doesn't help much when we need to handle the missing case.
- Collect review tags
- Link to v2: https://lore.kernel.org/netdev/[email protected]/

Patches in v3 All 3 applied

#Subject and filesSizeRepliesApplied
1/3dt-bindings: net: thead,th1520-gmac: Describe APB interface clockDocumentation/devicetree/bindings/net/thead,th1520-gmac.yaml+4 -20 repliesApplied
2/3net: stmmac: thead: Get and enable APB clock on initializationdrivers/net/ethernet/stmicro/stmmac/dwmac-thead.c+14 -01 replyApplied
3/3riscv: dts: thead: Add APB clocks for TH1520 GMACsarch/riscv/boot/dts/thead/th1520.dtsi+6 -40 repliesApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchKrzysztof KozlowskiDrew Fustini
1/3A-b R-b
2/3T-b R-b
3/3R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net v3 0/3] Fix broken link with TH1520 GMAC when linkspeed changes

It's noted that on TH1520 SoC, the GMAC's link becomes broken after the link speed is changed (for example, running ethtool -s eth0 speed 100 on the peer when negotiated to 1Gbps), but the GMAC could function normally if the speed is brought back to the initial.

Just like many other SoCs utilizing STMMAC IP, we need to adjust the TX clock supplying TH1520's GMAC through some SoC-specific glue registers when linkspeed changes. But it's found that after the full kernel startup, reading from them results in garbage and writing to them makes no effect, which is the cause of broken link.

Further testing shows perisys-apb4-hclk must be ungated for normal access to Th1520 GMAC APB glue registers, which is neither described in dt-binding nor acquired by the driver.

This series expands the dt-binding of TH1520's GMAC to allow an extra "APB glue registers interface clock", instructs the driver to acquire and enable the clock, and finally supplies CLK_PERISYS_APB4_HCLK for TH1520's GMACs in SoC devicetree.

Changed from v2
- dt-binding: Drop the Tested-by tag
- driver
- Improve the commit message to mention the dt-compatibility problem
- Add a comment about the dt-compatibility problem
- Emit a warning when failed to get APB clock
- Stop using the optional clock-getting API since it doesn't help much when we need to handle the missing case.
- Collect review tags
- Link to v2: https://lore.kernel.org/netdev/[email protected]/

Changed from v1
- Make apb clock essential in dt-binding
- Collect review tags
- Link to v1: https://lore.kernel.org/all/[email protected]/

Yao Zi (3):
dt-bindings: net: thead,th1520-gmac: Describe APB interface clock
net: stmmac: thead: Get and enable APB clock on initialization
riscv: dts: thead: Add APB clocks for TH1520 GMACs

 .../devicetree/bindings/net/thead,th1520-gmac.yaml |  6 ++++--
 arch/riscv/boot/dts/thead/th1520.dtsi              | 10 ++++++----
 drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c  | 14 ++++++++++++++
 3 files changed, 24 insertions(+), 6 deletions(-)
Signature · 1 line
2.50.1