MdeModulePkg/Bus/Ata/AhciPei/AhciPeiPassThru.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
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
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105204): https://edk2.groups.io/g/devel/message/105204
Mute This Topic: https://groups.io/mt/99093106/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
[AMD Official Use Only - General] Hi Neo, I don't see you add the maintainers either in commit message or email CC list. I added them. To this patch, Acked-by: Abner Chang <abner.chang@amd.com> Thanks Abner > -----Original Message----- > From: Hsueh, Hong-Chih (Neo) <Hong-Chih.Hsueh@amd.com> > Sent: Wednesday, May 24, 2023 1:07 AM > To: devel@edk2.groups.io > Cc: He, Jiangang <Jiangang.He@amd.com>; Chang, Abner > <Abner.Chang@amd.com>; Hsueh, Hong-Chih (Neo) <Hong- > Chih.Hsueh@amd.com> > Subject: [PATCH] MdeModulePkg: Fix port multiplier port in AhciPei PEIM > > 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 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105208): https://edk2.groups.io/g/devel/message/105208 Mute This Topic: https://groups.io/mt/99093106/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2023 Red Hat, Inc.