From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 72B7A21E7492F for ; Mon, 4 Sep 2017 13:11:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3DC6D6DDF0; Mon, 4 Sep 2017 20:14:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3DC6D6DDF0 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-2.rdu2.redhat.com [10.10.120.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6054C66D4C; Mon, 4 Sep 2017 20:14:13 +0000 (UTC) From: Laszlo Ersek To: edk2-devel-01 Cc: Jordan Justen Date: Mon, 4 Sep 2017 22:14:03 +0200 Message-Id: <20170904201403.6445-6-lersek@redhat.com> In-Reply-To: <20170904201403.6445-1-lersek@redhat.com> References: <20170904201403.6445-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 04 Sep 2017 20:14:14 +0000 (UTC) Subject: [PATCH 5/5] OvmfPkg/SataControllerDxe: log informative message at DEBUG_INFO level X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Sep 2017 20:11:26 -0000 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. (In fact it is so much an expected condition that recent USWG Mantis ticket will codify its additional edk2-specific behavior, namely to output the protocol interface at once.) 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, "SataControllerStart START", and "SataControllerStart END status = %r" (at which point Status can only be EFI_SUCCESS). Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek --- OvmfPkg/SataControllerDxe/SataController.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/SataControllerDxe/SataController.c b/OvmfPkg/SataControllerDxe/SataController.c index 1f84ad034e5b..2a5c3ba9f1b2 100644 --- a/OvmfPkg/SataControllerDxe/SataController.c +++ b/OvmfPkg/SataControllerDxe/SataController.c @@ -388,6 +388,7 @@ SataControllerStart ( IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath ) { + UINTN BailLogMask; EFI_STATUS Status; EFI_PCI_IO_PROTOCOL *PciIo; UINT64 OriginalPciAttributes; @@ -398,6 +399,7 @@ SataControllerStart ( DEBUG ((EFI_D_INFO, "SataControllerStart START\n")); + BailLogMask = DEBUG_ERROR; SataPrivateData = NULL; // @@ -412,6 +414,14 @@ 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. + // + BailLogMask = DEBUG_INFO; + } goto Bail; } @@ -542,7 +552,8 @@ ClosePciIo: ); Bail: - DEBUG ((EFI_D_ERROR, "SataControllerStart error return status = %r\n", Status)); + DEBUG ((BailLogMask, "SataControllerStart error return status = %r\n", + Status)); return Status; } -- 2.14.1.3.gb7cf6e02401b