Re: [PATCH net-next v2 3/3] net: phy: mediatek: add driver for built-in 2.5G ethernet PHY on MT7988
From: Andrew Lunn
Date: Wed Feb 19 2025 - 10:17:24 EST
On Wed, Feb 19, 2025 at 09:33:44AM +0000, Russell King (Oracle) wrote:
> On Wed, Feb 19, 2025 at 04:39:10PM +0800, Sky Huang wrote:
> > +static int mt798x_2p5ge_phy_config_init(struct phy_device *phydev)
> > +{
> > + struct pinctrl *pinctrl;
> > + int ret;
> > +
> > + /* Check if PHY interface type is compatible */
> > + if (phydev->interface != PHY_INTERFACE_MODE_INTERNAL)
> > + return -ENODEV;
> > +
> > + ret = mt798x_2p5ge_phy_load_fw(phydev);
> > + if (ret < 0)
> > + return ret;
>
> Firmware should not be loaded in the .config_init method. The above
> call will block while holding the RTNL which will prevent all other
> network configuration until the firmware has been loaded or the load
> fails.
The aquantia and qt2025 drivers are good examples to copy.
Andrew