From: Andrew Lunn <andrew@lunn.ch>
To: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
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: Sat, 7 Jan 2023 19:23:59 +0100 [thread overview]
Message-ID: <Y7m4v8nLEc4bVBDf@lunn.ch> (raw)
In-Reply-To: <b15b3867233c7adf33870460ea442ff9a4f6ad41.1673030528.git.piergiorgio.beruto@gmail.com>
> +++ 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.
> 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.
> +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?
Andrew
next prev parent reply other threads:[~2023-01-07 18:24 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 [this message]
2023-01-08 23:57 ` Piergiorgio Beruto
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=Y7m4v8nLEc4bVBDf@lunn.ch \
--to=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=piergiorgio.beruto@gmail.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