From patchwork Mon Mar 13 16:59:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 738297 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vhklc54vLz9s0m for ; Tue, 14 Mar 2017 04:05:48 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754162AbdCMRF1 (ORCPT ); Mon, 13 Mar 2017 13:05:27 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:55424 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752188AbdCMRFY (ORCPT ); Mon, 13 Mar 2017 13:05:24 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0LpAhs-1cHRsq0rJc-00ewFO; Mon, 13 Mar 2017 17:59:36 +0100 From: Arnd Bergmann To: "David S. Miller" Cc: Arnd Bergmann , Grygorii Strashko , Thomas Gleixner , Richard Cochran , WingMan Kwok , Nicolas Pitre , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH -net] cpsw/netcp: work around reverse cpts dependency Date: Mon, 13 Mar 2017 17:59:04 +0100 Message-Id: <20170313165927.1389014-1-arnd@arndb.de> 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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Reviewed-by: Grygorii Strashko --- 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