Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yield cpu to other procs while flashing
Summary: I think we have been observing occasional watchdog resets while flashing bletchley OpenBMC devices, which effectively bricks the device. flashy was both wiping and flashing MTD devices with a single system call. I suspect the underlying device driver / file system code does not include a call to yield the CPU and therefore will keep the CPU in kernel mode for as long as it takes to erase/write the flash, giving no opportunity for other timeshared processes to run on the BMC. If this occurred, systemd would be unable to tickle the watchdog timer. Indeed while flashing I have observed it taking a very long time (~1m) to log into the BMC over SSH. Give other processes the chance to run by splitting both operations up into smaller units of work (i.e. many more system calls needed). Test Plan: ``` 0 ~/local/openbmc/tools/flashy $ ./build.sh && ./build_dev.sh && go test ./... ok github.com/facebook/openbmc/tools/flashy (cached) ok github.com/facebook/openbmc/tools/flashy/checks_and_remediations/bletchley (cached) ok github.com/facebook/openbmc/tools/flashy/checks_and_remediations/common (cached) ok github.com/facebook/openbmc/tools/flashy/checks_and_remediations/galaxy100 (cached) ok github.com/facebook/openbmc/tools/flashy/checks_and_remediations/wedge100 (cached) ok github.com/facebook/openbmc/tools/flashy/checks_and_remediations/yamp (cached) ? github.com/facebook/openbmc/tools/flashy/flash_procedure [no test files] ok github.com/facebook/openbmc/tools/flashy/install (cached) ok github.com/facebook/openbmc/tools/flashy/lib/fileutils (cached) ok github.com/facebook/openbmc/tools/flashy/lib/flash (cached) ok github.com/facebook/openbmc/tools/flashy/lib/flash/flashcp (cached) ok github.com/facebook/openbmc/tools/flashy/lib/flash/flashutils (cached) ok github.com/facebook/openbmc/tools/flashy/lib/flash/flashutils/devices (cached) ? github.com/facebook/openbmc/tools/flashy/lib/logger [no test files] ok github.com/facebook/openbmc/tools/flashy/lib/step (cached) ok github.com/facebook/openbmc/tools/flashy/lib/utils (cached) ok github.com/facebook/openbmc/tools/flashy/lib/validate (cached) ok github.com/facebook/openbmc/tools/flashy/lib/validate/image (cached) ok github.com/facebook/openbmc/tools/flashy/lib/validate/partition (cached) ? github.com/facebook/openbmc/tools/flashy/tests [no test files] ? github.com/facebook/openbmc/tools/flashy/utilities [no test files] 0 ~/local/openbmc/tools/flashy $ echo $? 0 ``` Reviewed By: williamspatrick Differential Revision: D45150174 fbshipit-source-id: 535b630225c964bbf16ed230610eeddba51e0c67
- Loading branch information