[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220611213355.q4gtcglc5j3kmdek@bsd-mbp.dhcp.thefacebook.com>
Date: Sat, 11 Jun 2022 14:33:55 -0700
From: Jonathan Lemon <jonathan.lemon@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, kernel-team@...com,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Richard Cochran <richardcochran@...il.com>,
Lasse Johnsen <l@...johnsen.me>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>
Subject: Re: [PATCH net-next v6 2/3] net: phy: broadcom: Add PTP support for
some Broadcom PHYs.
On Fri, Jun 10, 2022 at 06:02:55PM -0700, Jakub Kicinski wrote:
> On Wed, 8 Jun 2022 13:44:50 -0700 Jonathan Lemon wrote:
> > +config BCM_NET_PHYPTP
> > + tristate "Broadcom PHY PTP support"
> > + depends on NETWORK_PHY_TIMESTAMPING
> > + depends on PHYLIB
> > + depends on PTP_1588_CLOCK
> > + depends on BROADCOM_PHY
> > + depends on NET_PTP_CLASSIFY
> > + help
> > + Supports PTP timestamping for certain Broadcom PHYs.
>
> This will not prevent:
>
> CONFIG_BCM_NET_PHYLIB=y
> CONFIG_BCM_NET_PHYPTP=m
>
> which fails to link:
>
> ld: vmlinux.o: in function `bcm54xx_phy_probe':
> broadcom.c:(.text+0x155dd6a): undefined reference to `bcm_ptp_probe'
> ld: vmlinux.o: in function `bcm54xx_suspend':
> broadcom.c:(.text+0x155e203): undefined reference to `bcm_ptp_stop'
> ld: vmlinux.o: in function `bcm54xx_config_init':
> broadcom.c:(.text+0x155e8a6): undefined reference to `bcm_ptp_config_init'
>
> Can we always build PTP support in when NETWORK_PHY_TIMESTAMPING is
> selected? Without adding an extra Kconfig, do:
>
> +ifeq ($(CONFIG_NETWORK_PHY_TIMESTAMPING),)
> obj-$(CONFIG_BCM_NET_PHYLIB) += bcm-phy-lib.o
> +else
> +obj-$(CONFIG_BCM_NET_PHYLIB) += bcm-phy-lib.o bcm-phy-ptp.o
> +endif
>
> or some form thereof ?
How about this? Seems to work for my testing. If this is ok, I'll
spin up (hopefully the last) patch on Monday.
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 9fee639ee5c8..2f299ef26a27 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -104,6 +104,7 @@ config AX88796B_PHY
config BROADCOM_PHY
tristate "Broadcom 54XX PHYs"
select BCM_NET_PHYLIB
+ select BCM_NET_PHYPTP if NETWORK_PHY_TIMESTAMPING
help
Currently supports the BCM5411, BCM5421, BCM5461, BCM54616S, BCM5464,
BCM5481, BCM54810 and BCM5482 PHYs.
@@ -160,6 +161,10 @@ config BCM_CYGNUS_PHY
config BCM_NET_PHYLIB
tristate
+config BCM_NET_PHYPTP
+ tristate
+ depends on PTP_1588_CLOCK_OPTIONAL
+
config CICADA_PHY
tristate "Cicada PHYs"
help
Powered by blists - more mailing lists