audk/EmbeddedPkg
Ryan Harkin a4626006bb 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 <ryan.harkin@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2016-02-10 17:56:39 +01:00
..
Application/AndroidFastboot EmbeddedPkg/AndroidFastboot: drop bogus ArmGlobalVariable dependencies 2015-11-27 17:07:54 +00:00
Drivers EmbeddedPkg/Lan9118Dxe: use MemoryFence 2016-02-10 17:56:39 +01:00
Ebl EmbeddedPkg: Add EFIAPI to several Ebl functions 2015-10-29 12:59:06 +00:00
EblExternCmd ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
EmbeddedMonotonicCounter ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
GdbStub ARM Packages: Replace tabs by spaces for indentation 2014-08-26 10:14:17 +00:00
Include EmbeddedPkg: Rectify file modes 2016-02-02 11:42:51 +00:00
Library EmbeddedPkg: Rectify file modes 2016-02-02 11:42:51 +00:00
MetronomeDxe ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
RealTimeClockRuntimeDxe ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
ResetRuntimeDxe ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
Scripts/LauterbachT32 EmbeddedPkg: Rectify file modes 2016-02-02 11:42:51 +00:00
SimpleTextInOutSerial ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
TemplateSec ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
Universal/MmcDxe EmbeddedPkg: Remove dependency on TimerLib 2015-05-06 11:15:44 +00:00
Contributions.txt */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
EmbeddedPkg.dec EmbeddedPkg: Added SATA Silicon Image driver 2015-05-11 17:50:27 +00:00
EmbeddedPkg.dsc EmbeddedPkg: Remove SerialDxe and SerialPortExtLib libraries 2015-11-26 08:52:58 +00:00
EmbeddedPkg.fdf ARM Packages: Removed trailing spaces 2014-08-19 13:29:52 +00:00
License.txt EmbeddedPkg: Rectify file modes 2016-02-02 11:42:51 +00:00