Re: [PATCH net-next] net: mdio: add fwnode compatible matching to mdio_bus_match()

From: Andrew Lunn

Date: Mon Mar 02 2026 - 10:38:46 EST


On Mon, Mar 02, 2026 at 10:10:59AM -0500, Serapheim Dimitropoulos via B4 Relay wrote:
> From: Serapheim Dimitropoulos <sdimitropoulos@xxxxxxxxxxxxx>
>
> The MDIO bus match function currently only supports Device Tree
> (of_driver_match_device) and PHY-ID-based matching (bus_match callback).
> This means MDIO drivers that rely on compatible-string matching, such as
> the mv88e6xxx DSA switch driver, cannot bind on systems that describe
> hardware topology via firmware nodes (fwnode/software nodes) rather than
> Device Tree.
>
> This is a problem for x86/ACPI platforms where MDIO buses are created
> dynamically (e.g., USB-to-MDIO bridges) and have no Device Tree
> representation. On these systems, kernel modules or ACPI tables can
> describe the MDIO device topology using software nodes with a
> "compatible" property, but mdio_bus_match() never checks it.
>
> Add a fallback matching path that iterates the driver's of_match_table
> and checks each compatible string against the device's fwnode using the
> existing device_is_compatible() helper. This is placed after the OF
> match (which handles DT natively) and before the bus_match callback
> (which handles PHY-ID matching), so existing match behavior is
> unchanged.
>
> This enables DSA switch drivers like mv88e6xxx to bind on x86 systems
> where the switch topology is described via software nodes or ACPI,
> closing a gap in MDIO bus support for non-DT platforms.

Please make this patch part of a full series adding support for your
board. I presume you have something in drivers/platform? Or maybe
drivers/net/usb or drivers/net/mdio? I would like to see how this is
used.

I should also not that mv88e6xxx supports platform data. That is how
the x86 platforms i've seen do it.

Andrew

---
pw-bot: cr