netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* net: usb: lan78xx: Problem with ERR_STS
@ 2021-03-03 12:47 Sven Schuchmann
  0 siblings, 0 replies; only message in thread
From: Sven Schuchmann @ 2021-03-03 12:47 UTC (permalink / raw)
  To: Woojung.Huh, UNGLinuxDriver; +Cc: davem, netdev

Hello Woojung,

I am currently working on a project where we use a LAN7801
together with a DP83TC811R phy. The Problem is that if we change
link state of the phy to down and up again the LAN7801 is
not receiving anything anymore, while sending still works.

I already discussed this on the TI Forums
https://e2e.ti.com/support/interface/f/138/t/977492
but I still have no solution.

I placed the following code into lan78xx_link_status_change():

	ret = lan78xx_read_reg(dev, INT_STS, &buf);
	if (unlikely(ret < 0))
		return;

	if (buf & INT_STS_MAC_ERR_) {
		ret = lan78xx_read_reg(dev, ERR_STS, &buf);
		if (unlikely(ret < 0))
			return;

                netdev_err(dev->net, "MAC Error Interrupt, ERR_STS: 0x%08x\n", buf);

                ret = lan78xx_write_reg(dev, ERR_STS, 0x3FC);
                if (unlikely(ret < 0))
                        return;

                ret = lan78xx_write_reg(dev, INT_STS, INT_STS_MAC_ERR_);
                if (unlikely(ret < 0))
                        return;
	}


If the Link of the phy is going down I see the following output:

[  151.374983] lan78xx 1-1.4:1.0 broadr0: MAC Error Interrupt, ERR_STS: 0x00000308

So the lan7801 seems to detect an INT_STS_MAC_ERR error (where the contents of 
ERR_STS are not always the same). The Problem is now that the lan7801 does not 
receive anything from the phy anymore, whereas the phy sends valid data on RGMII 
if it goes up again. Strangely it is still possible to send data from lan7801, 
e.g. echo requests are still on the line, but response is not received.
The only way I can recover this state is unload/load the lan78xx driver.

Does anyone know how to recover the lan7801 to receive data again?
Any ideas in which registers/functions to look why rx is not working anymore?

Best Regards,


   Sven


Sven Schuchmann
Schleißheimer Soft- und
Hardwareentwicklung GmbH
Am Kalkofen 10
61206 Nieder-Wöllstadt
GERMANY
Phone: +49 6034 9148 711
Fax: +49 6034 9148 91
Email: mailto:schuchmann@schleissheimer.de

Court of Registration: Amtsgericht Friedberg
Registration Number: HRB 1581
Management Board:
Hans-Joachim Schleißheimer
Christine Schleißheimer

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-04  0:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 12:47 net: usb: lan78xx: Problem with ERR_STS Sven Schuchmann

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).