Re: AW: [PATCH net] net: usb: lan78xx: restore VLAN filter table after device reset
From: Nicolai Buchwitz
Date: Fri Jun 19 2026 - 04:30:54 EST
Hi Sven
On 19.6.2026 10:11, Sven Schuchmann wrote:
Hello Nicolai,
thank you for the quick response and the quick patch!
But actually it is not working for me... If I disconnect and connect
the LAN Cable (I have setup an automated test already with two adapters
connected to my RaspberryPi CM5) the lan78xx_reset() function is not called.
Here is a dmesg output from my test.
I defined DEBUG at the beginning of the driver and added
netdev_info(dev->net, "function()"); to nearly every function
in the driver. Also I added my a VLAN compare function:
static void lan78xx_check_vlan_table(struct net_device *netdev)
{
struct lan78xx_net *dev = netdev_priv(netdev);
struct lan78xx_priv *pdata = (struct lan78xx_priv *)(dev->data[0]);
for (int i = 0; i < 1; i++) {
u32 buf;
lan78xx_dataport_read(dev, DP_SEL_RSEL_VLAN_DA_, i, 1, &buf);
if (pdata->vlan_table[i] != buf)
netdev_err(dev->net, "VLAN TABLE %d: 0x%02x 0x%02x - ERROR", i, pdata->vlan_table[i], buf);
else
netdev_info(dev->net, "VLAN TABLE %d: 0x%02x 0x%02x - Ok", i, pdata->vlan_table[i], buf);
}
}
I call this at the end of lan78xx_start_rx_path() and lan78xx_mac_link_up().
I now I get this output. The output ends after 16 disconnects and connects.
Then it is broken. What I am wondering is what is happening after
lan78xx_start_rx_path() that destroys the table...
[...]
Can you please try with the following changes to lan78xx_mac_reset()?
ret = lan78xx_stop_rx_path(dev);
if (ret < 0)
goto link_down_fail;
- /* MAC reset seems to not affect MAC configuration, no idea if it is
- * really needed, but it was done in previous driver version. So, leave
- * it here.
- */
- ret = lan78xx_mac_reset(dev);
- if (ret < 0)
- goto link_down_fail;
-
return;
BR
Nicolai
self NACK (or whatever it takes to withdraw this patch for now)