On Mon, Jun 03, 2024 at 10:03:54AM +0100, Russell King (Oracle) wrote: > On Mon, Jun 03, 2024 at 11:54:22AM +0300, Serge Semin wrote: > > > if (priv->plat->pcs_init) { > > > ret = priv->plat->pcs_init(priv); > > > > > + } else if (fwnode_property_present(devnode, "pcs-handle")) { > > > + pcsnode = fwnode_find_reference(devnode, "pcs-handle", 0); > > > + xpcs = xpcs_create_fwnode(pcsnode, mode); > > > + fwnode_handle_put(pcsnode); > > > + ret = PTR_ERR_OR_ZERO(xpcs); > > > > Just figured, we might wish to be a bit more portable in the > > "pcs-handle" property semantics implementation seeing there can be at > > least three different PCS attached: > > DW XPCS > > Lynx PCS > > Renesas RZ/N1 MII > > > > Any suggestion of how to distinguish the passed handle? Perhaps > > named-property, phandle argument, by the compatible string or the > > node-name? > > I can't think of a reasonable solution to this at the moment. One > solution could be pushing this down into the platform code to deal > with as an interim solution, via the new .pcs_init() method. > > We could also do that with the current XPCS code, since we know that > only Intel mGBE uses xpcs. This would probably allow us to get rid > of the has_xpcs flag. Basically you suggest to move the entire stmmac_pcs_setup() to the platforms, don't you? The patch 9 of this series indeed could have been converted to just moving the entire PCS-detection loop from stmmac_pcs_setup() to the Intel-specific pcs_init. But IMO some default/generic code would be still useful to preserve in the stmmac_pcs_setup() method. When it comes to the fwnode-based platform we at least could be falling back to the default DW XPCS device registration if no plat_stmmacenet_data::pcs_init() callback was specified and there was the "pcs-handle" property found, especially seeing DW *MAC and DW XPCS are of the same vendor. Based on that I can convert patch 9 of this series to introducing the pcs_init() callback in the Intel mGBE driver, but preserve the semantics of the rest of the series changes. -Serge(y) > > -- > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!