Guard against concurrent scan

The current code checks PECI availability every ten seconds and if it
becomes available after being unavailable starts a scan. In addition to
that the scan can be initiated by the code monitoring OS state, but this
is disabled by default by a compile time option.

This becomes problematic when the host OS is mostly idle and thus lets
the CPUs enter low-power states. The code that requests the PCIe data
takes that into account and does up to 5 polls in case of a timeout.

However the PECI availability code fails right away and on the next
iteration (when it doesn't get a timeout) starts the scan again, despite
the one already running. This leads not only to both scans proceeding
slowly but also to incorrect results due to a mix up of the results.

Tested: with a host fully booted to an idle GNU/Linux system the daemon
now provides correct results every time (albeit much slower compared to
a state when the host is staying in UEFI configuration menu or EFI
Shell). The test was performed on a two-socket Tioga Pass server with
Xeon Scalable 1st generation CPUs.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Change-Id: I34a01c15853dcadd5566d49d8df3b187bda6ae9f
1 file changed
tree: 3c27816e16a558de522d33359a2de0f6a9ddb04c
  1. include/
  2. service_files/
  3. src/
  4. utils/
  5. .clang-format
  6. CMakeLists.txt
  7. LICENSE
  8. OWNERS
  9. README.md
README.md

peci-pcie

The peci-pcie application uses the CPU PECI interface to get PCIe Device information for the system and shares it on D-Bus. The information from D-Bus is used by bmcweb to populate the PCIe Device resources in Redfish.