Thanks David and Florian, see below. > On 7/30/20 4:36 PM, David Miller wrote: > > From: Bryan Whitehead <bryan.whiteh...@microchip.com> > > Date: Mon, 27 Jul 2020 13:18:28 -0400 > > > >> @@ -929,6 +929,77 @@ static bool vsc8574_is_serdes_init(struct > >> phy_device *phydev) } > >> > >> /* bus->mdio_lock should be locked when using this function */ > >> +/* Page should already be set to MSCC_PHY_PAGE_EXTENDED_GPIO */ > >> +static int vsc8574_micro_command(struct phy_device *phydev, u16 > >> +command) > > ... > >> +/* bus->mdio_lock should be locked when using this function */ > > > > Please don't dup this comment, it's not appropriate. > > Agree put a mutex assertion instead if you want to catch offenders at run > time? > -- > Florian
I was simply following the pattern that already exists in the driver. Would you like me to remove the same comment from the rest of the functions in the driver? The lock is already checked in the existing low level functions, phy_base_read, and phy_base_write. The check is of the following form if (unlikely(!mutex_is_locked(&phydev->mdio.bus->mdio_lock))) { dev_err(&phydev->mdio.dev, "MDIO bus lock not held!\n"); dump_stack(); } Is this a reasonable mutex assertion, or is there an existing preferred helper macro that can be used instead? Bryan