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