diff options
author | Brandon Kim <brandonkim@google.com> | 2021-04-20 01:18:10 +0300 |
---|---|---|
committer | Brandon Kim <brandonkim@google.com> | 2021-04-20 08:35:40 +0300 |
commit | b7f1ec6c2ec25c51f4d5961e13068b5983913f68 (patch) | |
tree | f664c85c7c60c45b4d98debd41430fc5dd14ddff /meta-quanta/meta-gbs/recipes-quanta/fans | |
parent | 60cc768586727922a500c477aa0ecbe723f822c7 (diff) | |
download | openbmc-b7f1ec6c2ec25c51f4d5961e13068b5983913f68.tar.xz |
meta-quanta: gbs: Add retry to read-margin-temp-wait.sh
Add 3 x 1 second retries for WCTemp and default to a sane WCTemp if 0 is
read.
Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: Ia87e704d2e5e0990a0727cd37290084f8eda2df6
Diffstat (limited to 'meta-quanta/meta-gbs/recipes-quanta/fans')
-rw-r--r-- | meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/read-margin-temp-wait.sh | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/read-margin-temp-wait.sh b/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/read-margin-temp-wait.sh index 992e40a71..8dd408799 100644 --- a/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/read-margin-temp-wait.sh +++ b/meta-quanta/meta-gbs/recipes-quanta/fans/read-margin-temp/read-margin-temp-wait.sh @@ -27,13 +27,28 @@ for ((i = 0; i < 16; i++)); do Present | awk '{print $2}')" if [[ "$presentState" == "true" ]]; then - wcTemp="$( - busctl get-property xyz.openbmc_project.nvme.manager \ - ${nvmePath}${i} \ - xyz.openbmc_project.Sensor.Threshold.Critical \ - CriticalHigh | awk '{print $2}' - )" - wcTemp="$((wcTemp * 1000))" + actualWCTemp=0 + for ((j = 0; j < 3; j++)); do + actualWCTemp="$( + busctl get-property xyz.openbmc_project.nvme.manager \ + ${nvmePath}${i} \ + xyz.openbmc_project.Sensor.Threshold.Critical \ + CriticalHigh | awk '{print $2}' + )" + if [[ "${actualWCTemp}" -ne 0 ]]; then + break + fi + + echo "${nvmePath}${i} WCTemp was read to be 0, retrying after 1 sec sleep" + sleep 1 + done + + if [[ "${actualWCTemp}" -eq 0 ]]; then + echo "${nvmePath}${i} WCTemp was read to be 0, setting to default WCTemp: ${wcTemp}" + actualWCTemp="${wcTemp}" + fi + + wcTemp="$((actualWCTemp * 1000))" if [[ -z "$nvmeList" ]]; then nvmeList="\"nvme"${i}"\"" else |