Banana Pi, Kernel 5.9, packet loss and bad network connectivity

194 views
Skip to first unread message

Marc Haber

unread,
Oct 15, 2020, 3:11:44 PM10/15/20
to linux-sunxi
Hi,

when I boot my Banana Pi (with Debian buster installed) with kernel 5.9,
the network interface doesn't work too well. Packet loss of more than
50 %, machine nearly unuseable. Going back to 5.8.13 fixes the issue,
going forward to 5.9 again makes the issue reappear.

Does anybody have a good guess what to try first before going the
"implant 5.8.13 stmmac driver to 5.9, maybe bisect" route?

Greetings
Marc

--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany | lose things." Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421

Jernej Škrabec

unread,
Oct 15, 2020, 3:18:21 PM10/15/20
to linux-sunxi, mh+linu...@zugschlus.de
Hi!

Dne četrtek, 15. oktober 2020 ob 21:11:39 CEST je Marc Haber napisal(a):
> Hi,
>
> when I boot my Banana Pi (with Debian buster installed) with kernel 5.9,
> the network interface doesn't work too well. Packet loss of more than
> 50 %, machine nearly unuseable. Going back to 5.8.13 fixes the issue,
> going forward to 5.9 again makes the issue reappear.
>
> Does anybody have a good guess what to try first before going the
> "implant 5.8.13 stmmac driver to 5.9, maybe bisect" route?

Try to revert https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
linux.git/commit/?h=v5.9&id=bbc4d71d63549bcd003a430de18a72a742d8c91e

This commit was found to cause issue on Beelink GS1 (Allwinner H6) which has
RTL8211e PHY. Since Banana Pi have same PHY, it might cause issue there too.

Best regards,
Jernej

>
> Greetings
> Marc
>
> --
>
-----------------------------------------------------------------------------
> Marc Haber | "I don't trust Computers. They | Mailadresse im Header
> Leimen, Germany | lose things." Winona Ryder | Fon: *49 6224 1600402
> Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421
>
> --
> You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to linux-sunxi...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/
linux-sunxi/20201015191139.GP32306%40torres.zugschlus.de.
>


Marc Haber

unread,
Oct 16, 2020, 2:44:44 PM10/16/20
to Jernej Škrabec, linux-sunxi
Hi Jernej,

On Thu, Oct 15, 2020 at 09:23:37PM +0200, Jernej Škrabec wrote:
> Dne četrtek, 15. oktober 2020 ob 21:11:39 CEST je Marc Haber napisal(a):
> > when I boot my Banana Pi (with Debian buster installed) with kernel 5.9,
> > the network interface doesn't work too well. Packet loss of more than
> > 50 %, machine nearly unuseable. Going back to 5.8.13 fixes the issue,
> > going forward to 5.9 again makes the issue reappear.
> >
> > Does anybody have a good guess what to try first before going the
> > "implant 5.8.13 stmmac driver to 5.9, maybe bisect" route?
>
> Try to revert https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
> linux.git/commit/?h=v5.9&id=bbc4d71d63549bcd003a430de18a72a742d8c91e
>
> This commit was found to cause issue on Beelink GS1 (Allwinner H6) which has
> RTL8211e PHY. Since Banana Pi have same PHY, it might cause issue there too.

Reverting this commit does actually help here. Will there be a fix in
Greg's kernel releases?

Thank you for helping!

Jernej Škrabec

unread,
Oct 16, 2020, 3:08:12 PM10/16/20
to linux...@googlegroups.com, linux-sunxi, mh+linu...@zugschlus.de
Dne petek, 16. oktober 2020 ob 20:44:38 CEST je Marc Haber napisal(a):
> Hi Jernej,
>
> On Thu, Oct 15, 2020 at 09:23:37PM +0200, Jernej Škrabec wrote:
> > Dne četrtek, 15. oktober 2020 ob 21:11:39 CEST je Marc Haber napisal(a):
> > > when I boot my Banana Pi (with Debian buster installed) with kernel 5.9,
> > > the network interface doesn't work too well. Packet loss of more than
> > > 50 %, machine nearly unuseable. Going back to 5.8.13 fixes the issue,
> > > going forward to 5.9 again makes the issue reappear.
> > >
> > > Does anybody have a good guess what to try first before going the
> > > "implant 5.8.13 stmmac driver to 5.9, maybe bisect" route?
> >
> > Try to revert https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
> > linux.git/commit/?h=v5.9&id=bbc4d71d63549bcd003a430de18a72a742d8c91e
> >
> > This commit was found to cause issue on Beelink GS1 (Allwinner H6) which
> > has RTL8211e PHY. Since Banana Pi have same PHY, it might cause issue
> > there too.
> Reverting this commit does actually help here. Will there be a fix in
> Greg's kernel releases?

I have no clue. I don't have any problematic board, I just spotted commit when
rebasing my kernel and suggested as a possible reason. I suggest that you
contact all people involved in that commit (including relevant mailing lists)
and explain the issue. Given that this commit is the fix, it's possible that it
just uncovered another issue.

Best regards,
Jernej

Chen-Yu Tsai

unread,
Oct 19, 2020, 12:14:46 AM10/19/20
to Jernej Skrabec, linux-sunxi, mh+linu...@zugschlus.de
The proper fix now is to check the schematics, and change the phy-mode property
to the correct type. It used to be that we used "rgmii" for all RGMII PHYs.

Turns out there are four modes of RGMII, depending on whether the MAC or PHY
enable TX / RX signal delays.

Most boards in sunxi are designed so that the PHY is providing both TX and RX
delays, which is done by pulling up the TXDLY and RXDLY pins at power up.

The commit "net: phy: realtek: fix rtl8211e rx/tx delay config" fixes the PHY
driver so that it will correctly "reconfigure" the PHY to the requested mode.
Previously this was not happening due to incorrect register definitions.

To summarize, the PHY driver fix exposes errors in our DTs.


Regards
ChenYu

JuanEsf

unread,
Oct 19, 2020, 5:22:28 PM10/19/20
to linux-sunxi
Hi!
In BananaPi-M2 Ultra also the problem occurred when updating to the kernel. but I can't establish a connection

Marc Haber

unread,
Nov 8, 2020, 9:44:59 AM11/8/20
to Chen-Yu Tsai, Jernej Skrabec, linux-sunxi, Maxime Ripard
On Mon, Oct 19, 2020 at 12:14:29PM +0800, Chen-Yu Tsai wrote:
> The proper fix now is to check the schematics, and change the phy-mode property
> to the correct type. It used to be that we used "rgmii" for all RGMII PHYs.
>
> Turns out there are four modes of RGMII, depending on whether the MAC or PHY
> enable TX / RX signal delays.
>
> Most boards in sunxi are designed so that the PHY is providing both TX and RX
> delays, which is done by pulling up the TXDLY and RXDLY pins at power up.
>
> The commit "net: phy: realtek: fix rtl8211e rx/tx delay config" fixes the PHY
> driver so that it will correctly "reconfigure" the PHY to the requested mode.
> Previously this was not happening due to incorrect register definitions.
>
> To summarize, the PHY driver fix exposes errors in our DTs.

The Banana Pi still doesn't work properly in kernel 5.9.6. I am not in
a position to check schematics and to fix DTs.

Look at git log for arch/arm/boot/dts/sun7i-a20-bananapi.dts, that would
be you, Chen-Yu Tsai and Maxime Ripard.

Is there anything I can do to help debugging?

Jernej Škrabec

unread,
Nov 8, 2020, 9:55:57 AM11/8/20
to Chen-Yu Tsai, linux...@googlegroups.com, linux-sunxi, Maxime Ripard, mh+linu...@zugschlus.de
Dne nedelja, 08. november 2020 ob 15:44:54 CET je Marc Haber napisal(a):
> On Mon, Oct 19, 2020 at 12:14:29PM +0800, Chen-Yu Tsai wrote:
> > The proper fix now is to check the schematics, and change the phy-mode
> > property to the correct type. It used to be that we used "rgmii" for all
> > RGMII PHYs.
> >
> > Turns out there are four modes of RGMII, depending on whether the MAC or
> > PHY enable TX / RX signal delays.
> >
> > Most boards in sunxi are designed so that the PHY is providing both TX and
> > RX delays, which is done by pulling up the TXDLY and RXDLY pins at power
> > up.
> >
> > The commit "net: phy: realtek: fix rtl8211e rx/tx delay config" fixes the
> > PHY driver so that it will correctly "reconfigure" the PHY to the
> > requested mode. Previously this was not happening due to incorrect
> > register definitions.
> >
> > To summarize, the PHY driver fix exposes errors in our DTs.
>
> The Banana Pi still doesn't work properly in kernel 5.9.6. I am not in
> a position to check schematics and to fix DTs.

Discussion of proper way of handling this breakage is still ongoing between
maintainers.

>
> Look at git log for arch/arm/boot/dts/sun7i-a20-bananapi.dts, that would
> be you, Chen-Yu Tsai and Maxime Ripard.
>
> Is there anything I can do to help debugging?

Everything about this issue is known. In the meantime, you can use any of
these workarounds/fixes:

1. Apply DT fix: https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/
linux.git/commit/?h=sunxi/fixes-
for-5.10&id=8c9cb4094ccf242eddd140efba13872c55f68a87
2. Revert commit bbc4d71d63549bcd003a430de18a72a742d8c91e
3. disable Realtek PHY driver in your kernel. It should still work trough
generic PHY driver.

Best regards,
Jernej




Chen-Yu Tsai

unread,
Nov 8, 2020, 10:17:36 PM11/8/20
to JuanEsf, linux-sunxi
For this board, there is another issue regarding regulators.
The fix is still being discussed. See

https://lore.kernel.org/lkml/20201021183149.GA8436@Red/t/
> --
> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/83697565-cbff-4198-8a9b-12d2a7fb133en%40googlegroups.com.

JuanEsf

unread,
Nov 9, 2020, 10:34:42 AM11/9/20
to linux-sunxi
hi, i applied the same fix in u-boot for M2-Ultra (R40). I have compiled and copied u-boot and now it works without problems.

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/diff/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts?h=next-20201109&id=f613d2e880d29b9d16eea70043c0a631f7c0479b

Marc Haber

unread,
Nov 12, 2020, 6:06:47 AM11/12/20
to Jernej Škrabec, Chen-Yu Tsai, linux...@googlegroups.com, Maxime Ripard
On Sun, Nov 08, 2020 at 03:55:49PM +0100, Jernej Škrabec wrote:
> 1. Apply DT fix: https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/
> linux.git/commit/?h=sunxi/fixes-

I can confirm that this one-liner fixes the issue on my Banana Pis.
Reply all
Reply to author
Forward
0 new messages