Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: a4626006bbf86113453aeb7920895e66cdd04737
      
https://github.com/tianocore/edk2/commit/a4626006bbf86113453aeb7920895e66cdd04737
  Author: Ryan Harkin <[email protected]>
  Date:   2016-02-10 (Wed, 10 Feb 2016)

  Changed paths:
    M EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.c
    M EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118DxeUtil.c

  Log Message:
  -----------
  EmbeddedPkg/Lan9118Dxe: use MemoryFence

When reviewing my LAN9118 driver PCD patch [1], Ard Biesheuvel noted
that most calls to gBS->Stall() in this driver seem to be used to
prevent timing issues between the device updating data and the host
reading the values.  And that replacing most of these calls with a
MemoryFence() would be more robust.

The only exceptions are the stalls that are enclosed inside retry loops:

 - in the AutoNegotiate() function.
   This stall is waiting for the link to negotiate, which may require
   stalling until it is ready.

 - in the Lan9118Initialize() function.
   These two stalls are waiting for devices and time out after a number
   of retries.

 - in the SoftReset() function.
   This stall is inside a loop where the comment states:
   "If time taken exceeds 100us, then there was an error condition"

In these instances, I kept the stall, but also added a MemoryFence().

[1] http://article.gmane.org/gmane.comp.bios.edk2.devel/7389

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>


  Commit: b7b7fb3decf5fa5663ad34cbfc186a36d1f6a02c
      
https://github.com/tianocore/edk2/commit/b7b7fb3decf5fa5663ad34cbfc186a36d1f6a02c
  Author: Ryan Harkin <[email protected]>
  Date:   2016-02-10 (Wed, 10 Feb 2016)

  Changed paths:
    M EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
    M EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118DxeUtil.c
    M EmbeddedPkg/EmbeddedPkg.dec

  Log Message:
  -----------
  EmbeddedPkg/Lan9118Dxe: add PCD for negotiation timeout

Add a PCD for the link negotiation timeout so the platform can over-ride
the default value.

The code previously did 2000 iterations of the loop with a 2us stall, so
the code has been changed subtly to set the number of iterations equal
to the PCD value divided by the stall time.

Since the stall time has not changed, the default PCD value is set at
4000 so the original behaviour is not changed.

The problems were discovered when the ARM Juno Development Platform used
the "EFI Network" option with then LAN9118 driver.  It fails to boot the
first time and so the board drops back to Shell again:

  Warning: LAN9118 Driver in stopped state
  Link timeout in auto-negotiation.
  Lan9118: Auto Negociation not supported.
  EhcExecTransfer: transfer failed with 2
  EhcControlTransfer: error - Device Error, transfer - 2
  Buffer: EFI Hard Drive
  Booting EFI Misc Device
  Booting EFI Misc Device 1
  Booting EFI Hard Drive
  Booting EFI Network
  Warning: LAN9118 Driver not initialized
  Link timeout in auto-negotiation.
  Lan9118: Auto Negociation not supported.
  Booting EFI Internal Shell

Exiting Shell drops the user back to the Intel BDS UI.  Selecting
"Continue" then succeeds in booting from the EFI Network:

  Booting EFI Misc Device
  Booting EFI Misc Device 1
  Booting EFI Hard Drive
  Booting EFI Network
  ..MnpFreeTxBuf: Duplicated recycle report from SNP.
  MnpFreeTxBuf: Duplicated recycle report from SNP.
  [snip repeated errors]

Discussion on the edk2-devel mailing list [1] prompted Laszlo Ersek to
suggest the time taken for the NIC to negotiate was causing a problem.
He suggested the solution contained in this patch to provide a PCD
configurable by the platform.

The default PCD value does not work for Juno.  Setting the PCD to a
larger value works for Juno R0, R1 and R2.

[1] http://article.gmane.org/gmane.comp.bios.edk2.devel/7341

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>


  Commit: c64aa7c4091d63d85723aac728e0690d7bf98400
      
https://github.com/tianocore/edk2/commit/c64aa7c4091d63d85723aac728e0690d7bf98400
  Author: Ryan Harkin <[email protected]>
  Date:   2016-02-10 (Wed, 10 Feb 2016)

  Changed paths:
    M EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.c

  Log Message:
  -----------
  EmbeddedPkg/Lan9118Dxe: minor DEBUG tidyup

This patch makes a few minor DEBUG output changes:

- Fix typo in DEBUG output: Negociation->Negotiation

- Change DEBUG occurrences of "Lan9118" to "LAN9118" to make grepping
  the log output easier.

- Change the warning that auto-negotiation is not supported when
  AutoNegotiate() returns an error.
  The function already reports if the feature is supported or not and
  can also return an error for other reasons.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>


  Commit: bbff41c11fd374c7818c96f69c28b51c9caba619
      
https://github.com/tianocore/edk2/commit/bbff41c11fd374c7818c96f69c28b51c9caba619
  Author: Ryan Harkin <[email protected]>
  Date:   2016-02-10 (Wed, 10 Feb 2016)

  Changed paths:
    M EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118DxeUtil.c

  Log Message:
  -----------
  EmbeddedPkg/Lan9118Dxe: rename TimeOut to Retries

The variable TimeOut is actually a retry, not a timeout, so I renamed
the variable accordingly.

This patch makes no functional change.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>


Compare: https://github.com/tianocore/edk2/compare/7d0f92e8fd68...bbff41c11fd3
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to