Re: [PATCH net-next] net: sfp: add quirk for XikeStor SKT-2.5G-100M
From: Andrew Lunn
Date: Tue Sep 22 2026 - 16:22:28 EST
> If bit 0 of register 0x75f3 on MMD 30 is set, reading any register on MMD 30
> except for the actual SerDes registers (and also registers 5/6) breaks the
> PHY.
[Goes and looks at 802.3, clause 45]
> I would really like to have a general fix for cases where neither of these
> two workarounds happen to already be in place. But I'm not sure how this
> could be done cleanly, as it requires special handling for these PHYs in the
> function that reads the PHY ID (or even before that).
I assume this PHY does have a valid ID in MMD 1-29?
> Downstream in OpenWrt, I added a patch for "get_phy_c45_ids" to avoid
> reading MMD 30 from RTL8221B PHYs based on the PHY ID in MMD 1:
This suggests it does.
I wounder if we can make use of:
if ((devs_in_pkg & 0x1fffffff) == 0x1fffffff) {
/* If mostly Fs, there is no device there, then let's probe
* MMD 0, as some 10G PHYs have zero Devices In package,
* e.g. Cortina CS4315/CS4340 PHY.
*/
phy_reg = get_phy_c45_devs_in_pkg(bus, addr, 0, &devs_in_pkg);
if (phy_reg < 0)
return -EIO;
/* no device there, let's get out of here */
if ((devs_in_pkg & 0x1fffffff) == 0x1fffffff)
return -ENODEV;
}
I assume this is not hit for this device?
I _guess_ there are ~0 PHYs which probe based on ID values in
MDIO_MMD_VEND1 or MDIO_MMD_VEND2. So maybe move the code looking for
device present in MDIO_MMD_VEND1 or MDIO_MMD_VEND2 inside this clause?
Then in the normal case we never look in these registers.
If we don't look to see if the MDIO_MMD_VEND1 or MDIO_MMD_VEND2
devices are present, i assume the next loop:
/* Now probe Device Identifiers for each device present. */
for (i = 1; i < num_ids; i++) {
if (!(devs_in_pkg & (1 << i)))
continue;
will also leave them alone?
But if there is an oddball PHY around which relies on MDIO_MMD_VEND1
or MDIO_MMD_VEND2 IDs, we still look there, if we failed to find
anything anywhere else, and so hopefully it does not cause a
regression?
Andrew