diff options
author | qwx495460 <qwx495460@notesmail.huawei.com> | 2019-04-23 15:09:29 +0800 |
---|---|---|
committer | Haojian Zhuang <haojian.zhuang@linaro.org> | 2019-04-23 15:30:48 +0800 |
commit | 2b8913bcfe520e806c506a807f50be2c4d8ccb37 (patch) | |
tree | 3dd900b9a4b26baf7d07b54e0fa7029ba4deef40 | |
parent | 339710e86ef2495d3ab72a3333e054b3f21afb3c (diff) | |
download | OpenPlatformPkg-upstream-hikey-aosp.tar.gz |
Drivers/DwUfsHcDxe: add memory barrierupstream-hikey-aosp
UFS device couldn't be initialized by UEFI on some HiKey960 platforms
if it's built in release mode. Since UFS device is not initialized
successfully, UEFI couldn't read any valuable data from UFS device.
Then it hangs.
After adding memory barrier, UFS device could be initialized successfully.
So this issue may be related to instructions out of order by CPU
optimization.
Signed-off-by: qwx495460 <qwx495460@notesmail.huawei.com>
Signed-off-by: Baopeng Feng <fengbaopeng2@hisilicon.com>
Signed-off-by: Li Wei <liwei213@huawei.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
-rw-r--r-- | Drivers/Block/DwUfsHcDxe/DwUfsHcDxe.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Drivers/Block/DwUfsHcDxe/DwUfsHcDxe.c b/Drivers/Block/DwUfsHcDxe/DwUfsHcDxe.c index 4334269..3f0ac6f 100644 --- a/Drivers/Block/DwUfsHcDxe/DwUfsHcDxe.c +++ b/Drivers/Block/DwUfsHcDxe/DwUfsHcDxe.c @@ -348,6 +348,8 @@ UfsHcMmioRead ( Private = UFS_HOST_CONTROLLER_PRIVATE_DATA_FROM_UFSHC (This);
+ MemoryFence ();
+
switch (Width) {
case EfiUfsHcWidthUint8:
for (Index = 0; Index < Count; Index++) {
@@ -373,6 +375,8 @@ UfsHcMmioRead ( return EFI_INVALID_PARAMETER;
}
+ MemoryFence ();
+
return EFI_SUCCESS;
}
@@ -410,6 +414,8 @@ UfsHcMmioWrite ( Private = UFS_HOST_CONTROLLER_PRIVATE_DATA_FROM_UFSHC (This);
+ MemoryFence ();
+
switch (Width) {
case EfiUfsHcWidthUint8:
for (Index = 0; Index < Count; Index++) {
@@ -435,6 +441,8 @@ UfsHcMmioWrite ( return EFI_INVALID_PARAMETER;
}
+ MemoryFence ();
+
return Status;
}
|