lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <MN2PR11MB3662BEB7C0E1E92D37A2FC97FA4E0@MN2PR11MB3662.namprd11.prod.outlook.com>
Date:   Fri, 31 Jul 2020 15:09:54 +0000
From:   <Bryan.Whitehead@...rochip.com>
To:     <f.fainelli@...il.com>, <davem@...emloft.net>
CC:     <netdev@...r.kernel.org>, <UNGLinuxDriver@...rochip.com>,
        <andrew@...n.ch>, <hkallweit1@...il.com>, <linux@...linux.org.uk>
Subject: RE: [PATCH v2 net-next] mscc: Add LCPLL Reset to VSC8574 Family of
 phy drivers

Thanks David and Florian, see below.

> On 7/30/20 4:36 PM, David Miller wrote:
> > From: Bryan Whitehead <Bryan.Whitehead@...rochip.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ