Page MenuHomeFreeBSD

awg: Move MAC soft reset around to avoid soft reset timeout
ClosedPublic

Authored by kevans on Jan 15 2019, 2:50 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 13, 2:25 PM
Unknown Object (File)
Oct 31 2024, 5:12 AM
Unknown Object (File)
Sep 24 2024, 5:15 AM
Unknown Object (File)
Sep 22 2024, 7:01 AM
Unknown Object (File)
Sep 18 2024, 10:21 PM
Unknown Object (File)
Sep 8 2024, 9:36 AM
Unknown Object (File)
Sep 7 2024, 5:56 PM
Unknown Object (File)
Sep 7 2024, 4:55 PM
Subscribers

Details

Summary

From NetBSD: Since the MAC can get stuck in reset state with no link, ignore reset timeouts and continue with
initializing the device.

Fixes "soft reset timeout" issue at boot with no network cable plugged in.

awg_init may be called multiple times throughout normal interface usage, so the tx/rx descriptor base address registers must be written after each MAC reset and are moved as such.

This problem has been observed on FreeBSD, H3/H2+ devices with an internal phy (includes OrangePi R1, OrangePi One at least).

Obtained from: NetBSD

Test Plan

Test w/ OrangePi R1 as well as other boards not previously experiencing any issues.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 21973

Event Timeline

This revision is now accepted and ready to land.Jan 15 2019, 3:29 AM
sys/arm/allwinner/if_awg.c
798

Is this really needed ?
I don't really see how moving dma setup here change things.

sys/arm/allwinner/if_awg.c
798

Right, I kind of suspect it's not critical, but I didn't put much time into thinking about it since it was in jmcneill's commit and I think there's good value in staying relatively in-sync

Remove unrelated DMA change

This revision now requires review to proceed.Jan 15 2019, 2:53 PM
This revision is now accepted and ready to land.Jan 15 2019, 3:02 PM

Further testing reveals that awg doesn't consistently work without the removed DMA change. I don't know much about network drivers, but I suspect awg_init is being called multiple times and the soft reset wipes out EMAC_{TX,RX}_DMA_LIST. They aren't being reset in this path, only on attach.

kevans edited the summary of this revision. (Show Details)

Restore the original version; awg_init will be called as an interface is down'd and up'd throughout the course of normal usage that the MAC reset will wipe out these registers. Otherwise, you end up with a not-actually-stable awg interface.

This revision now requires review to proceed.Jan 15 2019, 9:35 PM

Restore the original version; awg_init will be called as an interface is down'd and up'd throughout the course of normal usage that the MAC reset will wipe out these registers. Otherwise, you end up with a not-actually-stable awg interface.

Ah ok, make sense now.
Thanks.

This revision is now accepted and ready to land.Jan 16 2019, 7:19 AM
This revision was automatically updated to reflect the committed changes.