summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro Falcato <pedro.falcato@gmail.com>2023-06-01 18:27:30 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-06-01 18:08:33 +0000
commit897a2b447e0f71eb0d102ad707f3688c102d9cec (patch)
tree88ddfb1c63b123cba5e04395f14b775104ce988e
parent5e8958472c45bb31bfa249cf8e4c5a94c9f81839 (diff)
downloadedk2-897a2b447e0f71eb0d102ad707f3688c102d9cec.tar.gz
edk2-897a2b447e0f71eb0d102ad707f3688c102d9cec.tar.bz2
edk2-897a2b447e0f71eb0d102ad707f3688c102d9cec.zip
MdeModulePkg/SataControllerDxe: Log expected errors at DEBUG_INFO level
When a UEFI_DRIVER attempts to open a protocol interface with BY_DRIVER attribute that it already has open with BY_DRIVER attribute, OpenProtocol() returns EFI_ALREADY_STARTED. This is not an error. The UEFI-2.7 spec currently says, > EFI_ALREADY_STARTED -- Attributes is BY_DRIVER and there is an item on > the open list with an attribute of BY_DRIVER > whose agent handle is the same as AgentHandle. Downgrade the log mask for this one condition to DEBUG_INFO, in SataControllerStart(). This will match the log mask of the other two informative messages in this function. (ported from commit 5dfba97) Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
-rw-r--r--MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c
index d67a3e69f6..277bc6182d 100644
--- a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c
+++ b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c
@@ -358,10 +358,12 @@ SataControllerStart (
UINTN TotalCount;
UINT64 Supports;
UINT8 MaxPortNumber;
+ UINTN BailLogMask;
DEBUG ((DEBUG_INFO, "SataControllerStart start\n"));
- Private = NULL;
+ Private = NULL;
+ BailLogMask = DEBUG_ERROR;
//
// Now test and open PCI I/O Protocol
@@ -375,6 +377,15 @@ SataControllerStart (
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
+ if (Status == EFI_ALREADY_STARTED) {
+ //
+ // This is an expected condition for OpenProtocol() / BY_DRIVER, in a
+ // DriverBindingStart() member function; degrade the log mask to
+ // DEBUG_INFO in order to reduce log pollution.
+ //
+ BailLogMask = DEBUG_INFO;
+ }
+
goto Bail;
}
@@ -555,7 +566,7 @@ FreeSataPrivate:
ClosePciIo:
gBS->CloseProtocol (Controller, &gEfiPciIoProtocolGuid, This->DriverBindingHandle, Controller);
Bail:
- DEBUG ((DEBUG_ERROR, "SataControllerStart error return status = %r\n", Status));
+ DEBUG ((BailLogMask, "SataControllerStart error return status = %r\n", Status));
return Status;
}