Re: [PATCH net-next v5 2/4] r8169: hold MDIO bus lock while loading firmware

From: Andrew Lunn

Date: Wed Dec 02 2026 - 21:38:11 EST


> I agree. But most of Realtek nics are single chip, mac and phy are
> highly integrated. Some of the chips share the same PHY ID, but they
> have different mac version which should be applied different
> firmware. In this case, I think firmware here can not be moved into
> PHY driver for the bad design.

We have dealt with bad vendor design before, where ID 2 and 3 are not
sufficient, or not even filled in.

Look at the Marvell mv88e6xxx switch driver. Some generations of its
integrated PHYs have the OUI part, but the model is 0. The data sheet
even says this was intentional!?!?. So the MDIO driver, which knows
the switch ID, traps reads to ID2, and if it finds the ID value is not
reasonable, it replaces it with the ID of the switch. The Marvell PHY
driver then knows what sort of PHY it is dealing with.

Please don't use bad design as an excuse for layering violations.

If there are other design issues, just describe them, and we can
figure out a workaround.

But step by step you need to move all PHY code out of the MAC driver
and into the PHY driver. And i will not accept any new code which
touches PHY registers from the MAC driver.

Andrew