netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Schuchmann <schuchmann@schleissheimer.de>
To: "Woojung.Huh@microchip.com" <Woojung.Huh@microchip.com>,
	"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: usb: lan78xx: Problem with ERR_STS
Date: Tue, 23 Feb 2021 06:54:57 +0000	[thread overview]
Message-ID: <DB8P190MB0634AA6DFAEAD1D235F6AD7FD9809@DB8P190MB0634.EURP190.PROD.OUTLOOK.COM> (raw)

Hello,

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: schuchmann@schleissheimer.de

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


                 reply	other threads:[~2021-02-23  6:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=DB8P190MB0634AA6DFAEAD1D235F6AD7FD9809@DB8P190MB0634.EURP190.PROD.OUTLOOK.COM \
    --to=schuchmann@schleissheimer.de \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).