Re: [Patch net-next v2 2/2] net: phy: Add driver for Motorcomm Quad 2.5GbE phy

From: Andrew Lunn

Date: Thu Jul 16 2026 - 12:49:39 EST


> +static inline int ytphy_top_write(struct phy_device *phydev, u32 regnum,
> + u16 val)


No inline functions in .C files. And this is a PHY driver, it is a
long way from the hot path, optimisations are not needed.

As i said elsewhere, please look at phy_package.c. It might result in
better code, and a more obvious locking model.

> +/**
> + * ytphy_read_top_ext() - read a PHY's top extended register for YT8824
> + * @phydev: a pointer to a &struct phy_device
> + * @regnum: register number to read
> + *
> + * NOTE:The caller must have taken the MDIO bus lock.

Rather that have this comment, use lockdep_assert_held() to prove it
has been taken.

Maybe add a phy_assert_lock_mdio_bus(struct phy_device *phydev) next
to phy_lock_mdio_bus() and phy_unlock_mdio_bus(), to hide away all the
pointer following.


Andrew

---
pw-bot: cr