public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg: Fix port multiplier port in AhciPei PEIM
@ 2023-05-23 17:07 Neo Hsueh
  2023-05-24  0:33 ` Chang, Abner
  2023-05-31  3:29 ` [edk2-devel] " Wu, Hao A
  0 siblings, 2 replies; 12+ messages in thread
From: Neo Hsueh @ 2023-05-23 17:07 UTC (permalink / raw)
  To: devel; +Cc: jiangang.he, abner.chang, Neo Hsueh

If there is no port multiplier, PortMultiplierPort should be converted
to 0 to follow AHCI spec.
The same logic already applied in AtaAtapiPassThruDxe driver.

Signed-off-by: Neo Hsueh <Hong-Chih.Hsueh@amd.com>
---
 MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c
index cd55272c96..7bd04661d0 100644
--- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c
+++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c
@@ -3,6 +3,7 @@
   mode at PEI phase.
 
   Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -92,6 +93,15 @@ AhciPassThruExecute (
 {
   EFI_STATUS  Status;
 
+  if (PortMultiplierPort == 0xFFFF) {
+    //
+    // If there is no port multiplier, PortMultiplierPort will be 0xFFFF
+    // according to UEFI spec. Here, we convert its value to 0 to follow
+    // AHCI spec.
+    //
+    PortMultiplierPort = 0;
+  }
+
   switch (Packet->Protocol) {
     case EFI_ATA_PASS_THRU_PROTOCOL_ATA_NON_DATA:
       Status = AhciNonDataTransfer (
-- 
2.40.0.windows.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-06-07  3:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-23 17:07 [PATCH] MdeModulePkg: Fix port multiplier port in AhciPei PEIM Neo Hsueh
2023-05-24  0:33 ` Chang, Abner
2023-05-31  3:29 ` [edk2-devel] " Wu, Hao A
2023-05-31 14:48   ` He, Jiangang
2023-06-02  3:14     ` Wu, Hao A
2023-06-02 14:37       ` hong-chih.hsueh
2023-06-02 16:31         ` Chang, Abner
2023-06-02 18:11           ` Hsueh, Hong-Chih (Neo)
2023-06-05  4:31             ` Wu, Hao A
2023-06-06  2:24               ` Wu, Hao A
2023-06-06  7:20                 ` Chang, Abner
2023-06-07  3:21       ` Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox