On Mon, May 09, 2016 at 07:02:16PM +0100, Ryan Harkin wrote: > On 9 May 2016 at 11:07, Ryan Harkin <[email protected]> wrote: > > On 9 May 2016 at 10:22, Mark Rutland <[email protected]> wrote: > >> On Sat, May 07, 2016 at 10:43:45AM +0200, Ard Biesheuvel wrote: > >>> On 6 May 2016 at 19:19, Mark Rutland <[email protected]> wrote: > >>> > The LAN9118 driver uses memory fences in a novel but erroneous fashion, > >>> > due to > >>> > a misunderstanding of some under-commented code. This series fixes these > >>> > erroneous uses, documenting the unusual requirements of the LAN9118 > >>> > chip that > >>> > lead us to this situation, and introduces new helpers to handle this in > >>> > a more > >>> > consistent fashion. > >>> > > >>> > The LAN9118 datasheet is publicly available at: > >>> > > >>> > http://www.microchip.com/wwwproducts/en/LAN9118 > >>> > > >>> > >>> Thanks a lot for getting to the bottom of this! I particularly like > >>> the way how you folded the required delays into the MMIO read/write > >>> functions, which makes the top level code a lot cleaner. > >>> > >>> I can't test this, but the code looks fine to me. > >>> > > > > I'll test it later today on TC2 and Juno R0/1/2. But I like the look > > of it, it seems like a huge improvement. > > > > This seems to work on TC2 and Juno R0, R1 and R2, although I'm not > 100% sure it's reliable, so I need to do more testing. > > When attempting to install debian over the network, my Juno R1 has > just reported: > > LAN9118: There was an error transmitting. TxStatus=0x00008401:- No carrier > - Packet tx was deferred > > The 2nd attempt seems to be working fine. Juno R0 and R2 seem happy enough.
I suspect you're hitting the latent, intermittent issue with full duplex operation that I mentioned in my other reply. This occurs without these patches, and was what I was trying to fix when I noticed the suspicious barrier usage. If you early return from AutoNegotiate (e.g. because the timeout is short enough), or remove the full duplex bits from the Feature register, this works, this issue does not manifest (at least in my experience), as the HW will auto-negotiate a half-duplex connection anyway. Evidently, we don't have a good test case for this. I've found that it's fairly reproducable when using TFTP from GRUB (using SNP). Thanks, Mark. _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

