net: stmmac: dwmac4: extend timeout for VLAN Tag register busy bit check
BugLink: https://bugs.launchpad.net/bugs/2089884
[ Upstream commit 4c1b56671b68ffcbe6b78308bfdda6bcce6491ae ]
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.
Fixes: ed64639bc1 ("net: stmmac: Add support for VLAN Rx filtering")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Link: https://patch.msgid.link/20240924205424.573913-1-shenwei.wang@nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
This commit is contained in:
committed by
Mehmet Basaran
parent
75f1a517e7
commit
06091cb160
@@ -14,6 +14,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/ethtool.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include "stmmac.h"
|
||||
#include "stmmac_pcs.h"
|
||||
#include "dwmac4.h"
|
||||
@@ -475,7 +476,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 ret;
|
||||
u32 val;
|
||||
|
||||
if (index >= hw->num_vlan)
|
||||
@@ -491,16 +492,15 @@ static int dwmac4_write_vlan_filter(struct net_device *dev,
|
||||
|
||||
writel(val, ioaddr + GMAC_VLAN_TAG);
|
||||
|
||||
for (i = 0; i < timeout; i++) {
|
||||
val = readl(ioaddr + GMAC_VLAN_TAG);
|
||||
if (!(val & GMAC_VLAN_TAG_CTRL_OB))
|
||||
return 0;
|
||||
udelay(1);
|
||||
ret = readl_poll_timeout(ioaddr + GMAC_VLAN_TAG, val,
|
||||
!(val & GMAC_VLAN_TAG_CTRL_OB),
|
||||
1000, 500000);
|
||||
if (ret) {
|
||||
netdev_err(dev, "Timeout accessing MAC_VLAN_Tag_Filter\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
netdev_err(dev, "Timeout accessing MAC_VLAN_Tag_Filter\n");
|
||||
|
||||
return -EBUSY;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dwmac4_add_hw_vlan_rx_fltr(struct net_device *dev,
|
||||
|
||||
Reference in New Issue
Block a user