linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Arun.Ramadoss@microchip.com
Cc: ceggers@arri.de, andrew@lunn.ch, linux-kernel@vger.kernel.org,
	UNGLinuxDriver@microchip.com, vivien.didelot@gmail.com,
	linux@armlinux.org.uk, Tristram.Ha@microchip.com,
	f.fainelli@gmail.com, kuba@kernel.org, edumazet@google.com,
	pabeni@redhat.com, richardcochran@gmail.com,
	netdev@vger.kernel.org, Woojung.Huh@microchip.com,
	davem@davemloft.net, b.hutchman@gmail.com
Subject: Re: [RFC Patch net-next 0/6] net: dsa: microchip: add gPTP support for LAN937x switch
Date: Wed, 26 Oct 2022 23:07:30 +0300	[thread overview]
Message-ID: <20221026200730.ggyd4jhhbwpezmhs@skbuf> (raw)
In-Reply-To: <42c713fb7ad6aebe8ad2d3e0740f1e4678b10902.camel@microchip.com>

Hi Arun,

On Tue, Oct 25, 2022 at 03:41:26AM +0000, Arun.Ramadoss@microchip.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.

  reply	other threads:[~2022-10-26 20:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-14 15:28 [RFC Patch net-next 0/6] net: dsa: microchip: add gPTP support for LAN937x switch Arun Ramadoss
2022-10-14 15:28 ` [RFC Patch net-next 1/6] net: dsa: microchip: adding the posix clock support Arun Ramadoss
2022-10-14 15:28 ` [RFC Patch net-next 2/6] net: dsa: microchip: Initial hardware time stamping support Arun Ramadoss
2022-10-14 15:28 ` [RFC Patch net-next 3/6] net: dsa: microchip: Manipulating absolute time using ptp hw clock Arun Ramadoss
2022-10-14 15:28 ` [RFC Patch net-next 4/6] net: dsa: microchip: enable the ptp interrupt for timestamping Arun Ramadoss
2022-10-14 15:28 ` [RFC Patch net-next 5/6] net: dsa: microchip: Adding the ptp packet reception logic Arun Ramadoss
2022-10-25  6:17   ` Christian Eggers
2022-10-26 20:13     ` Vladimir Oltean
2022-10-14 15:28 ` [RFC Patch net-next 6/6] net: dsa: microchip: add the transmission tstamp logic Arun Ramadoss
2022-10-17 17:19 ` [RFC Patch net-next 0/6] net: dsa: microchip: add gPTP support for LAN937x switch Vladimir Oltean
2022-10-18  6:44   ` Arun.Ramadoss
2022-10-18 10:29     ` Vladimir Oltean
2022-10-18 13:42       ` Arun.Ramadoss
2022-10-23 20:15         ` Christian Eggers
2022-10-25  3:41           ` Arun.Ramadoss
2022-10-26 20:07             ` Vladimir Oltean [this message]
2022-10-26 16:47         ` Christian Eggers
2022-10-26 21:44           ` Vladimir Oltean
2022-10-27 15:51             ` Arun.Ramadoss
2022-11-02 13:12               ` Christian Eggers
2022-11-02 13:11             ` Christian Eggers
2022-11-04 10:36               ` Arun.Ramadoss
2022-10-17 18:46 ` Vladimir Oltean
2022-10-18  6:29   ` Arun.Ramadoss
2022-10-18  9:55     ` Vladimir Oltean

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=20221026200730.ggyd4jhhbwpezmhs@skbuf \
    --to=olteanv@gmail.com \
    --cc=Arun.Ramadoss@microchip.com \
    --cc=Tristram.Ha@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=b.hutchman@gmail.com \
    --cc=ceggers@arri.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=vivien.didelot@gmail.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).