Re: [PATCH net-next v3 1/1] phy: micrel: add Signal Quality Indicator (SQI) support for KSZ9477 switch PHYs
From: Oleksij Rempel
Date: Fri Jun 27 2025 - 11:46:08 EST
On Fri, Jun 27, 2025 at 01:25:39PM +0200, Oleksij Rempel wrote:
> Add support for the Signal Quality Indicator (SQI) feature on KSZ9477
> family switches, providing a relative measure of receive signal quality.
>
> The hardware exposes separate SQI readings per channel. For 1000BASE-T,
> all four channels are read. For 100BASE-TX, only one channel is reported,
> but which receive pair is active depends on Auto MDI-X negotiation, which
> is not exposed by the hardware. Therefore, it is not possible to reliably
> map the measured channel to a specific wire pair.
>
> This resolves an earlier discussion about how to handle multi-channel
> SQI. Originally, the plan was to expose all channels individually.
> However, since pair mapping is sometimes unavailable, this
> implementation treats SQI as a per-link metric instead. This fallback
> avoids ambiguity and ensures consistent behavior. The existing get_sqi()
> UAPI was designed for single-pair Ethernet (SPE), where per-pair and
> per-link are effectively equivalent. Restricting its use to per-link
> metrics does not introduce regressions for existing users.
>
> The raw 7-bit SQI value (0–127, lower is better) is converted to the
> standard 0–7 (high is better) scale. Empirical testing showed that the
> link becomes unstable around a raw value of 8.
>
> The SQI raw value remains zero if no data is received, even if noise is
> present. This confirms that the measurement reflects the "quality" during
> active data reception rather than the passive line state. User space
> must ensure that traffic is present on the link to obtain valid SQI
> readings.
Update for this statement: it is valid only if EEE is active. With
disabled EEE, SQI provide correct value even if no data is transferred.
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |