From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web09.2203.1609791061010091840 for ; Mon, 04 Jan 2021 12:11:01 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: andrew.kim@intel.com) IronPort-SDR: tXFaKHImq9tE6beHPLB02CqFNU7byI8miFvDinJEaZf4SY+zv7EXMp52lNBWrfW0+1qGui+9c2 7lurGJusGhJg== X-IronPort-AV: E=McAfee;i="6000,8403,9854"; a="164705625" X-IronPort-AV: E=Sophos;i="5.78,474,1599548400"; d="scan'208";a="164705625" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2021 12:10:59 -0800 IronPort-SDR: 1MmNuSGq33FXOmc09VqPDRE0hErn4EP7PpBnOLc1dTcr6G6T7qrlcv3eiHmZkG2cgKbNYZkWr1 R2yLAxJ+LYmg== X-IronPort-AV: E=Sophos;i="5.78,474,1599548400"; d="scan'208";a="402081035" Received: from akim-mobl.amr.corp.intel.com ([10.209.146.219]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2021 12:10:59 -0800 From: Andrew Kim To: devel@edk2.groups.io Cc: Andrew Kim , Jian J Wang , Hao A Wu , Ray Ni Subject: [PATCH 1/1] MdeModulePkg:Pci: Fix for PM1733 U.2 SSD abnormal VF BAR4 Date: Mon, 4 Jan 2021 12:10:02 -0800 Message-Id: <20210104201002.542-1-andrew.kim@intel.com> X-Mailer: git-send-email 2.30.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Symptom: With PM1733 U.2 SSD on system, there's abnormal VF BAR alignment 0xFFFFFFFFFFFFFFFF in POST message as below. VFBAR[3]: Type = PMem64; Alignment = 0xFFFFFFFFFFFFFFFF;Length = 0x0;Offset = 0x21C In addition, system might not boot into Yocto. System will output below message and hang. [ 13.225541] zswap: default zpool zbud not available [ 13.230465] zswap: pool creation failed Rootcause: PM1733 VF BAR4 request for 64bit prefetchable memory resource, But VF BAR4-5 didn't response any size. Workaround: In general, higher address of a 64bit BAR should not have zero size. Reset alignment to be 0 for this special case. Signed-off-by: Andrew Kim Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni --- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index 6c68a97d4e46..907a0a9288b8 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -1686,6 +1686,14 @@ PciIovParseVfBar ( ); if (EFI_ERROR (Status)) { + PciIoDevice->VfPciBar[BarIndex].BaseAddress = 0; + PciIoDevice->VfPciBar[BarIndex].Length = 0; + PciIoDevice->VfPciBar[BarIndex].Alignment = 0; + + // + // Scan all the BARs anyway + // + PciIoDevice->VfPciBar[BarIndex].Offset = (UINT16) Offset; return Offset + 4; } -- 2.26.2.windows.1