Netdev List
 help / color / mirror / Atom feed
From: Nicolai Buchwitz <nb@tipi-net.de>
To: Sven Schuchmann <schuchmann@schleissheimer.de>
Cc: Thangaraj Samynathan <Thangaraj.S@microchip.com>,
	Rengarajan Sundararajan <Rengarajan.S@microchip.com>,
	UNGLinuxDriver@microchip.com, Woojung.Huh@microchip.com,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: AW: AW: AW: [PATCH net] net: usb: lan78xx: restore VLAN filter table after device reset
Date: Fri, 19 Jun 2026 16:01:49 +0200	[thread overview]
Message-ID: <f76711d2f45c527f9ce0f5d288631bc6@tipi-net.de> (raw)
In-Reply-To: <BEZP281MB224523ADACDB48D8E3974D4AD9E22@BEZP281MB2245.DEUP281.PROD.OUTLOOK.COM>

Hi Sven

On 19.6.2026 15:31, Sven Schuchmann wrote:
> Hello Nicolai,
> 
> looks good from my point of view
> (Calling the lan78xx_write_vlan_table() from
> lan78xx_mac_link_up() and from lan78xx_reset()).

Thanks.

> But I investigated a little more and it seems the hash table
> (which is right behind the vlan table in the controllers memory)
> also gets cleared. I wrote some random data into this table and have
> seen that it gets also cleared. I think this needs to be fixed too.

Something like

static int lan78xx_write_mchash_table(struct lan78xx_net *dev)
{
        struct lan78xx_priv *pdata = (struct lan78xx_priv 
*)(dev->data[0]);

        return lan78xx_dataport_write(dev, DP_SEL_RSEL_VLAN_DA_,
                                      DP_SEL_VHF_VLAN_LEN,
                                      DP_SEL_VHF_HASH_LEN, 
pdata->mchash_table); // from lan78xx_deferred_multicast_write)
}

with callers in lan78xx_deferred_multicast_write() and 
lan78xx_mac_link_up(), should
do the trick?

> 
> In the Datasheet from the LAN7801 I can read:
> "After a reset event, the RFE will automatically initialize the 
> contents of the VHF to 0h."
> Where VHF also refers to the hash table.
> But I still do not understand what reset is happening when I just 
> unplug the network cable....

I suspect it is triggered from the PHY:

8.10 (MAC Reset Watchdog Timer):
"A portion of the MAC operates on clocks generated by the Ethernet PHY 
[...] PHY Reset
(PHY_RST) results in resetting the portion of the MAC operating on the 
PHY receive and
transmit clocks."

So which PHY are you using?

> [...]

Thanks,
Nicolai

      reply	other threads:[~2026-06-19 14:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 19:11 [PATCH net] net: usb: lan78xx: restore VLAN filter table after device reset Nicolai Buchwitz
2026-06-19  8:11 ` AW: " Sven Schuchmann
2026-06-19  8:30   ` Nicolai Buchwitz
2026-06-19  9:18     ` AW: " Sven Schuchmann
2026-06-19  9:53       ` Nicolai Buchwitz
2026-06-19 13:31         ` AW: " Sven Schuchmann
2026-06-19 14:01           ` Nicolai Buchwitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f76711d2f45c527f9ce0f5d288631bc6@tipi-net.de \
    --to=nb@tipi-net.de \
    --cc=Rengarajan.S@microchip.com \
    --cc=Thangaraj.S@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=schuchmann@schleissheimer.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox