linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	mailhol.vincent@wanadoo.fr, sudheer.mogilappagari@intel.com,
	sbhatta@marvell.com, linux-doc@vger.kernel.org,
	wangjie125@huawei.com, corbet@lwn.net, lkp@intel.com,
	gal@nvidia.com, gustavoars@kernel.org
Subject: Re: [PATCH v2 net-next 5/5] drivers/net/phy: add driver for the onsemi NCN26000 10BASE-T1S PHY
Date: Mon, 9 Jan 2023 00:57:03 +0100	[thread overview]
Message-ID: <Y7tYT8lkgCugZ7kP@gvm01> (raw)
In-Reply-To: <Y7m4v8nLEc4bVBDf@lunn.ch>

On Sat, Jan 07, 2023 at 07:23:59PM +0100, Andrew Lunn wrote:
> > +++ b/drivers/net/phy/Kconfig
> > @@ -264,6 +264,13 @@ config NATIONAL_PHY
> >  	help
> >  	  Currently supports the DP83865 PHY.
> >  
> > +config NCN26000_PHY
> > +	tristate "onsemi 10BASE-T1S Ethernet PHY"
> > +	help
> > +	  Adds support for the onsemi 10BASE-T1S Ethernet PHY.
> > +	  Currently supports the NCN26000 10BASE-T1S Industrial PHY
> > +	  with MII interface.
> > +
> >  config NXP_C45_TJA11XX_PHY
> >  	tristate "NXP C45 TJA11XX PHYs"
> 
> These are actually sorted by the tristate string, which is what you
> see when you use
> 
> make menuconfig
> 
> So 'onsemi' should be after 'NXP TJA11xx PHYs support'. Also, all the
> other entries capitalise the first word.
As for the order I fixed it. Thanks for noticing.

Regarding the capitalization, I have a little problem here. 'onsemi' is a
brand and according to company rules it MUST be written all in
lowercase. I know we're not obliged to follow any company directive here, but 
as wierd as it might sound, I'd rather keep it lowercase just not to get 
comments later on trying to fix this, if you agree...

> 
> >  	depends on PTP_1588_CLOCK_OPTIONAL
> > diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
> > index f7138d3c896b..b5138066ba04 100644
> > --- a/drivers/net/phy/Makefile
> > +++ b/drivers/net/phy/Makefile
> > @@ -77,6 +77,7 @@ obj-$(CONFIG_MICROCHIP_T1_PHY)	+= microchip_t1.o
> >  obj-$(CONFIG_MICROSEMI_PHY)	+= mscc/
> >  obj-$(CONFIG_MOTORCOMM_PHY)	+= motorcomm.o
> >  obj-$(CONFIG_NATIONAL_PHY)	+= national.o
> > +obj-$(CONFIG_NCN26000_PHY)	+= ncn26000.o
> >  obj-$(CONFIG_NXP_C45_TJA11XX_PHY)	+= nxp-c45-tja11xx.o
> >  obj-$(CONFIG_NXP_TJA11XX_PHY)	+= nxp-tja11xx.o
> >  obj-$(CONFIG_QSEMI_PHY)		+= qsemi.o
> 
> This is sorted by CONFIG_ symbol, so is correct.
> 
> > +
> > +// driver callbacks --------------------------------------------------------- //
> 
> Comments like this don't really add any value.
Sure, I can remove it.
> 
> > +static irqreturn_t ncn26000_handle_interrupt(struct phy_device *phydev)
> > +{
> > +	int ret;
> > +
> > +	// read and aknowledge the IRQ status register
> > +	ret = phy_read(phydev, NCN26000_REG_IRQ_STATUS);
> > +
> > +	// check only link status changes
> > +	if (unlikely(ret < 0) || (ret & NCN26000_REG_IRQ_STATUS) == 0)
> > +		return IRQ_NONE;
> 
> More usage of unlikely(). If this was on the hot path, handling 10M
> frames a second, then maybe unlikley() could be justified. But how
> often do you get PHY interrupts? Once a day?
Right, it is my instinct to use unlikely on any sanity check which is
effectively unlikely to happen. But I understand it is not needed here.

> 
>       Andrew

  reply	other threads:[~2023-01-08 23:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06 18:43 [PATCH v2 net-next 0/5] add PLCA RS support and onsemi NCN26000 Piergiorgio Beruto
2023-01-06 18:44 ` [PATCH v2 net-next 1/5] net/ethtool: add netlink interface for the PLCA RS Piergiorgio Beruto
2023-01-07 17:29   ` Andrew Lunn
2023-01-06 18:44 ` [PATCH v2 net-next 2/5] drivers/net/phy: add the link modes for the 10BASE-T1S Ethernet PHY Piergiorgio Beruto
2023-01-07 17:31   ` Andrew Lunn
2023-01-06 18:45 ` [PATCH v2 net-next 3/5] drivers/net/phy: add connection between ethtool and phylib for PLCA Piergiorgio Beruto
2023-01-07 17:37   ` Andrew Lunn
2023-01-08 23:48     ` Piergiorgio Beruto
2023-01-06 18:45 ` [PATCH v2 net-next 4/5] drivers/net/phy: add helpers to get/set PLCA configuration Piergiorgio Beruto
2023-01-07 18:07   ` Andrew Lunn
2023-01-08 23:50     ` Piergiorgio Beruto
2023-01-06 18:45 ` [PATCH v2 net-next 5/5] drivers/net/phy: add driver for the onsemi NCN26000 10BASE-T1S PHY Piergiorgio Beruto
2023-01-07 18:23   ` Andrew Lunn
2023-01-08 23:57     ` Piergiorgio Beruto [this message]
2023-01-09 13:31       ` Andrew Lunn
2023-01-09 14:21         ` Piergiorgio Beruto
2023-01-09 14:24           ` Andrew Lunn
2023-01-09 17:12             ` Piergiorgio Beruto

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=Y7tYT8lkgCugZ7kP@gvm01 \
    --to=piergiorgio.beruto@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=gustavoars@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lkp@intel.com \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sudheer.mogilappagari@intel.com \
    --cc=wangjie125@huawei.com \
    /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).