Re: [PATCH net-next v2 2/8] net: xilinx: tsn: add TSN endpoint wrapper driver
From: Neeli, Srinivas
Date: Thu Sep 24 2026 - 05:40:47 EST
Hi,
On 9/13/2026 2:06 AM, netdev-bot+sashiko@xxxxxxxxxx wrote:
Thank you for your contribution! Sashiko AI review found 2 potentialThe Kconfig text describes what the option provides once the series is applied,
issue(s) to consider:
Critical: 0 · High: 0 · Medium: 0 · Low: 2
- [Low] Kconfig help text for CONFIG_XILINX_TSN claims the option
"provides the wrapper device and the endpoint MAC that connects the IP…
- [Low] The binding Documentation/devicetree/bindings/net/xlnx,tsn-
endpoint-ethernet-mac.yaml puts 'xlnx,num-priorities' (uint32, 2..8)…
--
net: xilinx: tsn: add TSN endpoint wrapper driver
This adds a thin wrapper platform driver for the AMD/Xilinx TSN Endpoint
Ethernet MAC IP node. The wrapper enables the six IP-wide clocks
described in the device tree and then populates the DT sub-nodes so each
one can bind to its own driver.
A couple of questions on the new Kconfig text and on the DT properties
the wrapper consumes.
[ ... ]
diff --git a/drivers/net/ethernet/xilinx/tsn/Kconfig b/drivers/net/ethernet/xilinx/tsn/Kconfig[Severity: Low]
new file mode 100644
index 000000000000..b8939d8a92ef
--- /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_ADDRESS
+ 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 the companion DSA driver.
Is the help text accurate at this point in the series? It says the
option "provides the wrapper device and the endpoint MAC that connects
the IP to the host CPU", but the Makefile added by this patch builds only
the wrapper object:
xilinx_tsn-y := xilinx_tsn_main.o
and tsn_drivers[] registers only &tsn_driver, which matches
"xlnx,tsn-endpoint-ethernet-mac-3.0". No driver in the tree matches the
sub-node compatibles at this commit, so devm_of_platform_populate() in
tsn_ip_probe() creates child platform devices that cannot bind, and
enabling the symbol here yields enabled clocks but no netdev.
The endpoint MAC part is resolved by later patches in this same series:
by the end of the series the Makefile also builds xilinx_tsn_ep.o,
tsn_drivers[] gains &xlnx_tsn_ep_driver, and xilinx_tsn_ep.c matches
".compatible = \"xlnx,tsn-ep-mac\"", so this is only a transient
mismatch between patches.
The remaining sentence about the "companion DSA driver" refers to
something that is not in-tree at any point of this series. Could that
sentence be dropped or reworded until the DSA driver lands?
and it is written once rather than edited in each patch. xilinx_tsn_ep.o and
the endpoint driver land in the next patch of this same series, so "the wrapper
device and the endpoint MAC" is accurate for the series as a whole.
The switch is a separate submission. V1 carried the endpoint, wrapper and
switch together, following the guidance to keep a series reviewable we split
it, so the DSA switch driver is posted as its own series. The sentence
describes how the three-port switch is supported in the overall design, which
is the same text V1 and V2 carried, so we are keeping it unchanged.
Yes, that is intentional. The wrapper driver only enables the IP-wide clocks+[ ... ]
+ If unsure, say N.
diff --git a/drivers/net/ethernet/xilinx/tsn/Makefile b/drivers/net/ethernet/xilinx/tsn/Makefile
new file mode 100644
index 000000000000..6f99226f3dc8
--- /dev/null
+++ b/drivers/net/ethernet/xilinx/tsn/Makefile
@@ -0,0 +1,2 @@
+obj-$(CONFIG_XILINX_TSN) += xilinx_tsn.o
+xilinx_tsn-y := xilinx_tsn_main.o
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..afe7609c67fb
--- /dev/null
+++ b/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_main.c
@@ -0,0 +1,104 @@
+static int tsn_ip_probe(struct platform_device *pdev)[Severity: Low]
+{
+ 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);
+}
The binding
Documentation/devicetree/bindings/net/xlnx,tsn-endpoint-ethernet-mac.yaml
lists xlnx,num-priorities (uint32, 2..8) in the required: list for the
"xlnx,tsn-endpoint-ethernet-mac-3.0" node:
xlnx,num-priorities:
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 2
maximum: 8
tsn_ip_probe() is the only driver matching that compatible here, and it
does devm_kzalloc(), devm_clk_bulk_get(), clk_bulk_prepare_enable(),
devm_add_action_or_reset() and devm_of_platform_populate() without any
of_property_read_u32(), so the mandatory property is neither read nor
range-checked.
A later patch in this series ("net: xilinx: tsn: parse endpoint DMA
channel configuration") does consume it from the parent IP node in
xlnx_tsn_ep_probe():
ret = of_property_read_u32(ip_np, "xlnx,num-priorities", &num_prio);
...
if (num_tx != num_prio)
return dev_err_probe(dev, -EINVAL, ...);
so the binding/driver mismatch only exists between patches of this
series. Was leaving the property unconsumed by the wrapper itself
intentional?
and populates the DT sub-nodes. It does not implement a data path, so it has no
use for the priority queue count. xlnx,num-priorities describes the IP and is
consumed by the endpoint MAC driver, which reads it from the parent IP node in
xlnx_tsn_ep_probe(). Keeping the property on the IP node and reading it from
the child that needs it avoids duplicating it per sub-node.
Thanks
Srinivas Neeli
+[ ... ]
+static const struct of_device_id tsn_of_match[] = {
+ { .compatible = "xlnx,tsn-endpoint-ethernet-mac-3.0" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, tsn_of_match);