From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.groups.io with SMTP id smtpd.web11.645.1685640484889111080 for ; Thu, 01 Jun 2023 10:28:05 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=TC5I57BS; spf=pass (domain: gmail.com, ip: 209.85.221.46, mailfrom: pedro.falcato@gmail.com) Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-307d58b3efbso1090891f8f.0 for ; Thu, 01 Jun 2023 10:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685640483; x=1688232483; 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=+qaD0MEUtgKm/9K/0c3CPqyw/OQmYnKetGyI4EIKj+s=; b=TC5I57BS2pfCpRzjc6406gYh2kvqVVWk3XFCq4F7bTsb6ycBiXFE3pUI2oswry0sdT KmRge0MCveKCt49rVBBPqzhn7K5T30RrrGsy1At9GnmNWsptg6y+mKlu9QMJXv/hjHwy 0aP0DdavCL2e0hQcii1FtI3JoggB902MlcdKI7YfMzmucsT1ZE3YGnTvlWL+sEKwalzQ 8yN2rBF522JuVYMa4MrNAwICCAamLqLg7PtbuSuLyWa4V369pYhejwAx+5vpb9kkXLbF XXgV8l3Bs/P9PbVLjrSDhI50F+/25x/71z9ExJyaT8J3Mh477mDKM3O3rWilHOi9ddEg Kr7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685640483; x=1688232483; 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=+qaD0MEUtgKm/9K/0c3CPqyw/OQmYnKetGyI4EIKj+s=; b=F7nmuc0tNuzzXI7CxkiAJp4c2rqhX6hB99xUVB34UI4vDElc9DyC5cxO0FLOUa/wuO mwovbgjkVO+PgHaWpRNo4EudpLPNl/O2Fc8bef+v+8OgMRzTvcIq0qjz2VqUMpvrVKH6 sl5xwwpnh3yzwf+Vg5XsccsRnn8jAmb8aifWTIcmIw3HU7bCNS6/tqykLx+iSC1Q9E7x JoLdAR3mmCYeyRClUh6ODwcBvEo4SwkQ66xS8KC5EThkOXqCGF0amNDo5Bcw7yk0ImZL fc6ZGZ3E6UY5hnx8zrfwcgcoUhJ/QrXaNHpAlqifPV0sOE3XU0HhEMiG7ary8YUSLDKR l6Fg== X-Gm-Message-State: AC+VfDyneVJfhsB0CgRzyLmmEYxGFCMpbd/JkQrjKE4Ir1MK/KNk9ptu u5HuTZjqmPEb9XdXnoDLoJ5g0jBz7E1DYw== X-Google-Smtp-Source: ACHHUZ7uPz5/eKFz57n3jNhzWOPAVbmHfAYmNMO19fWEkp2geicG9Fs2JK1n0IcI7zwbzsw2J5vNow== X-Received: by 2002:adf:e451:0:b0:306:34f6:de8a with SMTP id t17-20020adfe451000000b0030634f6de8amr2381005wrm.71.1685640483083; Thu, 01 Jun 2023 10:28:03 -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 n11-20020a7bcbcb000000b003f60d0eef36sm2970511wmi.48.2023.06.01.10.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 10:28:02 -0700 (PDT) From: "Pedro Falcato" To: devel@edk2.groups.io Cc: Pedro Falcato , Jian J Wang , Liming Gao , Hao A Wu , Ray Ni , Laszlo Ersek Subject: [PATCH v3 02/12] MdeModulePkg/SataControllerDxe: Log expected errors at DEBUG_INFO level Date: Thu, 1 Jun 2023 18:27:30 +0100 Message-Id: <20230601172740.9165-3-pedro.falcato@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230601172740.9165-1-pedro.falcato@gmail.com> References: <20230601172740.9165-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 Reviewed-by: Laszlo Ersek Reviewed-by: Hao A Wu --- .../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