Skip to content

Commit

Permalink
pcie_check: will continue instead of return if PCI cap is 0xff
Browse files Browse the repository at this point in the history
Will continue instead of return if PCI cap is 0xff.
Add more description info for pcie check.

Reported-by: Yi Lai <[email protected]>
Signed-off-by: Pengfei Xu <[email protected]>
  • Loading branch information
xupengfe committed Sep 9, 2024
1 parent 0f34266 commit 0a873ba
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions BM/tools/pcie/pcie_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ int scan_pci(void)

if ((*ptrdata != ptr_content) && (*ptrdata != 0)) {
if (recognize_pcie(ptrdata) == 2) {
printf("%02x:%02x.%x debug:pcie_check a %x %x %x\n",
bus, dev, fun, bus, dev, fun);
printf("[ERR] PCI %02x:%02x.%x offset 0xff, please \
debug:pcie_check a %x %x %x\n", bus, dev, fun, bus, dev, fun);
munmap(ptrdata, LEN_SIZE);
close(fd);
return 2;
Expand Down Expand Up @@ -790,11 +790,9 @@ int find_pcie_reg(u16 cap, u32 offset, u32 size)
check_pcie_register(cap, offset, size);
} else if (result == 2) {
/* This PCIe ended with unknown CAP ff, mark it */
printf("%02x:%02x.%x debug:pcie_check a %x %x %x\n",
bus, dev, func, bus, dev, func);
munmap(ptrdata, LEN_SIZE);
close(fd);
return 2;
printf("[WARN] PCIe %02x:%02x.%x error PCI CAP ff, \
please debug:pcie_check a %x %x %x\n", bus, dev, func, bus, dev, func);
continue;
}
}
munmap(ptrdata, LEN_SIZE);
Expand Down Expand Up @@ -964,11 +962,9 @@ int find_pci_reg(u16 cap, u32 offset, u32 size)
check_pci_register((u8)cap, (u8)offset, size);
} else if (result == 1) {
/* This PCI ended with unknown CAP ff so mark it */
printf("%02x:%02x.%x debug:pcie_check a %x %x %x\n",
bus, dev, func, bus, dev, func);
munmap(ptrdata, LEN_SIZE);
close(fd);
return 2;
printf("[WARN] PCI %02x:%02x.%x unknow CAP ff, \
please debug:pcie_check a %x %x %x\n", bus, dev, func, bus, dev, func);
continue;
}
}
munmap(ptrdata, LEN_SIZE);
Expand Down

0 comments on commit 0a873ba

Please sign in to comment.