From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Fabio Estevam <festevam@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
edumazet <edumazet@google.com>, netdev <netdev@vger.kernel.org>,
Andrew Lunn <andrew@lunn.ch>
Subject: Re: LAN8720: RX errors / packet loss when using smsc PHY driver on i.MX6Q
Date: Sat, 15 Nov 2025 21:37:56 +0000 [thread overview]
Message-ID: <aRjytF103DHLnmEQ@shell.armlinux.org.uk> (raw)
In-Reply-To: <CAOMZO5CbNEspuYTUVfMysNkzzMXgTZaRxCTKSXfT0=WmoK=i5Q@mail.gmail.com>
On Sat, Nov 15, 2025 at 06:01:38PM -0300, Fabio Estevam wrote:
> Hi Heiner,
>
> On Fri, Nov 14, 2025 at 6:33 PM Heiner Kallweit <hkallweit1@gmail.com> wrote:
>
> > The smsc PHY driver for LAN8720 has a number of callbacks and flags.
> > Try commenting them out one after the other until it works.
> >
> > .read_status = lan87xx_read_status,
> > .config_init = smsc_phy_config_init,
> > .soft_reset = smsc_phy_reset,
> > .config_aneg = lan95xx_config_aneg_ext,
> > .suspend = genphy_suspend,
> > .resume = genphy_resume,
> > .flags = PHY_RST_AFTER_CLK_EN,
> >
> > All of them are optional. If all are commented out, you should have
> > the behavior of the genphy driver.
> >
> > Once we know which callback is problematic, we have a starting point.
>
> Thanks for the suggestion.
>
> After removing the '.soft_reset = smsc_phy_reset,' line, there is no
> packet loss anymore.
>
> If you have any other suggestions regarding smsc_phy_reset(), please
> let me know.
What happens if you replace this with genphy_soft_reset() ?
Is the hardware reset signal wired on this PHY, and does the kernel
control the hardware reset?
I note that phy_init_hw() will deassert the hardware reset, and with
.soft_reset populated, we will immediately thump the PHY with a
soft reset unless a reset_deassert_delay is specified (e.g. via DT
reset-deassert-us prioerty). This is probably not a good idea if the
PHY is still recovering from hardware reset.
For reference, LAN8720 requires a minimum period of 100µs for hardware
reset assertion, and then between 2 and 800ns before the PHY starts
driving the configuration pin outputs. This _probably_ (it's not
specified) means we shouldn't be talking to the PHY for approx. the
first 1µs.
Finally, and this is probably not relevant given that the PHY works
with the genphy driver, the PHY requires the XTAL1/CLKIN to be running
during a hardware reset.
This is from https://ww1.microchip.com/downloads/aemDocuments/documents/UNG/ProductDocuments/DataSheets/LAN8720A-LAN8720Ai-Data-Sheet-DS00002165.pdf
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2025-11-15 21:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 22:25 LAN8720: RX errors / packet loss when using smsc PHY driver on i.MX6Q Fabio Estevam
2025-11-13 22:35 ` Andrew Lunn
2025-11-14 21:15 ` Fabio Estevam
2025-11-14 21:33 ` Heiner Kallweit
2025-11-14 21:48 ` Florian Fainelli
2025-11-14 22:48 ` Andrew Lunn
2025-11-15 21:01 ` Fabio Estevam
2025-11-15 21:26 ` Heiner Kallweit
2025-11-15 21:54 ` Fabio Estevam
2025-11-15 22:01 ` Russell King (Oracle)
2025-11-15 22:25 ` Fabio Estevam
2025-11-15 21:37 ` Russell King (Oracle) [this message]
2025-11-16 0:57 ` Fabio Estevam
2025-11-16 2:14 ` Fabio Estevam
2025-11-16 15:55 ` Andrew Lunn
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=aRjytF103DHLnmEQ@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=edumazet@google.com \
--cc=festevam@gmail.com \
--cc=hkallweit1@gmail.com \
--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).