Fix platform_manager SPI creation failure
Pre-submission checklist
- [x] I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running
pip install -r requirements-dev.txt && pre-commit install - [x]
pre-commit run
Summary
Fixed a occasional Failure issue in creation of SMB_SPI_MASTER_1_DEVICE_1. The loading of the kernel driver and the creation of associated devices require an uncertain period of time. To prevent device creation failures, we need to implement readiness checks for the sysfs nodes corresponding to the kernel driver and its associated devices. This constitutes the fundamental solution to mitigate issues arising from delays in kernel driver loading and device creation.
-
Enhance FBOSS platform_manager logic: Add explicit checking and waiting steps for SPI sysfs node creation (both master bus and device nodes).
-
Check sysfs nodes, example for spi0.0:
/sys/devices/pci0000:14/0000:14:04.0/0000:17:00.0/fboss_iob_pci.spi_master.1075/spi_master/spi0/spi0.0/ /sys/bus/spi/drivers/spidev/spi0.0 /dev/spidev0.0
Test Plan
- add delays in spi driver code fboss_iob_spi.c that helps for issue reproduce.