diff options
author | Delphine CC Chiu <delphine_cc_chiu@wiwynn.com> | 2024-05-03 11:31:12 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2024-05-03 16:42:35 +0300 |
commit | 7a8edbac4a6ff4cf868d0da13ddabfdf3900cb79 (patch) | |
tree | 7822ead7c5846c3916b96f4298df4cee4cade28c /meta-facebook | |
parent | 643f580b8e91c6175490d191faeaa34ce6e7510b (diff) | |
download | openbmc-7a8edbac4a6ff4cf868d0da13ddabfdf3900cb79.tar.xz |
meta-facebook: yosemite4: fix CXL EID missing issue
1. Extend EID scanning timeout to 60 seconds by the unstable CXL boot time.
2. Add error handling of EID retrieval.
Tested on YV4 system.
Change-Id: I46411c6007d15bf352909a2b7b1477826d7022ce
Signed-off-by: Delphine CC Chiu <delphine_cc_chiu@wiwynn.com>
Diffstat (limited to 'meta-facebook')
-rw-r--r-- | meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/rescan-cxl-eid | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/rescan-cxl-eid b/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/rescan-cxl-eid index e470dd8059..6f5e3bec48 100644 --- a/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/rescan-cxl-eid +++ b/meta-facebook/meta-yosemite4/recipes-phosphor/state/phosphor-state-manager/rescan-cxl-eid @@ -1,11 +1,15 @@ #!/bin/bash # CXL need about 30 seconds to boot up. Wait 30 seconds then start polling CXLs status. -sleep 40 +sleep 30 wf_eid=$(($1 * 10 + 2)) count=0 -while [ $count -lt 3 ]; do + +# retry getting EID to maximum 60 seconds +while [ $count -lt 15 ]; do + count=$((count + 1)) + sleep 2 output=$(pldmtool raw -m "$wf_eid" -d 0x80 0x02 0x3A 0x04 0x01) @@ -16,18 +20,19 @@ while [ $count -lt 3 ]; do cxl2_ready=$(echo "$rx_data" | awk '{print substr($10,1,2)}') if [ "$cxl1_ready" == "01" ]; then - busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp au.com.CodeConstruct.MCTP SetupEndpointByConfigPath s /xyz/openbmc_project/inventory/system/board/Yosemite_4_Wailua_Falls_Slot_"$1"/CXL1 + if ! busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp au.com.CodeConstruct.MCTP SetupEndpointByConfigPath s /xyz/openbmc_project/inventory/system/board/Yosemite_4_Wailua_Falls_Slot_"$1"/CXL1; then + continue + fi fi if [ "$cxl2_ready" == "01" ]; then - busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp au.com.CodeConstruct.MCTP SetupEndpointByConfigPath s /xyz/openbmc_project/inventory/system/board/Yosemite_4_Wailua_Falls_Slot_"$1"/CXL2 + if ! busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp au.com.CodeConstruct.MCTP SetupEndpointByConfigPath s /xyz/openbmc_project/inventory/system/board/Yosemite_4_Wailua_Falls_Slot_"$1"/CXL2; then + continue + fi fi if [ "$cxl1_ready" == "01" ] && [ "$cxl2_ready" == "01" ]; then break fi - count=$((count + 1)) - sleep 2 - done |