Skip to content

Commit 92db978

Browse files
claymationdavem330
authored andcommitted
net: ethernet: ti: Remove TI_CPTS_MOD workaround
My recent commit b6d49ca ("net: Make PTP-specific drivers depend on PTP_1588_CLOCK") exposes a missing dependency in defconfigs that select TI_CPTS without selecting PTP_1588_CLOCK, leading to linker errors of the form: drivers/net/ethernet/ti/cpsw.o: in function `cpsw_ndo_stop': cpsw.c:(.text+0x680): undefined reference to `cpts_unregister' ... That's because TI_CPTS_MOD (which is the symbol gating the _compilation_ of cpts.c) now depends on PTP_1588_CLOCK, and so is not enabled in these configurations, but TI_CPTS (which is the symbol gating _calls_ to the cpts functions) _is_ enabled. So we end up compiling calls to functions that don't exist, resulting in the linker errors. This patch fixes build errors and restores previous behavior by: - ensure PTP_1588_CLOCK=y in TI specific configs and CPTS will be built - remove TI_CPTS_MOD and, instead, add dependencies from CPTS in TI_CPSW/TI_KEYSTONE_NETCP/TI_CPSW_SWITCHDEV as below: config TI_CPSW_SWITCHDEV ... depends on TI_CPTS || !TI_CPTS which will ensure proper dependencies PTP_1588_CLOCK -> TI_CPTS -> TI_CPSW/TI_KEYSTONE_NETCP/TI_CPSW_SWITCHDEV and build type selection. Note. For NFS boot + CPTS all of above configs have to be built-in. Cc: Arnd Bergmann <[email protected]> Cc: Dan Murphy <[email protected]> Cc: Tony Lindgren <[email protected]> Fixes: b6d49ca ("net: Make PTP-specific drivers depend on PTP_1588_CLOCK") Reported-by: kbuild test robot <[email protected]> Signed-off-by: Clay McClure <[email protected]> [[email protected]: rewording, add deps cpsw/netcp from cpts, drop IS_REACHABLE] Signed-off-by: Grygorii Strashko <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Tested-by: Tony Lindgren <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d6718cc commit 92db978

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

arch/arm/configs/keystone_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ CONFIG_I2C_DAVINCI=y
147147
CONFIG_SPI=y
148148
CONFIG_SPI_DAVINCI=y
149149
CONFIG_SPI_SPIDEV=y
150+
CONFIG_PTP_1588_CLOCK=y
150151
CONFIG_PINCTRL_SINGLE=y
151152
CONFIG_GPIOLIB=y
152153
CONFIG_GPIO_SYSFS=y

arch/arm/configs/omap2plus_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ CONFIG_SPI_TI_QSPI=m
274274
CONFIG_HSI=m
275275
CONFIG_OMAP_SSI=m
276276
CONFIG_SSI_PROTOCOL=m
277+
CONFIG_PTP_1588_CLOCK=y
277278
CONFIG_PINCTRL_SINGLE=y
278279
CONFIG_DEBUG_GPIO=y
279280
CONFIG_GPIO_SYSFS=y

drivers/net/ethernet/ti/Kconfig

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ config TI_CPSW_PHY_SEL
4949
config TI_CPSW
5050
tristate "TI CPSW Switch Support"
5151
depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST
52+
depends on TI_CPTS || !TI_CPTS
5253
select TI_DAVINCI_MDIO
5354
select MFD_SYSCON
5455
select PAGE_POOL
@@ -64,6 +65,7 @@ config TI_CPSW_SWITCHDEV
6465
tristate "TI CPSW Switch Support with switchdev"
6566
depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST
6667
depends on NET_SWITCHDEV
68+
depends on TI_CPTS || !TI_CPTS
6769
select PAGE_POOL
6870
select TI_DAVINCI_MDIO
6971
select MFD_SYSCON
@@ -77,23 +79,16 @@ config TI_CPSW_SWITCHDEV
7779
will be called cpsw_new.
7880

7981
config TI_CPTS
80-
bool "TI Common Platform Time Sync (CPTS) Support"
81-
depends on TI_CPSW || TI_KEYSTONE_NETCP || TI_CPSW_SWITCHDEV || COMPILE_TEST
82+
tristate "TI Common Platform Time Sync (CPTS) Support"
83+
depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || COMPILE_TEST
8284
depends on COMMON_CLK
83-
depends on POSIX_TIMERS
85+
depends on PTP_1588_CLOCK
8486
---help---
8587
This driver supports the Common Platform Time Sync unit of
8688
the CPSW Ethernet Switch and Keystone 2 1g/10g Switch Subsystem.
8789
The unit can time stamp PTP UDP/IPv4 and Layer 2 packets, and the
8890
driver offers a PTP Hardware Clock.
8991

90-
config TI_CPTS_MOD
91-
tristate
92-
depends on TI_CPTS
93-
depends on PTP_1588_CLOCK
94-
default y if TI_CPSW=y || TI_KEYSTONE_NETCP=y || TI_CPSW_SWITCHDEV=y
95-
default m
96-
9792
config TI_K3_AM65_CPSW_NUSS
9893
tristate "TI K3 AM654x/J721E CPSW Ethernet driver"
9994
depends on ARCH_K3 && OF && TI_K3_UDMA_GLUE_LAYER
@@ -114,6 +109,7 @@ config TI_KEYSTONE_NETCP
114109
select TI_DAVINCI_MDIO
115110
depends on OF
116111
depends on KEYSTONE_NAVIGATOR_DMA && KEYSTONE_NAVIGATOR_QMSS
112+
depends on TI_CPTS || !TI_CPTS
117113
---help---
118114
This driver supports TI's Keystone NETCP Core.
119115

drivers/net/ethernet/ti/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ obj-$(CONFIG_TI_DAVINCI_EMAC) += ti_davinci_emac.o
1313
ti_davinci_emac-y := davinci_emac.o davinci_cpdma.o
1414
obj-$(CONFIG_TI_DAVINCI_MDIO) += davinci_mdio.o
1515
obj-$(CONFIG_TI_CPSW_PHY_SEL) += cpsw-phy-sel.o
16-
obj-$(CONFIG_TI_CPTS_MOD) += cpts.o
16+
obj-$(CONFIG_TI_CPTS) += cpts.o
1717
obj-$(CONFIG_TI_CPSW) += ti_cpsw.o
1818
ti_cpsw-y := cpsw.o davinci_cpdma.o cpsw_ale.o cpsw_priv.o cpsw_sl.o cpsw_ethtool.o
1919
obj-$(CONFIG_TI_CPSW_SWITCHDEV) += ti_cpsw_new.o

0 commit comments

Comments
 (0)