Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1599640

[RESEND PATCH -net] cpsw/netcp: work around reverse cpts dependency

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject [RESEND PATCH -net] cpsw/netcp: work around reverse cpts dependency
Date Mon, 13 Mar 2017 18:10:03 +0100
Message-ID <tkBDR-3Ed-23@gated-at.bofh.it> (permalink)
X-Mailer git-send-email 2.9.0
X-Provags-ID V03:K0:gthDyEUrnALnA4LGhB6AyGl3LNPIdoFGdzxxmwon+AaCdZZTp0w 3yTy3DgesqUUIqRWZXBUtfh6oSxTot7Y96WQpBT18qWSoR4UaLWRK/sBeaIjBnJ1FvPLy4t 7veDp2c9N92vnNJznG0Mnn5+maHej3KhHq+pTpy7Ops2sVEnHb61B2l7M2ngPFIW52XjWhE 8ReixOxcfiW++xDO5Sv8A==
X-Ui-Out-Filterresults notjunk:1;V01:K0:BGQgpwyTxos=:EwwLAZgzP8v02gmkyMoW1g UzDwn5pr+XW/BhF5ereXBhP6mAL8h1GdPJymwTNcQWWmhXn2sRncx6OTh1wqFOhgfDy1T0A6/ jHaN/7/sfMC5wpCeslqxVzru5uh8+AKL3Am2V8k9FI0sZt1jWf/8FYNv6X/+pGBIW0fumGH5t SPdLyPOvLMBTVr30WbuDe8ypZQ7c3+Ja+HRU033FMIIrNp7Il+Q2JDSfyt8ALbxj/4CImRREJ xw4Yl26w1/fw72i/YlhWtWKsL9JKG+q+mlswWGDLZyZ0JpPYjRS0hhvjVkxdTsOZSO/ieEg9A Dsj+2KpeN8w5nVyqNl1kA2snAYix9FQpo1jpnr9TVgT8sBRFTIkBJ8kDPynHiBAtuCLPh43Zx eVYuD4X6VcmyFZDB7q6LNg4brox0sUa4Dzd8Ijufc2WZX+zyXsUkWckt0UiY008YVfFGamp67 3HbnUEHtfzwkBGgM+sgmf/hJKnbaqiFXi+ItjT6pfNstrjQSSm3gpvdxbREAXDq1a8t1L4JNm 7vIpIPWXBkGC8h4YRNbaqRsOC06Tem7vA61X9YuGl28/Jeq7fEnDn9o8A74TuI7CK5tnw6v1r EwUHuk+gJ1p1bGVey47Nj+gokHn1Vo8QrlE8QXEP0km+Zhvd5iSqvJ4rDR29oZ44wXp8WCOKP QLLDrv1jCYHGDKfBaEJXET30CsLjn+Bj1SzJjYqL4D8KTZXJ4ZkloT59mvY67XU8ssnk=
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 55
Organization linux.* mail to news gateway
X-Original-Cc Arnd Bergmann <arnd@arndb.de>, Grygorii Strashko <grygorii.strashko@ti.com>, Thomas Gleixner <tglx@linutronix.de>, Richard Cochran <richardcochran@gmail.com>, WingMan Kwok <w-kwok2@ti.com>, Nicolas Pitre <nicolas.pitre@linaro.org>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Mon, 13 Mar 2017 17:59:04 +0100
X-Original-Message-ID <20170313165927.1389014-1-arnd@arndb.de>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1599640

Show key headers only | View raw


The dependency is reversed: cpsw and netcp call into cpts,
but cpts depends on the other two in Kconfig. This can lead
to cpts being a loadable module and its callers built-in:

drivers/net/ethernet/ti/cpsw.o: In function `cpsw_remove':
cpsw.c:(.text.cpsw_remove+0xd0): undefined reference to `cpts_release'
drivers/net/ethernet/ti/cpsw.o: In function `cpsw_rx_handler':
cpsw.c:(.text.cpsw_rx_handler+0x2dc): undefined reference to `cpts_rx_timestamp'
drivers/net/ethernet/ti/cpsw.o: In function `cpsw_tx_handler':
cpsw.c:(.text.cpsw_tx_handler+0x7c): undefined reference to `cpts_tx_timestamp'
drivers/net/ethernet/ti/cpsw.o: In function `cpsw_ndo_stop':

As a workaround, I'm introducing another Kconfig symbol to
control the compilation of cpts, while making the actual
module controlled by a silent symbol that is =y when necessary.

Fixes: 6246168b4a38 ("net: ethernet: ti: netcp: add support of cpts")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
Originally submitted on Dec 16, still needed for v4.10 and v4.11-rc2
---
 drivers/net/ethernet/ti/Kconfig | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
index 296c8efd0038..d42257fbe9d9 100644
--- a/drivers/net/ethernet/ti/Kconfig
+++ b/drivers/net/ethernet/ti/Kconfig
@@ -73,8 +73,8 @@ config TI_CPSW
 	  To compile this driver as a module, choose M here: the module
 	  will be called cpsw.
 
-config TI_CPTS
-	tristate "TI Common Platform Time Sync (CPTS) Support"
+config TI_CPTS_ENABLE
+	bool "TI Common Platform Time Sync (CPTS) Support"
 	depends on TI_CPSW || TI_KEYSTONE_NETCP
 	imply PTP_1588_CLOCK
 	---help---
@@ -83,6 +83,12 @@ config TI_CPTS
 	  The unit can time stamp PTP UDP/IPv4 and Layer 2 packets, and the
 	  driver offers a PTP Hardware Clock.
 
+config TI_CPTS
+	tristate
+	depends on TI_CPTS_ENABLE
+	default y if TI_CPSW=y || TI_KEYSTONE_NETCP=y
+	default m
+
 config TI_KEYSTONE_NETCP
 	tristate "TI Keystone NETCP Core Support"
 	select TI_CPSW_ALE
-- 
2.9.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[RESEND PATCH -net] cpsw/netcp: work around reverse cpts dependency Arnd Bergmann <arnd@arndb.de> - 2017-03-13 18:10 +0100
  Re: [RESEND PATCH -net] cpsw/netcp: work around reverse cpts  dependency David Miller <davem@davemloft.net> - 2017-03-17 04:20 +0100
    Re: [RESEND PATCH -net] cpsw/netcp: work around reverse cpts dependency Arnd Bergmann <arnd@arndb.de> - 2017-03-17 11:20 +0100

csiph-web