Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] net/stmmac: Fixes for maximum TX/RX queues to use by driver
       [not found] <CGME20260611113403eucas1p1f4b61896c875f1f6833d6ca136472af8@eucas1p1.samsung.com>
@ 2026-06-11 11:33 ` Jakub Raczynski
  2026-06-11 11:33   ` [PATCH net 1/2] net/stmmac: Apply TBS config only to used queues Jakub Raczynski
  2026-06-12 19:14   ` [PATCH net 0/2] net/stmmac: Fixes for maximum TX/RX queues to use by driver Simon Horman
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Raczynski @ 2026-06-11 11:33 UTC (permalink / raw)
  To: netdev
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, mcoquelin.stm32,
	alexandre.torgue, linux-kernel, linux-arm-kernel, k.domagalski,
	k.tegowski, Jakub Raczynski

When contributing other changes preparing functions for new XGMAC hardware
https://lore.kernel.org/netdev/20260601162537.553512-1-j.raczynski@samsung.com/
there have been reports by Sashiko AI review about pre-existing issues
in the code. These problems are non-insignificant and are 'net' material fixes,
rather than net-next features.
One issue in this patchset was reported by Sashiko AI, while other
technically part of new patchset, but is reasonable related fix.
All of issues are wrong DTS configuration, but kernel needs to handle it.

Jakub Raczynski (2):
  net/stmmac: Apply TBS config only to used queues
  net/stmmac: Apply MTL_MAX queue limit if config missing

 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c     | 2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH net 1/2] net/stmmac: Apply TBS config only to used queues
  2026-06-11 11:33 ` [PATCH net 0/2] net/stmmac: Fixes for maximum TX/RX queues to use by driver Jakub Raczynski
@ 2026-06-11 11:33   ` Jakub Raczynski
  2026-06-12 19:14   ` [PATCH net 0/2] net/stmmac: Fixes for maximum TX/RX queues to use by driver Simon Horman
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Raczynski @ 2026-06-11 11:33 UTC (permalink / raw)
  To: netdev
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, mcoquelin.stm32,
	alexandre.torgue, linux-kernel, linux-arm-kernel, k.domagalski,
	k.tegowski, Jakub Raczynski, Chang-Sub Lee

While opening stmmac driver, there is enabling of TBS (Time-Based Scheduling)
option in dma config. Currently this is executed for all possible TX queues via
MTL_MAX_TX_QUEUES macro, but actual number of queues used might differ.
While setting this is generally harmless, since memory for MTL_MAX_TX_QUEUES
is allocated, it is incorrect, because it prepares config for unused queues.

Change this to apply tbs config only to tx_queues_to_use.

Fixes: 4896bb7c0b31a ("net: stmmac: do not clear TBS enable bit on link up/down")
Co-developed-by: Chang-Sub Lee <cs0617.lee@samsung.com>
Signed-off-by: Chang-Sub Lee <cs0617.lee@samsung.com>
Signed-off-by: Jakub Raczynski <j.raczynski@samsung.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 3591755ea30b..5917bf47c7de 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -4140,7 +4140,7 @@ static int __stmmac_open(struct net_device *dev,
 	u8 chan;
 	int ret;
 
-	for (int i = 0; i < MTL_MAX_TX_QUEUES; i++)
+	for (int i = 0; i < priv->plat->tx_queues_to_use; i++)
 		if (priv->dma_conf.tx_queue[i].tbs & STMMAC_TBS_EN)
 			dma_conf->tx_queue[i].tbs = priv->dma_conf.tx_queue[i].tbs;
 	memcpy(&priv->dma_conf, dma_conf, sizeof(*dma_conf));
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net 0/2] net/stmmac: Fixes for maximum TX/RX queues to use by driver
  2026-06-11 11:33 ` [PATCH net 0/2] net/stmmac: Fixes for maximum TX/RX queues to use by driver Jakub Raczynski
  2026-06-11 11:33   ` [PATCH net 1/2] net/stmmac: Apply TBS config only to used queues Jakub Raczynski
@ 2026-06-12 19:14   ` Simon Horman
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2026-06-12 19:14 UTC (permalink / raw)
  To: Jakub Raczynski
  Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni,
	mcoquelin.stm32, alexandre.torgue, linux-kernel, linux-arm-kernel,
	k.domagalski, k.tegowski

On Thu, Jun 11, 2026 at 01:33:56PM +0200, Jakub Raczynski wrote:
> When contributing other changes preparing functions for new XGMAC hardware
> https://lore.kernel.org/netdev/20260601162537.553512-1-j.raczynski@samsung.com/
> there have been reports by Sashiko AI review about pre-existing issues
> in the code. These problems are non-insignificant and are 'net' material fixes,
> rather than net-next features.
> One issue in this patchset was reported by Sashiko AI, while other
> technically part of new patchset, but is reasonable related fix.
> All of issues are wrong DTS configuration, but kernel needs to handle it.
> 
> Jakub Raczynski (2):
>   net/stmmac: Apply TBS config only to used queues
>   net/stmmac: Apply MTL_MAX queue limit if config missing

For the series;

Reviewed-by: Simon Horman <horms@kernel.org>

FTR, there is AI-generated review of this patch-set available on sashiko.dev
However I believe that feedback can be viewed in the context of possible
follow-up and should not impede the progress of this patchset.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-12 19:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20260611113403eucas1p1f4b61896c875f1f6833d6ca136472af8@eucas1p1.samsung.com>
2026-06-11 11:33 ` [PATCH net 0/2] net/stmmac: Fixes for maximum TX/RX queues to use by driver Jakub Raczynski
2026-06-11 11:33   ` [PATCH net 1/2] net/stmmac: Apply TBS config only to used queues Jakub Raczynski
2026-06-12 19:14   ` [PATCH net 0/2] net/stmmac: Fixes for maximum TX/RX queues to use by driver Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox