All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Neeli, Srinivas" <srneeli@amd.com>
To: Jakub Kicinski <kuba@kernel.org>, nagadheeraj.rottela@amd.com
Cc: srinivas.neeli@amd.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	richardcochran@gmail.com, michal.simek@amd.com, andrew@lunn.ch,
	olteanv@gmail.com, horms@kernel.org, linux@armlinux.org.uk,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, git-dev@amd.com
Subject: Re: [PATCH 02/20] net: xilinx: tsn: add TSN endpoint wrapper driver
Date: Fri, 14 Aug 2026 18:37:54 +0530	[thread overview]
Message-ID: <1ec0e56f-6e00-4eb8-ba40-767b74cc7856@amd.com> (raw)
In-Reply-To: <20260808194817.132469-1-kuba@kernel.org>

Hi,

On 8/9/2026 1:18 AM, Jakub Kicinski wrote:
> This is an AI-generated review of your patch. The human sending this
> email has considered the AI review valid, or at least plausible.
> ---
> net: xilinx: tsn: add TSN endpoint wrapper driver
>
> Adds a thin wrapper platform driver for the Xilinx TSN Endpoint Ethernet
> MAC IP node, along with a new Kconfig symbol and Makefile under
> drivers/net/ethernet/xilinx/tsn/. The wrapper enables the six IP-wide
> clocks and then populates the sub-nodes so each can bind to its own driver.
>
> A few questions below, all fairly minor.
>
>> diff --git a/drivers/net/ethernet/xilinx/tsn/Kconfig b/drivers/net/ethernet/xilinx/tsn/Kconfig
>> new file mode 100644
>> index 000000000000..45af4d3f10e6
>> --- /dev/null
>> +++ b/drivers/net/ethernet/xilinx/tsn/Kconfig
>> @@ -0,0 +1,15 @@
>> +# SPDX-License-Identifier: GPL-2.0-only
>> +#
>> +# Xilinx TSN device configuration
>> +#
>> +
>> +config XILINX_TSN
>> +	tristate "Xilinx TSN Ethernet driver"
>> +	depends on OF && HAS_IOMEM
> [Severity: Low]
> Should this depend on OF_ADDRESS rather than OF && HAS_IOMEM?
>
> The only functional statement in tsn_ip_probe() is:
>
> 	return devm_of_platform_populate(dev);
>
> and in include/linux/of_platform.h the real implementation is compiled
> only under CONFIG_OF_ADDRESS; otherwise the inline stub is:
>
> 	static inline int devm_of_platform_populate(struct device *dev)
> 	{
> 		return -ENODEV;
> 	}
>
> OF && HAS_IOMEM does not imply OF_ADDRESS, per drivers/of/Kconfig:
>
> 	config OF_ADDRESS
> 		def_bool y
> 		depends on !SPARC && (HAS_IOMEM || UML)
>
> sparc selects OF and provides HAS_IOMEM, and NET_VENDOR_XILINX has no
> architecture dependency, so XILINX_TSN is selectable there with
> OF_ADDRESS=n.
>
> In that configuration tsn_ip_probe() still runs devm_kzalloc(),
> devm_clk_bulk_get() and clk_bulk_prepare_enable() for all six clocks and
> registers the disable action, and then returns -ENODEV, so the driver can
> never bind and no sub-node device is created. The clocks are unwound by
> devres, so nothing leaks, but the whole driver is dead code in that
> configuration.
>
> This also stays as is through the end of the series, where the symbol is
> still "depends on OF && HAS_IOMEM" plus "depends on XILINX_DMA", and
> XILINX_DMA only has "depends on HAS_IOMEM".
>
>> +	help
>> +	  This driver supports the AMD/Xilinx Time-Sensitive Networking
>> +	  (TSN) Endpoint Ethernet MAC IP. It provides the wrapper device
>> +	  and the endpoint MAC that connects the IP to the host CPU. The
>> +	  three-port switch is supported by NET_DSA_XILINX_TSN.
> [Severity: Low]
> The help text describes "the endpoint MAC that connects the IP to the host
> CPU" and refers the reader to NET_DSA_XILINX_TSN, but at this commit the
> symbol only builds xilinx_tsn_main.o (clock enable plus
> devm_of_platform_populate()) and no NET_DSA_XILINX_TSN symbol exists in the
> tree yet.
>
> Both do appear later in the same series: the end-of-series Makefile has
>
> 	xilinx_tsn-y := xilinx_tsn_main.o xilinx_tsn_ep.o
>
> with &xlnx_tsn_ep_driver registered from xilinx_tsn_main.c, and
> NET_DSA_XILINX_TSN is added in drivers/net/dsa/xilinx/Kconfig.
>
> Since the text only appears in prose and not in a select or depends on,
> there is no build effect; would it be worth wording the help text so it
> matches what this commit actually builds, or is the forward reference
> intentional for the series?
>
>> +
>> +	  If unsure, say N.
> [ ... ]
>
>> diff --git a/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_main.c b/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_main.c
>> new file mode 100644
>> index 000000000000..1ef1b0c2ee6e
>> --- /dev/null
>> +++ b/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_main.c
>> @@ -0,0 +1,105 @@
> [ ... ]
>
>> +static int tsn_ip_probe(struct platform_device *pdev)
>> +{
>> +	struct device *dev = &pdev->dev;
>> +	struct xlnx_tsn_ip *w;
>> +	int ret;
>> +
>> +	w = devm_kzalloc(dev, sizeof(*w), GFP_KERNEL);
>> +	if (!w)
>> +		return -ENOMEM;
>> +
>> +	for (int i = 0; i < TSN_NUM_CLOCKS; i++)
>> +		w->clks[i].id = tsn_clk_names[i];
>> +
>> +	ret = devm_clk_bulk_get(dev, TSN_NUM_CLOCKS, w->clks);
>> +	if (ret)
>> +		return dev_err_probe(dev, ret, "failed to get clocks\n");
>> +
>> +	ret = clk_bulk_prepare_enable(TSN_NUM_CLOCKS, w->clks);
>> +	if (ret)
>> +		return dev_err_probe(dev, ret, "failed to enable clocks\n");
>> +
>> +	ret = devm_add_action_or_reset(dev, tsn_clk_bulk_disable, w);
>> +	if (ret)
>> +		return ret;
>> +
>> +	return devm_of_platform_populate(dev);
>> +}
> [Severity: Low]
> Is there a consumer for xlnx,num-priorities anywhere?
>
> Documentation/devicetree/bindings/net/xlnx,tsn-endpoint-ethernet-mac.yaml
> lists it in the top-level required block for this same node:
>
> 	required:
> 	  - compatible
> 	  - reg
> 	  - clocks
> 	  - clock-names
> 	  - xlnx,num-priorities
> 	  - ranges
>
> tsn_ip_probe() is the only driver binding
> "xlnx,tsn-endpoint-ethernet-mac-3.0", and it only fills clks[].id and
> calls devm_clk_bulk_get(), clk_bulk_prepare_enable() and
> devm_of_platform_populate(). Grepping for num-priorities or
> num_priorities at the end of the series finds hits only inside the YAML
> itself plus unrelated fsl-mc and xe files.
>
> So device tree authors must supply the property to pass dt_binding_check
> while nothing reads it. Would it make sense to drop it from required
> until a driver actually uses it?
    yes, num-priorities has no user yet. But it's mandatory, and the driver
   should validate it against the TX channel count, which I missed. I'll add
   that in next version, read num-priorities at probe and bail out if it 
doesn't equal the
   number of TX channels.
I will address remaining  comments in next version.

Thanks
Srinivas Neeli
>
> [ ... ]


  reply	other threads:[~2026-08-14 13:08 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 10:44 [PATCH 00/20] xilinx: tsn: Add TSN Endpoint Ethernet MAC driver support Nagadheeraj Rottela
2026-08-07 10:44 ` [PATCH 01/20] dt-bindings: net: add Xilinx TSN Endpoint Ethernet MAC Nagadheeraj Rottela
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-14 10:29     ` Neeli, Srinivas
2026-08-14 18:04       ` Rob Herring
2026-08-17 10:03         ` Neeli, Srinivas
2026-08-12 21:16   ` Rob Herring
2026-08-07 10:44 ` [PATCH 02/20] net: xilinx: tsn: add TSN endpoint wrapper driver Nagadheeraj Rottela
2026-08-07 20:58   ` Uwe Kleine-König
2026-08-08 12:27     ` Neeli, Srinivas
2026-08-08 19:48   ` Jakub Kicinski
2026-08-14 13:07     ` Neeli, Srinivas [this message]
2026-08-07 10:44 ` [PATCH 03/20] net: xilinx: tsn: add endpoint MAC driver skeleton Nagadheeraj Rottela
2026-08-07 21:00   ` Uwe Kleine-König
2026-08-08 12:28     ` Neeli, Srinivas
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 04/20] net: xilinx: tsn: parse endpoint DMA channel configuration Nagadheeraj Rottela
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 05/20] net: xilinx: tsn: bring up the endpoint MCDMA channels Nagadheeraj Rottela
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 06/20] net: xilinx: tsn: add the endpoint RX data path Nagadheeraj Rottela
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-14 13:26     ` Neeli, Srinivas
2026-08-07 10:44 ` [PATCH 07/20] net: xilinx: tsn: add the endpoint TX " Nagadheeraj Rottela
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 08/20] net: xilinx: tsn: deliver endpoint RX frames to DSA user ports Nagadheeraj Rottela
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 09/20] net: dsa: tag_xlnx_tsn: add skeleton tag protocol Nagadheeraj Rottela
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 10/20] net: dsa: xilinx: add skeleton driver for TSN switch Nagadheeraj Rottela
2026-08-07 10:44 ` [PATCH 11/20] net: dsa: xilinx: implement port_stp_state_set Nagadheeraj Rottela
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-20 14:02     ` Rottela, Nagadheeraj
2026-08-07 10:44 ` [PATCH 12/20] net: dsa: xilinx: register per-MAC MDIO buses Nagadheeraj Rottela
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 13/20] net: dsa: xilinx: wire up phylink for the switch ports Nagadheeraj Rottela
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 14/20] net: dsa: xilinx: program MAC frame filter and per-port nibbles Nagadheeraj Rottela
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 15/20] net: dsa: xilinx: register PHC backed by the RTC timer block Nagadheeraj Rottela
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 16/20] net: dsa: xilinx: drive per-MAC PTP TX/RX hardware paths Nagadheeraj Rottela
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 17/20] net: dsa: xilinx: opt into TX forwarding offload on bridge join Nagadheeraj Rottela
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 18/20] net: dsa: xilinx: offload the bridge FDB to the switch CAM Nagadheeraj Rottela
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 19/20] net: dsa: xilinx: offload bridge VLAN filtering to the switch Nagadheeraj Rottela
2026-08-08 10:46   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 10:44 ` [PATCH 20/20] net: dsa: xilinx: trap link-local control frames to the CPU port Nagadheeraj Rottela
2026-08-08 10:47   ` sashiko-bot
2026-08-08 19:48   ` Jakub Kicinski
2026-08-07 22:28 ` [PATCH 00/20] xilinx: tsn: Add TSN Endpoint Ethernet MAC driver support Jakub Kicinski

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=1ec0e56f-6e00-4eb8-ba40-767b74cc7856@amd.com \
    --to=srneeli@amd.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=git-dev@amd.com \
    --cc=horms@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=michal.simek@amd.com \
    --cc=nagadheeraj.rottela@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=robh@kernel.org \
    --cc=srinivas.neeli@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.