Re: [PATCH v2] net: phy: air_en8811h: add AN8811HB MCU assert/deassert support
From: Andrew Lunn
Date: Sat Mar 28 2026 - 10:16:15 EST
On Sat, Mar 28, 2026 at 10:25:06AM +0000, Russell King (Oracle) wrote:
> On Sat, Mar 28, 2026 at 11:21:59AM +0100, Eric Woudstra wrote:
> > static int air_pbus_reg_write(struct mdio_device *mdio, u32 pbus_address,
> > u32 pbus_data)
> > {
> > int ret;
> >
> > mutex_lock(&mdio->bus->mdio_lock);
>
> I wonder why we have phy_lock_mdio_bus() but not mdio_bus_lock()...
> Should a helper be provided at mdio bus level to complement the PHY
> level helper if we're going to have MDIO drivers directly manipulating
> the lock?
DSA is pretty much the only class of mdio driver. And they mostly need
to use:
mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
Not the plain mutex_lock().
Hence it has not been added up until now.
But yes, such a helper would make sense for a PHY driver having to do
odd things.
Andrew