[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221026200730.ggyd4jhhbwpezmhs@skbuf>
Date: Wed, 26 Oct 2022 23:07:30 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Arun.Ramadoss@...rochip.com
Cc: ceggers@...i.de, andrew@...n.ch, linux-kernel@...r.kernel.org,
UNGLinuxDriver@...rochip.com, vivien.didelot@...il.com,
linux@...linux.org.uk, Tristram.Ha@...rochip.com,
f.fainelli@...il.com, kuba@...nel.org, edumazet@...gle.com,
pabeni@...hat.com, richardcochran@...il.com,
netdev@...r.kernel.org, Woojung.Huh@...rochip.com,
davem@...emloft.net, b.hutchman@...il.com
Subject: Re: [RFC Patch net-next 0/6] net: dsa: microchip: add gPTP support
for LAN937x switch
Hi Arun,
On Tue, Oct 25, 2022 at 03:41:26AM +0000, Arun.Ramadoss@...rochip.com wrote:
> > CONFIG_PTP_1588_CLOCK=m
> > CONFIG_NET_DSA=m
> > CONFIG_NET_DSA_MICROCHIP_KSZ_COMMON=m [ksz_switch.ko]
> > CONFIG_NET_DSA_MICROCHIP_KSZ9477_I2C=m
> > CONFIG_NET_DSA_MICROCHIP_KSZ_PTP=y [builtin]
> >
> > With this configuration, kbuild doesn't even try to compile
> > ksz_ptp.c:
> >
> > ERROR: modpost: "ksz_hwtstamp_get"
> > [drivers/net/dsa/microchip/ksz_switch.ko] undefined!
> > ERROR: modpost: "ksz_hwtstamp_set"
> > [drivers/net/dsa/microchip/ksz_switch.ko] undefined!
> > ERROR: modpost: "ksz_port_txtstamp"
> > [drivers/net/dsa/microchip/ksz_switch.ko] undefined!
> > ERROR: modpost: "ksz_ptp_clock_register"
> > [drivers/net/dsa/microchip/ksz_switch.ko] undefined!
> > ERROR: modpost: "ksz_port_deferred_xmit"
> > [drivers/net/dsa/microchip/ksz_switch.ko] undefined!
> > ERROR: modpost: "ksz_ptp_clock_unregister"
> > [drivers/net/dsa/microchip/ksz_switch.ko] undefined!
> > ERROR: modpost: "ksz_ptp_irq_free"
> > [drivers/net/dsa/microchip/ksz_switch.ko] undefined!
> > ERROR: modpost: "ksz_tstamp_reconstruct"
> > [drivers/net/dsa/microchip/ksz_switch.ko] undefined!
> > ERROR: modpost: "ksz_get_ts_info"
> > [drivers/net/dsa/microchip/ksz_switch.ko] undefined!
> > ERROR: modpost: "ksz_ptp_irq_setup"
> > [drivers/net/dsa/microchip/ksz_switch.ko] undefined!
> >
> > After setting all of the above to 'y', the build process works (but
> > I would prefer being able to build as modules).
>
> May be this is due to kconfig of config_ksz_ptp defined bool instead
> of tristate. Do I need to change the config_ksz_ptp to tristate in
> order to compile as modules?
You don't want a separate kernel module for PTP support, so no, you
don't want to make CONFIG_NET_DSA_MICROCHIP_KSZ_PTP tristate.
But what you want is for the ksz_ptp.o object file to be included into
ksz_switch-objs when CONFIG_NET_DSA_MICROCHIP_KSZ_PTP is enabled.
See how sja1105 does it:
ifdef CONFIG_NET_DSA_SJA1105_PTP
sja1105-objs += sja1105_ptp.o
endif
You'll also want to make NET_DSA_MICROCHIP_KSZ9477_I2C and
NET_DSA_MICROCHIP_KSZ_SPI to depend on PTP_1588_CLOCK_OPTIONAL, because
CONFIG_PTP_1588_CLOCK can be compiled as module (as Christian shows),
and in that case, you'll want the KSZ drivers to also be built as
modules (otherwise they're built-in, and built-in code cannot depend on
symbols exported from modules, because the modules may never be inserted).
It's best to actually experiment with this, you cannot get it right if
you don't experiment.
Powered by blists - more mailing lists