* [PATCH net-next] net: ethernet: ti: cpsw_new: populate netdev of_node
@ 2025-02-27 7:46 A. Sverdlin
2025-02-27 11:14 ` Siddharth Vadapalli
2025-02-27 13:24 ` Andrew Lunn
0 siblings, 2 replies; 4+ messages in thread
From: A. Sverdlin @ 2025-02-27 7:46 UTC (permalink / raw)
To: Siddharth Vadapalli, Roger Quadros, netdev
Cc: Alexander Sverdlin, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-omap, linux-kernel
From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
So that of_find_net_device_by_node() can find cpsw-nuss ports and other DSA
switches can be stacked downstream. Tested in conjunction with KSZ8873.
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
---
drivers/net/ethernet/ti/cpsw_new.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
index cec0a90659d94..66713bc931741 100644
--- a/drivers/net/ethernet/ti/cpsw_new.c
+++ b/drivers/net/ethernet/ti/cpsw_new.c
@@ -1418,6 +1418,7 @@ static int cpsw_create_ports(struct cpsw_common *cpsw)
ndev->netdev_ops = &cpsw_netdev_ops;
ndev->ethtool_ops = &cpsw_ethtool_ops;
SET_NETDEV_DEV(ndev, dev);
+ ndev->dev.of_node = slave_data->slave_node;
if (!napi_ndev) {
/* CPSW Host port CPDMA interface is shared between
--
2.48.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: ethernet: ti: cpsw_new: populate netdev of_node
2025-02-27 7:46 [PATCH net-next] net: ethernet: ti: cpsw_new: populate netdev of_node A. Sverdlin
@ 2025-02-27 11:14 ` Siddharth Vadapalli
2025-02-27 13:24 ` Andrew Lunn
1 sibling, 0 replies; 4+ messages in thread
From: Siddharth Vadapalli @ 2025-02-27 11:14 UTC (permalink / raw)
To: A. Sverdlin
Cc: Siddharth Vadapalli, Roger Quadros, netdev, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
linux-omap, linux-kernel
On Thu, Feb 27, 2025 at 08:46:46AM +0100, A. Sverdlin wrote:
> From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>
> So that of_find_net_device_by_node() can find cpsw-nuss ports and other DSA
> switches can be stacked downstream. Tested in conjunction with KSZ8873.
>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
> ---
> drivers/net/ethernet/ti/cpsw_new.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
> index cec0a90659d94..66713bc931741 100644
> --- a/drivers/net/ethernet/ti/cpsw_new.c
> +++ b/drivers/net/ethernet/ti/cpsw_new.c
> @@ -1418,6 +1418,7 @@ static int cpsw_create_ports(struct cpsw_common *cpsw)
> ndev->netdev_ops = &cpsw_netdev_ops;
> ndev->ethtool_ops = &cpsw_ethtool_ops;
> SET_NETDEV_DEV(ndev, dev);
> + ndev->dev.of_node = slave_data->slave_node;
>
> if (!napi_ndev) {
> /* CPSW Host port CPDMA interface is shared between
Regards,
Siddharth.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: ethernet: ti: cpsw_new: populate netdev of_node
2025-02-27 7:46 [PATCH net-next] net: ethernet: ti: cpsw_new: populate netdev of_node A. Sverdlin
2025-02-27 11:14 ` Siddharth Vadapalli
@ 2025-02-27 13:24 ` Andrew Lunn
2025-02-27 14:18 ` Sverdlin, Alexander
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2025-02-27 13:24 UTC (permalink / raw)
To: A. Sverdlin
Cc: Siddharth Vadapalli, Roger Quadros, netdev, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
linux-omap, linux-kernel
On Thu, Feb 27, 2025 at 08:46:46AM +0100, A. Sverdlin wrote:
> From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>
> So that of_find_net_device_by_node() can find cpsw-nuss ports and other DSA
> switches can be stacked downstream. Tested in conjunction with KSZ8873.
>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Consistent with other TI drivers. But it looks like only TI drivers
need this, which suggests they are all doing something wrong, maybe
for legacy reasons.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: ethernet: ti: cpsw_new: populate netdev of_node
2025-02-27 13:24 ` Andrew Lunn
@ 2025-02-27 14:18 ` Sverdlin, Alexander
0 siblings, 0 replies; 4+ messages in thread
From: Sverdlin, Alexander @ 2025-02-27 14:18 UTC (permalink / raw)
To: andrew@lunn.ch
Cc: andrew+netdev@lunn.ch, s-vadapalli@ti.com, davem@davemloft.net,
linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
kuba@kernel.org, netdev@vger.kernel.org, edumazet@google.com,
rogerq@kernel.org, pabeni@redhat.com
Hi Andrew,
On Thu, 2025-02-27 at 14:24 +0100, Andrew Lunn wrote:
> On Thu, Feb 27, 2025 at 08:46:46AM +0100, A. Sverdlin wrote:
> > From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
> >
> > So that of_find_net_device_by_node() can find cpsw-nuss ports and other DSA
^^^^^
Oops, copy-paste failure here, nuss was for the am65-cpsw-nuss driver,
maybe "-nuss" could be simply deleted from the commit message on "apply"...
> > switches can be stacked downstream. Tested in conjunction with KSZ8873.
> >
> > Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>
> Consistent with other TI drivers. But it looks like only TI drivers
> need this, which suggests they are all doing something wrong, maybe
> for legacy reasons.
Well, yes, they re-invent the wheel, mimicking the DSA infrastructure
without using it. CPSW is a switch, as the name suggests, but the
effort has not been spent to bring it to DSA home ;-)
So what happens here actually is, I'm assigning a DT node to "user port"
in DSA terms, and dsa_register_switch() would for sure do it...
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
--
Alexander Sverdlin
Siemens AG
www.siemens.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-27 14:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-27 7:46 [PATCH net-next] net: ethernet: ti: cpsw_new: populate netdev of_node A. Sverdlin
2025-02-27 11:14 ` Siddharth Vadapalli
2025-02-27 13:24 ` Andrew Lunn
2025-02-27 14:18 ` Sverdlin, Alexander
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox