* [PATCH net] net: stmmac: dwmac4: extend timeout for VLAN Tag register busy bit check
@ 2024-09-17 16:42 Shenwei Wang
2024-09-18 8:16 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: Shenwei Wang @ 2024-09-17 16:42 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Maxime Coquelin
Cc: Alexandre Torgue, Jose Abreu, Wong Vee Khee, Ong Boon Leong,
Chuah Kim Tatt, netdev, linux-stm32, linux-arm-kernel, imx,
linux-imx, Shenwei Wang
Increase the timeout for checking the busy bit of the VLAN Tag register
from 10µs to 500ms. This change is necessary to accommodate scenarios
where Energy Efficient Ethernet (EEE) is enabled.
Overnight testing revealed that when EEE is active, the busy bit can
remain set for up to approximately 300ms. The new 500ms timeout provides
a safety margin.
This modification does not impact normal success path, as the function
typically returns within 1µs in non-EEE scenarios. The extended timeout
only affects the failure path.
Fixes: ed64639bc1e0 ("net: stmmac: Add support for VLAN Rx filtering")
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index a1858f083eef..cd5e5434ac52 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -471,7 +471,7 @@ static int dwmac4_write_vlan_filter(struct net_device *dev,
u8 index, u32 data)
{
void __iomem *ioaddr = (void __iomem *)dev->base_addr;
- int i, timeout = 10;
+ int i, timeout = 500000;
u32 val;
if (index >= hw->num_vlan)
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: stmmac: dwmac4: extend timeout for VLAN Tag register busy bit check
2024-09-17 16:42 [PATCH net] net: stmmac: dwmac4: extend timeout for VLAN Tag register busy bit check Shenwei Wang
@ 2024-09-18 8:16 ` Simon Horman
0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2024-09-18 8:16 UTC (permalink / raw)
To: Shenwei Wang
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Maxime Coquelin, Alexandre Torgue, Jose Abreu, Wong Vee Khee,
Ong Boon Leong, Chuah Kim Tatt, netdev, linux-stm32,
linux-arm-kernel, imx, linux-imx
On Tue, Sep 17, 2024 at 11:42:06AM -0500, Shenwei Wang wrote:
> Increase the timeout for checking the busy bit of the VLAN Tag register
> from 10µs to 500ms. This change is necessary to accommodate scenarios
> where Energy Efficient Ethernet (EEE) is enabled.
>
> Overnight testing revealed that when EEE is active, the busy bit can
> remain set for up to approximately 300ms. The new 500ms timeout provides
> a safety margin.
>
> This modification does not impact normal success path, as the function
> typically returns within 1µs in non-EEE scenarios. The extended timeout
> only affects the failure path.
>
> Fixes: ed64639bc1e0 ("net: stmmac: Add support for VLAN Rx filtering")
> Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Hi Shenwei Wang,
It looks like this function now uses udelay() to busy-wait for up to 500ms.
But 500ms, or indeed 300ms, seems like a long time to tie down a core. I
wonder if some other sort of mechanism, f.e. involving msleep or delayed
work, should be considered.
...
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-18 8:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-17 16:42 [PATCH net] net: stmmac: dwmac4: extend timeout for VLAN Tag register busy bit check Shenwei Wang
2024-09-18 8:16 ` Simon Horman
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).