net: dsa: qca8k: add a QCA8337 CPU PHY consumer
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest3 patches 5 repliesIn review
- v3 RFC5 patches 14 repliesSuperseded
- v2 RFC5 patches 9 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 RFC | 1 patch | 1 reply | Superseded |
Changes in v4 from the cover letter
- Dropped v3 patches 4/5 and 5/5, which disabled SmartSpeed on internal CPU PHYs, and did not add the DT workaround property discussed in the v3 4/5 thread. The lost 1000BASE-T advertisement on the RA74 CPU link came from the IPQ5018 GE PHY's initialization order, not from the QCA8337. The IPQ5018 driver writes its analog settings (LDO, EEE, MSE, DAC) only in config_init() when the MAC attaches, about 38 s after PHY4 starts autonegotiating. Until then the IPQ5018 PHY negotiates with its reset defaults, 1000BASE-T does not come up, and SmartSpeed on both sides drops the 1000BASE-T advertisement. Nothing restores it on PHY4. On RA74, applying the settings at probe brought the CPU link up at 1 Gb/s with SmartSpeed left enabled. That fix is a separate net series:
net: phy: qcom: at803x: Fix IPQ5018 short-cable DAC values
net: phy: qcom: at803x: Apply IPQ5018 analog settings at probe
<https://lore.kernel.org/netdev/[email protected]/>
- Patch 1: removed the SmartSpeed reference from the commit message. The code is unchanged, so I kept Florian's Reviewed-by.
- Patch 3: the commit message no longer refers to an RFC. Internal CPU port selection is still limited to QCA8337; QCA8327 support has not been established. The code is unchanged.
- Patch 2 is unchanged.
- Posted as a regular patch series instead of an RFC.
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | net: dsa: pass PHY flags when connecting shared portsDocumentation/ drivers/ drivers/ +1 more | +15 | 0 replies | |
| 2/3 | net: dsa: qca8k: serialize CPU MAC pause during MTU changesdrivers/ drivers/ | +66 | 3 replies | |
| 3/3 | net: dsa: qca8k: support QCA8337 internal PHY CPU linksdrivers/ | +13 | 2 replies |
Reviews trailers per patch
1 of 3 patches has a Reviewed-by or Acked-by.
| Patch | Florian Fainelli |
|---|---|
| 1/3 | R-b |
| 2/3 | |
| 3/3 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net-next v4 0/3] net: dsa: qca8k: add a QCA8337 CPU PHY consumer
This series lets a QCA8337 use one of its internal PHYs (ports 1-5) as the CPU port, with a PHY-to-PHY connection to the SoC's own PHY.
Patch 1 makes DSA pass get_phy_flags() to PHYs on CPU and DSA ports, so that the internal CPU PHY receives the switch revision and gets the same revision-specific initialization as the user ports. Patch 2 pauses internal CPU ports as well as ports 0 and 6 during MTU changes and serializes that sequence with reg_mutex. Patch 3 accepts an internal PHY as the CPU port on QCA8337.
Changes since v3:
- Dropped v3 patches 4/5 and 5/5, which disabled SmartSpeed on internal CPU PHYs, and did not add the DT workaround property discussed in the v3 4/5 thread. The lost 1000BASE-T advertisement on the RA74 CPU link came from the IPQ5018 GE PHY's initialization order, not from the QCA8337. The IPQ5018 driver writes its analog settings (LDO, EEE, MSE, DAC) only in config_init() when the MAC attaches, about 38 s after PHY4 starts autonegotiating. Until then the IPQ5018 PHY negotiates with its reset defaults, 1000BASE-T does not come up, and SmartSpeed on both sides drops the 1000BASE-T advertisement. Nothing restores it on PHY4. On RA74, applying the settings at probe brought the CPU link up at 1 Gb/s with SmartSpeed left enabled. That fix is a separate net series:
net: phy: qcom: at803x: Fix IPQ5018 short-cable DAC values
net: phy: qcom: at803x: Apply IPQ5018 analog settings at probe
<https://lore.kernel.org/netdev/[email protected]/>
- Patch 1: removed the SmartSpeed reference from the commit message. The code is unchanged, so I kept Florian's Reviewed-by.
- Patch 3: the commit message no longer refers to an RFC. Internal CPU port selection is still limited to QCA8337; QCA8327 support has not been established. The code is unchanged.
- Patch 2 is unchanged.
- Posted as a regular patch series instead of an RFC.
Dependencies:
This series depends on the net series "[PATCH net v2 0/3] net: dsa:
qca8k: fix MDIO error handling" <https://lore.kernel.org/netdev/[email protected]/>. It applies to net-next without that series, but patch 2 aborts and restores the
paused ports only when register writes report MDIO failures, which
needs its first patch. Please take the net series first.
Brandon Mahdavi's multi-CPU RFC v2 [1] also replaces qca8k_find_cpu_port() and restricts CPU ports to 0 and 6. It is not merged. Whichever series lands second will need to handle the other's CPU port selection.
Testing:
Each patch builds with W=1 for arm64 (drivers/net/dsa/qca, net/dsa, drivers/net/phy/qcom, bcm_sf2, microchip) on the net-next base below with the MDIO series, and checkpatch --strict is clean apart from sign-offs.
The MTU/pause model test from v3 passes on patch 2 on top of the MDIO series. A model test of patch 3 checks CPU port selection for every CPU port mask on QCA8337 and QCA8327, and which ports count for the MDIO bus choice. The code of all three patches is unchanged from v3.
On hardware, a Redmi AX5400 (IPQ5018 GE PHY to QCA8337 PHY4 as the CPU port, plus port 6 as a second CPU port) was tested on OpenWrt's Linux 6.18.52 with a backport of all three patches, the MDIO series and the at803x fixes, and no SmartSpeed change. OpenWrt's multi-CPU patches stay on top and remove qca8k_find_cpu_port(), so on this board patch 3 only contributes its MDIO scope change; its CPU port fallback is covered by the model test only. The CPU link was verified at 1 Gb/s with SmartSpeed enabled after a first boot, three reboots, a power-off cold boot, three interface down/up cycles, three renegotiations and a network restart. During a separate 10-minute observation, sampled link status remained at 1 Gb/s with SmartSpeed enabled and no new CPU PHY link-down events were logged. Raising a user port MTU to 1504 and back exercises patch 2's pause sequence. After each change, WAN HTTPS through CPU port 5 and SSH through CPU port 6 worked. Packet loss during the changes was not measured. An MTU above the maximum was rejected. The switch registers are not readable on that image, so MAX_FRAME_SIZE and the MAC enable bits were not checked directly. There is no net-next boot on this board, as it has no upstream DTS.
Thanks to Andrew Lunn for his detailed reviews of v3 4/5, and to Ziyang Huang for the OpenWrt PHY-to-PHY CPU port code that patch 3 is based on and for pointing me at the IPQ5018 DAC settings.
v3: https://lore.kernel.org/netdev/[email protected]/
v2: https://lore.kernel.org/netdev/[email protected]/
v1: https://lore.kernel.org/netdev/[email protected]/
[1] https://lore.kernel.org/netdev/[email protected]/
Yongzhao Chen (2):
net: dsa: pass PHY flags when connecting shared ports
net: dsa: qca8k: serialize CPU MAC pause during MTU changes
Ziyang Huang (1):
net: dsa: qca8k: support QCA8337 internal PHY CPU links
Documentation/networking/dsa/dsa.rst | 2 + drivers/net/dsa/bcm_sf2.c | 4 ++ drivers/net/dsa/microchip/ksz8.c | 4 ++ drivers/net/dsa/qca/qca8k-8xxx.c | 20 +++++-- drivers/net/dsa/qca/qca8k-common.c | 79 ++++++++++++++++++++++------ net/dsa/port.c | 6 ++- 6 files changed, 94 insertions(+), 21 deletions(-)
base-commit: 014d795c73837ea2339a4ea8e8f82c6e959b845d
prerequisite-patch-id: aad3a7fefa50cc4a8d29711256b182827e5b3bf2
prerequisite-patch-id: 92a623b4a20a1d2d516476558e3904d7a1c17b8f
prerequisite-patch-id: 2819bb7310717899a1fb577b9f4c71a6443a4340
Signature · 1 line
2.43.0