diff options
author | George Hung <george.hung@quantatw.com> | 2020-12-29 09:09:09 +0300 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2020-12-31 19:40:51 +0300 |
commit | 8fc2a182e149dd8906f973853fb83e18c84c26ee (patch) | |
tree | 7764c183f8985126c07b4dead8d26b0208026d17 /meta-quanta | |
parent | 5ddef6cc6f3bd66e86dcc59996f8ebdf554336d6 (diff) | |
download | openbmc-8fc2a182e149dd8906f973853fb83e18c84c26ee.tar.xz |
meta-quanta: gbs: stop hwmon while doing tray reset
Stop phosphor-hwmon before performing a tray power cycle to
avoid ADM1272 doing an abnormal I2C transaction and causing
ADM1272 driver probe to fail due to wrong Manufacturer ID.
(From meta-quanta rev: 2143eac88d3643e4a8d461eec2ed9a2d2e6a32f3)
Signed-off-by: George Hung <george.hung@quantatw.com>
Change-Id: Ibd69cb956d76dbe08f0bb6e6bce115d5bab469df
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-quanta')
-rw-r--r-- | meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/tray_powercycle.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/tray_powercycle.sh b/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/tray_powercycle.sh index 5cbf49bb5..01c52deac 100644 --- a/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/tray_powercycle.sh +++ b/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/tray_powercycle.sh @@ -7,6 +7,23 @@ # Global variable: PSU_HARDRESET_DELAY specifies the number of seconds to wait # before pulling the trigger. If not specified or zero, the script power cycles # immediately. + +################################################## +# Stop the phosphor-hwmon daemon +# Return: +# 0 if success, non-zero if error +################################################## +stop_phosphor_hwmon() { + if (( $# != 0 )); then + echo 'Usage: stop_phosphor_hwmon' >&2 + return 1 + fi + + echo "Stopping phosphor-hwmon" >&2 + local srv='system-xyz.openbmc_project.Hwmon.slice' + systemctl stop "${srv}" +} + main() { # Sleep PSU_HARDRESET_DELAY seconds local psu_delay=$((PSU_HARDRESET_DELAY)) @@ -15,6 +32,10 @@ main() { sleep "${psu_delay}" fi + # Stop phosphor-hwmon so that ADM1272 powercycle doesn't happen + # in the middle of an i2c transaction and stuck the bus low + stop_phosphor_hwmon + gpioset gpiochip6 26=1 } |