From: "Wu, Hao A" <hao.a.wu@intel.com>
To: Pedro Falcato <pedro.falcato@gmail.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Laszlo Ersek <lersek@redhat.com>,
"Wang, Jian J" <jian.j.wang@intel.com>,
"Gao, Liming" <gaoliming@byosoft.com.cn>,
"Ni, Ray" <ray.ni@intel.com>
Subject: Re: [PATCH v2 02/12] MdeModulePkg/SataControllerDxe: Log expected errors at DEBUG_INFO level
Date: Fri, 12 May 2023 01:35:34 +0000 [thread overview]
Message-ID: <MN2PR11MB4031EE05D0B07B0F605D6CDACA759@MN2PR11MB4031.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230509163212.291333-3-pedro.falcato@gmail.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Best Regards,
Hao Wu
> -----Original Message-----
> From: Pedro Falcato <pedro.falcato@gmail.com>
> Sent: Wednesday, May 10, 2023 12:32 AM
> To: devel@edk2.groups.io
> Cc: Laszlo Ersek <lersek@redhat.com>; Pedro Falcato
> <pedro.falcato@gmail.com>; Wang, Jian J <jian.j.wang@intel.com>; Gao,
> Liming <gaoliming@byosoft.com.cn>; Wu, Hao A <hao.a.wu@intel.com>; Ni,
> Ray <ray.ni@intel.com>
> Subject: [PATCH v2 02/12] 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)
>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
> ---
> .../Bus/Pci/SataControllerDxe/SataController.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c
> b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c
> index d67a3e69f649..277bc6182db6 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;
> }
>
> --
> 2.40.1
next prev parent reply other threads:[~2023-05-12 1:36 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-09 16:32 [PATCH v2 00/12] OvmfPkg: Replace the OVMF-specific SataControllerDxe with the generic one Pedro Falcato
2023-05-09 16:32 ` [PATCH v2 01/12] MdeModulePkg/SataControllerDxe: Clean up error handling in Start() Pedro Falcato
2023-05-10 8:30 ` Laszlo Ersek
2023-05-12 1:35 ` [edk2-devel] " Wu, Hao A
2023-05-09 16:32 ` [PATCH v2 02/12] MdeModulePkg/SataControllerDxe: Log expected errors at DEBUG_INFO level Pedro Falcato
2023-05-10 8:32 ` Laszlo Ersek
2023-05-12 1:35 ` Wu, Hao A [this message]
2023-05-09 16:32 ` [PATCH v2 03/12] MdeModulePkg/SataControllerDxe: Remove useless null check Pedro Falcato
2023-05-10 8:33 ` Laszlo Ersek
2023-05-12 1:35 ` [edk2-devel] " Wu, Hao A
2023-05-09 16:32 ` [PATCH v2 04/12] MdeModulePkg/SataControllerDxe: Fix up ASSERTS (Private != NULL) Pedro Falcato
2023-05-10 8:45 ` Laszlo Ersek
2023-05-12 1:36 ` Wu, Hao A
2023-05-09 16:32 ` [PATCH v2 05/12] OvmfPkg: Replace the OVMF-specific SataControllerDxe Pedro Falcato
2023-05-10 8:48 ` Laszlo Ersek
2023-05-09 16:32 ` [PATCH v2 06/12] OvmfPkg/Microvm: " Pedro Falcato
2023-05-10 8:48 ` Laszlo Ersek
2023-05-09 16:32 ` [PATCH v2 07/12] OvmfPkg/Bhyve: " Pedro Falcato
2023-05-10 8:49 ` Laszlo Ersek
2023-05-11 11:58 ` [edk2-devel] " Corvin Köhne
2023-05-09 16:32 ` [PATCH v2 08/12] OvmfPkg/CloudHv: " Pedro Falcato
2023-05-09 16:32 ` [PATCH v2 09/12] OvmfPkg/IntelTdx: " Pedro Falcato
2023-05-09 16:32 ` [PATCH v2 10/12] OvmfPkg/AmdSev: " Pedro Falcato
2023-05-09 16:32 ` [PATCH v2 11/12] OvmfPkg/Xen: " Pedro Falcato
2023-05-12 14:14 ` Anthony PERARD
2023-05-09 16:32 ` [PATCH v2 12/12] OvmfPkg: Remove SataControllerDxe Pedro Falcato
2023-05-10 8:50 ` Laszlo Ersek
2023-05-10 6:49 ` [PATCH v2 00/12] OvmfPkg: Replace the OVMF-specific SataControllerDxe with the generic one Ard Biesheuvel
2023-05-11 4:53 ` Gerd Hoffmann
2023-06-01 16:12 ` Ard Biesheuvel
2023-06-01 17:12 ` Pedro Falcato
2023-06-01 17:13 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MN2PR11MB4031EE05D0B07B0F605D6CDACA759@MN2PR11MB4031.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox