From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.web11.37801.1683649947716463423 for ; Tue, 09 May 2023 09:32:28 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=oDZMWEvC; spf=pass (domain: gmail.com, ip: 209.85.128.52, mailfrom: pedro.falcato@gmail.com) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-3f42711865eso16346295e9.0 for ; Tue, 09 May 2023 09:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683649946; x=1686241946; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JxWa8KrVxeIngbAu8gCB0rvQCwUiuYBaRG9WZyTHuWE=; b=oDZMWEvCq945dz7He2mKqZMc9O0lAOLgb+7LJjMMHi06TOPhkJmIuBLDMzEHP2T1e8 J2wUairwHEUgtRiB6ZreO8/K1NJrm4zeYCizm+Wy6CI9SzYutp2urOWaRNQ5YLHZa8dE 5Xnrc1o7wIMVcPZagI+D0GNELcIOIlhJQyUjCDMiSeA/e8NUfjikItE/upteb7ch6HM8 v0KrUobIxi7xbFxQ95ZjoNx2AWFTD76QZarqZXjuAo7zC5j1jE7/6lxbV6IvZT8NFTqF ESGkJ7sXOjtrjDakXpo3tbXjvD6tuM4XLpStQH1yv8FLEVIyMCEgMelwV/TCgd7k/dlS qb+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683649946; x=1686241946; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JxWa8KrVxeIngbAu8gCB0rvQCwUiuYBaRG9WZyTHuWE=; b=A9UDwl77iFCC3B0iyf2i9F2LZSWWTrC4oPXI6yOgrvgcdhVYqHr12JHbTE6izc4RZ4 Vsc1jxAdruuN5YT0X+gA6n7oLeNkh/sc+58TxSLWA8uKAI8MtkLhdiqMxboSVVG+83bd My+OPfME2dpkH4dljzTBBnZq+ySRkxFqwipNzN6Fch1Z4reIm25Y38rO36x2TMFxZrHV GkCuqMrgnOQpRobmDtgFuj+OP9lbPxnvyfkKZ8vDuK5zayxm9Mx5YGTSEQwFPC12zI1k pOZTbWdKL0Ev4OQmmFD84vx7MfcXYmWEKtd20gBYRiHQYP8LvaquIC3LWntkz6fw8RWS KjHA== X-Gm-Message-State: AC+VfDwovJsnSIYaybjBD7yU1ZTslG/PeK/7JsRssW8urAyRl5E91S9A K796r+kcnbFQjK0vauBmCbG6jyU0bbfR7GpT X-Google-Smtp-Source: ACHHUZ4t65bo6BsseeKBuGVKVmKK5wm0Uo2ls+xTnjx6+slYrGEN6SJrsK0XIwpIn7UV70dHcPV7Vg== X-Received: by 2002:a1c:4b19:0:b0:3f1:cfea:fd49 with SMTP id y25-20020a1c4b19000000b003f1cfeafd49mr9850328wma.1.1683649945947; Tue, 09 May 2023 09:32:25 -0700 (PDT) Return-Path: Received: from PC-PEDRO-ARCH.lan ([2001:8a0:7280:5801:9441:3dce:686c:bfc7]) by smtp.gmail.com with ESMTPSA id p1-20020a05600c204100b003f0a6a1f969sm20363938wmg.46.2023.05.09.09.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 May 2023 09:32:25 -0700 (PDT) From: "Pedro Falcato" To: devel@edk2.groups.io Cc: Laszlo Ersek , Pedro Falcato , Jian J Wang , Liming Gao , Hao A Wu , Ray Ni Subject: [PATCH v2 02/12] MdeModulePkg/SataControllerDxe: Log expected errors at DEBUG_INFO level Date: Tue, 9 May 2023 17:32:02 +0100 Message-Id: <20230509163212.291333-3-pedro.falcato@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230509163212.291333-1-pedro.falcato@gmail.com> References: <20230509163212.291333-1-pedro.falcato@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Liming Gao Cc: Hao A Wu Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Pedro Falcato --- .../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