Commit 521e794
Fix Agera3 retimer cold-boot crash (uninitialized productInfo + PAI platform-port factory)
Summary:
## Summary
Cold boot on Ladakh/Leh800bcls (Agera3, PAI 4.1) crashed with a SIGSEGV in
`StateDelta` construction during parallel XPHY programming, and firmware never
downloaded. Two defects, both exposed when the platform-port creation was
refactored per-vendor (the old `else -> SaiFakePlatformPort` catch-all in
`SaiPlatform::initPorts()` became a hard `throw`):
1. **Uninitialized product info.** `BspSaiPhyManager::createExternalPhy` created a
`PlatformProductInfo` but never called `initialize()`. `Platform::getType()`
returns `productInfo_->getType()`, so the retimer platform type was
uninitialized garbage -> `createSaiPlatformPort()` returned null and
`initPorts()` threw for every XPHY. (Same fix D114436354 made for Elbert; the
retimer path was missed.)
2. **PAI build linked the fake port factory.** After the refactor, each binary
links one vendor-specific `createSaiPlatformPort`. The PAI phy build was wired
to `SaiPlatformInitFake.cpp`, whose factory only handles `PLATFORM_FAKE_*` and
returns null for `LEH800BCLS`/`LADAKH800BCLS` -> throw, even once the type was
correct.
Together these failed all XPHY inits; programming then ran against uninitialized
switches and hit the `StateDelta` null-deref crash.
## Changes
- `BspSaiPhyManager::createExternalPhy`: call `productInfo->initialize()` before
constructing `SaiPhyPlatform` (mirrors `ElbertPhyManager`/`SaiPlatformInit`).
- New `SaiPlatformInitPai.cpp`: PAI-specific `createSaiPlatformPort`
(`LADAKH800BCLS`/`LEH800BCLS` -> `SaiBcmPlatformPort`, plus fake fallback) and
`chooseSaiPlatformImpl`.
- `platform.bzl` (internal buck): `brcm_pai_srcs` links `SaiPlatformInitPai.cpp`
instead of `SaiPlatformInitFake.cpp`.
- `AgentPlatformsSai.cmake` (OSS): the `SAI_BRCM_PAI_IMPL` branch swaps the
factory the same way -- reuse the fake port sources but drop
`SaiPlatformInitFake.cpp` and add `SaiPlatformInitPai.cpp`. The real fake build
(`SAI_PLATFORM_FAKE_SRC` / `else()` branch) is untouched.
No new build deps (`SaiBcmPlatformPort.cpp` + `SaiFakePlatform*.cpp` are already
in both source lists). The OSS PAI source set is now identical to the buck
`brcm_pai_srcs` (22 files, same set), so exactly one `createSaiPlatformPort` is
linked -- no duplicate/missing symbols, and the new file is wired into CMake
(OSS-003 satisfied).
Reviewed By: daiwei1983, birdsoup
Differential Revision: D115255918
fbshipit-source-id: 391c89521ff5ae94def7f0d46827dc7cadd4c73d1 parent 27df8e0 commit 521e794
3 files changed
Lines changed: 60 additions & 1 deletion
File tree
- cmake
- fboss
- agent/platforms/sai
- lib/phy
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
94 | 101 | | |
95 | 102 | | |
96 | | - | |
| 103 | + | |
| 104 | + | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| |||
0 commit comments