[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 5 May 2021 14:06:10 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Ansuel Smith <ansuelsmth@...il.com>
Cc: Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [RFC PATCH net-next v3 20/20] net: phy: add qca8k driver for
qca8k switch internal PHY
On Wed, May 05, 2021 at 03:17:20AM +0200, Ansuel Smith wrote:
> On Wed, May 05, 2021 at 03:11:36AM +0200, Andrew Lunn wrote:
> > > +/* QCA specific MII registers access function */
> > > +static void qca8k_phy_dbg_write(struct mii_bus *bus, int phy_addr, u16 dbg_addr, u16 dbg_data)
> > > +{
> > > + mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED);
> > > + bus->write(bus, phy_addr, MII_ATH_DBG_ADDR, dbg_addr);
> > > + bus->write(bus, phy_addr, MII_ATH_DBG_DATA, dbg_data);
> > > + mutex_unlock(&bus->mdio_lock);
> > > +}
> >
> > What are you locking against here?
> >
> > Andrew
>
> Added the locking if in the future it will be used outside the
> config_init function but since it's used only there, yes, I can drop the
> useless lock.
The PHY core will take the phydev->lock whenever it calls the PHY
driver functions. The only exception to this is suspend/resume. So
long as you only access the devices own addresses on the MDIO bus, you
don't need any additional locks.
Andrew
Powered by blists - more mailing lists