MdeModulePkg: SataControllerSupported checks DevicePath Protocol

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4858

Ph52a PCIE to SATA card inserted on Intel MTL/ARL causes system hanged.

Root cause of this issue is because Ph52a's driver only uses DevicePath
protocol alone and EDK2 driver only uses PciIo protocol alone. Both
drivers start and try to manage SATA controller.

Signed-off-by: Paul Chang <paulchang@ami.com>
This commit is contained in:
Paul Chang 2024-10-28 15:53:25 +08:00 committed by mergify[bot]
parent d13f31c3fe
commit a9901a7748
3 changed files with 31 additions and 3 deletions

View File

@ -287,9 +287,35 @@ SataControllerSupported (
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
{
EFI_STATUS Status;
EFI_PCI_IO_PROTOCOL *PciIo;
PCI_TYPE00 PciData;
EFI_STATUS Status;
EFI_PCI_IO_PROTOCOL *PciIo;
PCI_TYPE00 PciData;
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
//
// Attempt to open DevicePath Protocol
//
Status = gBS->OpenProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
(VOID *)&ParentDevicePath,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
return Status;
}
///
/// Close the protocol because we don't use it here
///
gBS->CloseProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
This->DriverBindingHandle,
Controller
);
//
// Attempt to open PCI I/O Protocol

View File

@ -18,6 +18,7 @@
#include <Protocol/DriverBinding.h>
#include <Protocol/PciIo.h>
#include <Protocol/IdeControllerInit.h>
#include <Protocol/DevicePath.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>

View File

@ -45,6 +45,7 @@
[Protocols]
gEfiPciIoProtocolGuid ## TO_START
gEfiIdeControllerInitProtocolGuid ## BY_START
gEfiDevicePathProtocolGuid
[UserExtensions.TianoCore."ExtraFiles"]
SataControllerDxeExtra.uni