Skip to content

Conversation

@jun2zhou
Copy link

@jun2zhou jun2zhou commented Nov 27, 2025

Pre-submission checklist

  • 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
  • pre-commit run
image

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.

  1. Enhance FBOSS platform_manager logic: Add explicit checking and waiting steps for SPI sysfs node creation (both master bus and device nodes).

  2. 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

  1. add delays in spi driver code fboss_iob_spi.c that helps for issue reproduce.
image 2. run cmd without fix: /opt/fboss/bin/platform_manager_hw_test -enable_pkg_mgmnt=false --gtest_filter=PlatformManagerHwTest.ExploreAfterUnloadingKmods image 3. run cmd with fix: image image

@meta-cla meta-cla bot added the CLA Signed label Nov 27, 2025
@jun2zhou jun2zhou marked this pull request as draft November 27, 2025 03:08
@jun2zhou jun2zhou marked this pull request as ready for review November 27, 2025 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant