netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Bryan.Whitehead@microchip.com>
To: <f.fainelli@gmail.com>, <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <UNGLinuxDriver@microchip.com>,
	<andrew@lunn.ch>, <hkallweit1@gmail.com>, <linux@armlinux.org.uk>
Subject: RE: [PATCH v2 net-next] mscc: Add LCPLL Reset to VSC8574 Family of phy drivers
Date: Fri, 31 Jul 2020 15:09:54 +0000	[thread overview]
Message-ID: <MN2PR11MB3662BEB7C0E1E92D37A2FC97FA4E0@MN2PR11MB3662.namprd11.prod.outlook.com> (raw)
In-Reply-To: <94cacb22-c31d-4cd3-3872-2e431bafb0da@gmail.com>

Thanks David and Florian, see below.

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

      reply	other threads:[~2020-07-31 15:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27 17:18 [PATCH v2 net-next] mscc: Add LCPLL Reset to VSC8574 Family of phy drivers Bryan Whitehead
2020-07-30 23:36 ` David Miller
2020-07-30 23:40   ` Florian Fainelli
2020-07-31 15:09     ` Bryan.Whitehead [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN2PR11MB3662BEB7C0E1E92D37A2FC97FA4E0@MN2PR11MB3662.namprd11.prod.outlook.com \
    --to=bryan.whitehead@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).