[PATCH net-next v10 0/3] ksz87xx: add support for low-loss cable equalizer errata
From: Fidelio Lawson <hidden>
Date: 2026-06-09 16:20:12
Also in:
lkml
Hello, This patch implements the KSZ87xx short cable erratum described in Microchip document DS80000687C for KSZ87xx switches and the following support article: Link: https://support.microchip.com/s/article/Solution-for-Using-CAT-5E-or-CAT-6-Short-Cable-with-a-Link-Issue-for-the-KSZ8795-Family According to the erratum, the embedded PHY receiver in KSZ87xx switches is tuned by default for long, high-loss Ethernet cables. When operating with short or low-loss cables (for example CAT5e or CAT6), the PHY equalizer may over-amplify the incoming signal, leading to internal distortion and link establishment failures. Microchip documents two independent mechanisms to mitigate this issue: adjusting the receiver low‑pass filter bandwidth and reducing the DSP equalizer initial value. These registers are located in the switch’s internal LinkMD table and cannot be accessed directly through a stand‑alone PHY driver. To keep the PHY‑facing API clean, this series models the erratum handling as vendor‑specific Clause 22 PHY registers, virtualized by the KSZ8 DSA driver. Accesses are intercepted by ksz8_r_phy() / ksz8_w_phy() and translated into the appropriate indirect LinkMD register writes. The erratum affects the shared PHY analog front‑end and therefore applies globally to the switch. Based on review feedback, the user‑visible interface is kept deliberately simple and predictable: - A boolean “short‑cable” PHY tunable applies a documented and conservative preset (LPF bandwidth 62MHz, DSP EQ initial value 0). This is the recommended KISS interface for the common short‑cable scenario. - Two additional integer PHY tunables allow advanced or experimental tuning of the LPF bandwidth and the DSP EQ initial value. These controls are orthogonal, have no ordering requirements, and simply override the corresponding setting when written. The tunables act as simple setters with no implicit state machine or invalid combinations, avoiding surprises for userspace and not relying on extended error reporting or netlink ethtool support. This series contains: 1. Support for the KSZ87xx low‑loss cable erratum in the KSZ8 DSA driver, including the short‑cable preset and orthogonal tuning controls. 2. Addition of vendor‑specific PHY tunable identifiers for the short‑cable preset, LPF bandwidth, and DSP EQ initial value. 3. Exposure of these tunables through the Micrel PHY driver via get_tunable / set_tunable callbacks. This version follows the design agreed upon during v3 review and reworks the interface accordingly. This series is based on net-next. Signed-off-by: Fidelio Lawson <redacted> --- Changes in v10: - Switch PHY tunables from u8 to u32, as they are part of the global UAPI - Link to v9: https://patch.msgid.link/20260601-ksz87xx_errata_low_loss_connections-v9-0-fdbbb15592cb@exotec.com Changes in v9: - Drop incorrect Fixes tag - Fix typo in comment - Link to v8: https://patch.msgid.link/20260601-ksz87xx_errata_low_loss_connections-v8-0-cfa102cf62c0@exotec.com Changes in v8: - Clarify LPF/DSP EQ register definitions based on Microchip support article - Make short-cable preset reversible by restoring default settings when disabled - Link to v7: https://patch.msgid.link/20260524-ksz87xx_errata_low_loss_connections-v7-0-1cd49cfa24f0@exotec.com Changes in v7: - Rebased on net-next/main - Link to v6: https://patch.msgid.link/20260520-ksz87xx_errata_low_loss_connections-v6-0-43f33d4aaf0f@exotec.com Changes in v6: - Nitpicks corrections - Link to v5: https://patch.msgid.link/20260505-ksz87xx_errata_low_loss_connections-v5-0-da4002b21c42@exotec.com Changes in v5: - Added Fixes tag - Added validation to ensure that only the documented bitfields are accepted before writing the registers - Link to v4: https://patch.msgid.link/20260417-ksz87xx_errata_low_loss_connections-v4-0-6c7044ec4363@exotec.com Changes in v4: - Reworked the user‑visible API to a boolean short‑cable preset plus orthogonal advanced tunables, following the KISS principle. - Dropped the previous mode‑selector semantics in favor of simple setters with no ordering requirements - Added persistent tracking of LPF bandwidth and EQ initial value. - Clarified defaults and preset values to match Microchip documentation. - Link to v3: https://patch.msgid.link/20260414-ksz87xx_errata_low_loss_connections-v3-0-0e3838ca98c9@exotec.com Changes in v3: - Exposed all LPF bandwidth values supported by the hardware. - Added phy tunable. - Link to v2: https://patch.msgid.link/20260408-ksz87xx_errata_low_loss_connections-v2-1-9cfe38691713@exotec.com Changes in v2: - Dropped the device tree approach based on review feedback - Modeled the errata control as a vendor-specific Clause 22 PHY register - Added KSZ87xx-specific guards and replaced magic values with named macros - Rebased on Linux v7.0-rc1 - Link to v1: https://patch.msgid.link/20260326-ksz87xx_errata_low_loss_connections-v1-0-79a698f43626@exotec.com To: Woojung Huh <woojung.huh@microchip.com> To: UNGLinuxDriver@microchip.com To: Andrew Lunn <andrew@lunn.ch> To: Vladimir Oltean <olteanv@gmail.com> To: "David S. Miller" <davem@davemloft.net> To: Eric Dumazet <edumazet@google.com> To: Jakub Kicinski <kuba@kernel.org> To: Paolo Abeni <pabeni@redhat.com> To: Marek Vasut <marex@denx.de> To: Tristram Ha <redacted> To: Simon Horman <horms@kernel.org> To: Heiner Kallweit <hkallweit1@gmail.com> To: Russell King <linux@armlinux.org.uk> Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- Fidelio Lawson (3): net: dsa: microchip: implement KSZ87xx Module 3 low-loss cable errata net: ethtool: add KSZ87xx low-loss cable PHY tunables net: phy: micrel: expose KSZ87xx low-loss cable tunables drivers/net/dsa/microchip/ksz8.c | 89 ++++++++++++++++++++++++++++++++++ drivers/net/dsa/microchip/ksz8_reg.h | 23 ++++++++- drivers/net/dsa/microchip/ksz_common.h | 4 ++ drivers/net/phy/micrel.c | 61 +++++++++++++++++++++++ include/uapi/linux/ethtool.h | 3 ++ net/ethtool/common.c | 3 ++ net/ethtool/ioctl.c | 7 +++ 7 files changed, 189 insertions(+), 1 deletion(-) --- base-commit: c2c0486c56800ce276e79c40a6e576ffd672f2a9 change-id: 20260323-ksz87xx_errata_low_loss_connections-b65e76e2b403 Best regards, -- Fidelio Lawson [off-list ref]