Re: [PATCH v2] net: phy: air_en8811h: add AN8811HB MCU assert/deassert support

From: Lucien.Jheng

Date: Sun Mar 29 2026 - 01:10:05 EST



Andrew Lunn 於 2026/3/28 下午 10:15 寫道:
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

Thank you for your feedback

I will implement the helper you suggested for this in the next iteration.