linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Clay McClure <clay@daemons.net>,
	kbuild test robot <lkp@intel.com>,
	Russell King <linux@armlinux.org.uk>,
	Tony Lindgren <tony@atomide.com>,
	"David S. Miller" <davem@davemloft.net>,
	Murali Karicheri <m-karicheri2@ti.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Andrew Jeffery <andrew@aj.id.au>,
	Santosh Shilimkar <santosh.shilimkar@oracle.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>
Subject: Re: [PATCH v2] net: ethernet: ti: Remove TI_CPTS_MOD workaround
Date: Thu, 7 May 2020 23:37:32 +0200	[thread overview]
Message-ID: <CAK8P3a07z=kauDKVJzroHyOZ1ZSqpqZA4X69XJ5QCQ4c6JO_pg@mail.gmail.com> (raw)
In-Reply-To: <1654101f-9dd7-2e10-7344-0d08e32bc309@ti.com>

On Wed, May 6, 2020 at 10:57 PM Grygorii Strashko
<grygorii.strashko@ti.com> wrote:
> On 06/05/2020 09:51, Clay McClure wrote:
> > On Tue, May 05, 2020 at 10:41:26AM +0300, Grygorii Strashko wrote:

> >
>
> Ok. After some thinking and hence you commit b6d49cab44b5 ("net: Make PTP-specific drivers depend on PTP_1588_CLOCK")
> seems was merged in net (not net-next)
> 1) for-net: defconfig changes can be separated to fix build fail, but add change for multi_v7_defconfig
> 2) for-net-next: rest of changes plus below diff on top of it
>
> diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
> index f3f8bb724294..62f809b67469 100644
> --- a/drivers/net/ethernet/ti/Kconfig
> +++ b/drivers/net/ethernet/ti/Kconfig
> @@ -49,6 +49,7 @@ config TI_CPSW_PHY_SEL
>   config TI_CPSW
>          tristate "TI CPSW Switch Support"
>          depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST
> +       depends on TI_CPTS || !TI_CPTS
>          select TI_DAVINCI_MDIO
>          select MFD_SYSCON
>          select PAGE_POOL
> @@ -64,6 +65,7 @@ config TI_CPSW_SWITCHDEV
>          tristate "TI CPSW Switch Support with switchdev"
>          depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST
>          depends on NET_SWITCHDEV
> +       depends on TI_CPTS || !TI_CPTS
>          select PAGE_POOL
>          select TI_DAVINCI_MDIO
>          select MFD_SYSCON
> @@ -78,11 +80,9 @@ config TI_CPSW_SWITCHDEV
>
>   config TI_CPTS
>          tristate "TI Common Platform Time Sync (CPTS) Support"
> -       depends on TI_CPSW || TI_KEYSTONE_NETCP || TI_CPSW_SWITCHDEV || COMPILE_TEST
> +       depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || COMPILE_TEST
>          depends on COMMON_CLK
>          depends on PTP_1588_CLOCK
> -       default y if TI_CPSW=y || TI_KEYSTONE_NETCP=y || TI_CPSW_SWITCHDEV=y
> -       default m
>          ---help---
>            This driver supports the Common Platform Time Sync unit of
>            the CPSW Ethernet Switch and Keystone 2 1g/10g Switch Subsystem.
> @@ -109,6 +109,7 @@ config TI_KEYSTONE_NETCP
>          select TI_DAVINCI_MDIO
>          depends on OF
>          depends on KEYSTONE_NAVIGATOR_DMA && KEYSTONE_NAVIGATOR_QMSS
> +       depends on TI_CPTS || !TI_CPTS
>          ---help---
>            This driver supports TI's Keystone NETCP Core.
>
> It should properly resolve "M" vs "Y" dependencies between
>   PTP_1588_CLOCK->TI_CPTS->TI_CPSW
>
> On thing, TI_CPTS can be selected without TI_CPSW, but it's probably ok.

I think that solution is reasonable. I had come up with a different
for when I ran
into the build failure, but I like yours better. Here is my patch, for
reference:


commit 94233d78655876f735189890eb40ef33c49e8523 (HEAD -> randconfig)
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Thu May 7 21:25:59 2020 +0200

    cpsw: fix cpts link failure

    When CONFIG_PTP_1588_CLOCK is a loadable module, trying to build cpts
    support into the built-in cpsw driver results in a link error:

    arm-linux-gnueabi-ld: drivers/net/ethernet/ti/cpsw.o: in function
`cpsw_probe':
    cpsw.c:(.text+0x918): undefined reference to `cpts_release'
    arm-linux-gnueabi-ld: drivers/net/ethernet/ti/cpsw.o: in function
`cpsw_remove':
    cpsw.c:(.text+0x1048): undefined reference to `cpts_release'
    arm-linux-gnueabi-ld: drivers/net/ethernet/ti/cpsw.o: in function
`cpsw_rx_handler':
    cpsw.c:(.text+0x12c0): undefined reference to `cpts_rx_timestamp'
    arm-linux-gnueabi-ld: drivers/net/ethernet/ti/cpsw.o: in function
`cpsw_ndo_open':

    Add a dependency for CPTS that only allows it to be enabled when
    doing so does not cause link-time probles.

    Fixes: b6d49cab44b5 ("net: Make PTP-specific drivers depend on
PTP_1588_CLOCK")
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
index 4ab35ce7b451..571caf4192c5 100644
--- a/drivers/net/ethernet/ti/Kconfig
+++ b/drivers/net/ethernet/ti/Kconfig
@@ -79,6 +79,9 @@ config TI_CPSW_SWITCHDEV
 config TI_CPTS
        bool "TI Common Platform Time Sync (CPTS) Support"
        depends on TI_CPSW || TI_KEYSTONE_NETCP || TI_CPSW_SWITCHDEV
|| COMPILE_TEST
+       depends on TI_CPSW=n || TI_CPSW=PTP_1588_CLOCK || PTP_1588_CLOCK=y
+       depends on TI_KEYSTONE_NETCP=n ||
TI_KEYSTONE_NETCP=PTP_1588_CLOCK || PTP_1588_CLOCK=y
+       depends on TI_CPSW_SWITCHDEV=n ||
TI_CPSW_SWITCHDEV=PTP_1588_CLOCK || PTP_1588_CLOCK=y
        depends on COMMON_CLK
        depends on POSIX_TIMERS
        ---help---

      reply	other threads:[~2020-05-07 21:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-02 23:39 [PATCH] net: ethernet: ti: Remove TI_CPTS_MOD workaround Clay McClure
2020-05-04 15:09 ` Tony Lindgren
2020-05-04 15:16 ` Arnd Bergmann
2020-05-04 16:57   ` [PATCH v2] " Clay McClure
2020-05-05  7:41     ` Grygorii Strashko
2020-05-06  6:51       ` Clay McClure
2020-05-06 20:56         ` Grygorii Strashko
2020-05-07 21:37           ` Arnd Bergmann [this message]

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='CAK8P3a07z=kauDKVJzroHyOZ1ZSqpqZA4X69XJ5QCQ4c6JO_pg@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=andrew@aj.id.au \
    --cc=brouer@redhat.com \
    --cc=clay@daemons.net \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=grygorii.strashko@ti.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=ivan.khoronzhuk@linaro.org \
    --cc=keescook@chromium.org \
    --cc=krzk@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lkp@intel.com \
    --cc=m-karicheri2@ti.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=pankaj.laxminarayan.bharadiya@intel.com \
    --cc=richardcochran@gmail.com \
    --cc=santosh.shilimkar@oracle.com \
    --cc=tglx@linutronix.de \
    --cc=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).