From patchwork Tue Aug 14 10:50:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: mtrr: fix mtrr checking without devices that are under bridges Date: Tue, 14 Aug 2012 00:50:16 -0000 From: IvanHu X-Patchwork-Id: 177216 Message-Id: <1344941416-11122-1-git-send-email-ivan.hu@canonical.com> To: fwts-devel@lists.ubuntu.com The issue seems that only check the bridges, doesn't check the devices under the bridges. This causes the test fail. Fix the parser PCI Bus char and prfetchable char. Signed-off-by: Ivan Hu Acked-by: Alex Hung --- src/bios/mtrr/mtrr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bios/mtrr/mtrr.c b/src/bios/mtrr/mtrr.c index 4818c64..5bb27b8 100644 --- a/src/bios/mtrr/mtrr.c +++ b/src/bios/mtrr/mtrr.c @@ -356,11 +356,11 @@ static int is_prefetchable(fwts_framework *fw, char *device, uint64_t address) fwts_list_foreach(item, lspci_output) { char *str = strstr(fwts_text_list_text(item), "Memory at "); if (str && strtoull(str+10, NULL, 16) == address) { - if (strstr(str, "Non-Prefetchable")) + if (strstr(str, "non-prefetchable")) pref = 0; - else if (strstr(str, "(Prefetchable")) + else if (strstr(str, "(prefetchable")) pref = 1; - else if (strstr(str, ", Prefetchable")) + else if (strstr(str, ", prefetchable")) pref = 1; } } @@ -419,7 +419,7 @@ static int validate_iomem(fwts_framework *fw) * For pci bridges, we note the increased depth and * otherwise skip the entry */ - if (strstr(buffer, ": PCI Bus #")) { + if (strstr(buffer, ": PCI Bus ")) { pcidepth++; continue; }