diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-03-26 01:45:09 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-03-27 01:41:36 +0300 |
commit | 12bef3e1bf292dec5ac15af9fb41e86f7bcfb0cb (patch) | |
tree | 608a905372f3f545d2686e29512ae3f5f5b4a78c /meta-openbmc-mods/meta-common/recipes-phosphor/sensors | |
parent | 0a1ece0568a37de9f17fd6e0bcdfd2cad2c6503f (diff) | |
download | openbmc-12bef3e1bf292dec5ac15af9fb41e86f7bcfb0cb.tar.xz |
Update to internal 0.43
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor/sensors')
5 files changed, 243 insertions, 16 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0002-Fix-PECI-client-creation-flow.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0002-Fix-PECI-client-creation-flow.patch index 0b2c19d32..cfdc99d66 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0002-Fix-PECI-client-creation-flow.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0002-Fix-PECI-client-creation-flow.patch @@ -1,4 +1,4 @@ -From 6d553f9fb6829d7dbbe2f625a09f476b0ef91ca0 Mon Sep 17 00:00:00 2001 +From 0a1b2a13f6dbc64b5851ac2b1ca99d57afa78d60 Mon Sep 17 00:00:00 2001 From: Jae Hyun Yoo <jae.hyun.yoo@intel.com> Date: Wed, 27 Jan 2021 15:52:16 -0800 Subject: [PATCH] Fix PECI client creation flow @@ -12,10 +12,10 @@ Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com> 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp -index dfc942fcf7f3..67be7447e74e 100644 +index f304e3f..92c1716 100644 --- a/src/CPUSensorMain.cpp +++ b/src/CPUSensorMain.cpp -@@ -84,6 +84,7 @@ struct CPUConfig +@@ -82,6 +82,7 @@ struct CPUConfig }; static constexpr const char* peciDev = "/dev/peci-"; @@ -23,16 +23,16 @@ index dfc942fcf7f3..67be7447e74e 100644 static constexpr const unsigned int rankNumMax = 8; namespace fs = std::filesystem; -@@ -169,7 +170,7 @@ bool createSensors(boost::asio::io_service& io, +@@ -167,7 +168,7 @@ bool createSensors(boost::asio::io_service& io, } std::vector<fs::path> hwmonNamePaths; - if (!findFiles(fs::path(R"(/sys/bus/peci/devices)"), + if (!findFiles(fs::path(peciDevPath), R"(peci-\d+/\d+-.+/peci-.+/hwmon/hwmon\d+/name$)", - hwmonNamePaths, 1)) + hwmonNamePaths, 6)) { -@@ -405,7 +406,7 @@ bool createSensors(boost::asio::io_service& io, +@@ -403,7 +404,7 @@ bool createSensors(boost::asio::io_service& io, return true; } @@ -41,7 +41,7 @@ index dfc942fcf7f3..67be7447e74e 100644 { std::ostringstream hex; hex << std::hex << config.addr; -@@ -413,9 +414,12 @@ void exportDevice(const CPUConfig& config) +@@ -411,9 +412,12 @@ void exportDevice(const CPUConfig& config) std::string busStr = std::to_string(config.bus); std::string parameters = "peci-client 0x" + addrHexStr; @@ -56,7 +56,7 @@ index dfc942fcf7f3..67be7447e74e 100644 const std::string& dir = devicePath.parent_path().string(); for (const auto& path : std::filesystem::directory_iterator(dir)) { -@@ -433,20 +437,38 @@ void exportDevice(const CPUConfig& config) +@@ -431,20 +435,38 @@ void exportDevice(const CPUConfig& config) std::cout << parameters << " on bus " << busStr << " is already exported\n"; } @@ -99,7 +99,7 @@ index dfc942fcf7f3..67be7447e74e 100644 } void detectCpu(boost::asio::deadline_timer& pingTimer, -@@ -462,6 +484,11 @@ void detectCpu(boost::asio::deadline_timer& pingTimer, +@@ -460,6 +482,11 @@ void detectCpu(boost::asio::deadline_timer& pingTimer, for (CPUConfig& config : cpuConfigs) { @@ -111,7 +111,7 @@ index dfc942fcf7f3..67be7447e74e 100644 std::string peciDevPath = peciDev + std::to_string(config.bus); auto file = open(peciDevPath.c_str(), O_RDWR | O_CLOEXEC); if (file < 0) -@@ -512,16 +539,29 @@ void detectCpu(boost::asio::deadline_timer& pingTimer, +@@ -510,16 +537,29 @@ void detectCpu(boost::asio::deadline_timer& pingTimer, newState = State::OFF; } @@ -145,13 +145,13 @@ index dfc942fcf7f3..67be7447e74e 100644 } if (newState == State::ON) -@@ -544,6 +584,8 @@ void detectCpu(boost::asio::deadline_timer& pingTimer, +@@ -542,6 +582,8 @@ void detectCpu(boost::asio::deadline_timer& pingTimer, keepPinging = true; } + close(file); + - if (DEBUG) + if (debug) { std::cout << config.name << ", state: " << config.state << "\n"; -- diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0003-Fix-missing-threshold-de-assert-event-when-threshold.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0003-Fix-missing-threshold-de-assert-event-when-threshold.patch new file mode 100644 index 000000000..c9175fd64 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0003-Fix-missing-threshold-de-assert-event-when-threshold.patch @@ -0,0 +1,139 @@ +From 17e3ed85f2ff919ff52b4a3fe7a1eb0026f28898 Mon Sep 17 00:00:00 2001 +From: Zhikui Ren <zhikui.ren@intel.com> +Date: Thu, 24 Sep 2020 14:27:32 -0700 +Subject: [PATCH] Fix missing threshold de-assert event when threshold changes. + +Sensor can be re-constructed when sensor configuration changes +like a new threshold value. Threshold deassert can be missed +if the new threshold value fixes the alarm because the +default state for new threshold interface is de-asserted. +Send threshold de-assert message after interfaces are initialized to +ensure de-assert event is logged if there is an active assert +event. + +Tested: +step1: +busctl set-property xyz.openbmc_project.ADCSensor /xyz/openbmc_project/sensors/voltage/P3VBAT xyz.openbmc_project.Sensor.Threshold.Warning WarningLow d 2.457 +ipmitool sel list +SEL has no entries +step2: +busctl set-property xyz.openbmc_project.ADCSensor /xyz/openbmc_project/sensors/voltage/P3VBAT xyz.openbmc_project.Sensor.Threshold.Warning WarningLow d 3.1 +ipmitool sel list + 1 | 09/24/20 | 21:30:15 UTC | Voltage #0x2d | Lower Non-critical going low | Asserted +step3: +busctl set-property xyz.openbmc_project.ADCSensor /xyz/openbmc_project/sensors/voltage/P3VBAT xyz.openbmc_project.Sensor.Threshold.Warning WarningLow d 2.457 +ipmitool sel list + 1 | 09/24/20 | 21:30:15 UTC | Voltage #0x2d | Lower Non-critical going low | Asserted + 2 | 09/24/20 | 21:30:33 UTC | Voltage #0x2d | Lower Non-critical going low | Deasserted + +Signed-off-by: Zhikui Ren <zhikui.ren@intel.com> +Change-Id: If28870ac1e0d09be4a631a3145408ec70390dfc5 +--- + include/Thresholds.hpp | 5 ++++- + include/sensor.hpp | 13 +++++++++++++ + src/ADCSensor.cpp | 1 + + src/Thresholds.cpp | 15 +++++++++++++-- + 4 files changed, 31 insertions(+), 3 deletions(-) + +diff --git a/include/Thresholds.hpp b/include/Thresholds.hpp +index ca2b0a0..c1d0baf 100644 +--- a/include/Thresholds.hpp ++++ b/include/Thresholds.hpp +@@ -45,7 +45,10 @@ struct Threshold + + void assertThresholds(Sensor* sensor, double assertValue, + thresholds::Level level, thresholds::Direction direction, +- bool assert); ++ bool assert, bool force = false); ++ ++void forceDeassertThresholds(Sensor* sensor, thresholds::Level level, ++ thresholds::Direction direction); + + struct TimerUsed + { +diff --git a/include/sensor.hpp b/include/sensor.hpp +index 0ef87d5..d50b2ff 100644 +--- a/include/sensor.hpp ++++ b/include/sensor.hpp +@@ -312,6 +312,19 @@ struct Sensor + operationalInterface->register_property("Functional", true); + operationalInterface->initialize(); + } ++ ++ // Sensor can be reconstructed when sensor configuration changes ++ // like a new threshold value. Threshold deassert can be missed ++ // if the new threshold value fixes the alarm because ++ // default state for new threshold interface is de-asserted. ++ // Send threshold de-assert message during initialization to ++ // ensure de-assert events are logged if there is an active assert ++ // event. ++ for (auto& threshold : thresholds) ++ { ++ thresholds::forceDeassertThresholds(this, threshold.level, ++ threshold.direction); ++ } + } + + bool readingStateGood() +diff --git a/src/ADCSensor.cpp b/src/ADCSensor.cpp +index fe600d7..632fc8c 100644 +--- a/src/ADCSensor.cpp ++++ b/src/ADCSensor.cpp +@@ -88,6 +88,7 @@ ADCSensor::~ADCSensor() + // close the input dev to cancel async operations + inputDev.close(); + waitTimer.cancel(); ++ + objServer.remove_interface(thresholdInterfaceWarning); + objServer.remove_interface(thresholdInterfaceCritical); + objServer.remove_interface(sensorInterface); +diff --git a/src/Thresholds.cpp b/src/Thresholds.cpp +index f4d4ed0..3c791c9 100644 +--- a/src/Thresholds.cpp ++++ b/src/Thresholds.cpp +@@ -344,6 +344,7 @@ bool checkThresholds(Sensor* sensor) + { + bool status = true; + std::vector<ChangeParam> changes = checkThresholds(sensor, sensor->value); ++ + for (const auto& change : changes) + { + assertThresholds(sensor, change.assertValue, change.threshold.level, +@@ -392,7 +393,7 @@ void checkThresholdsPowerDelay(Sensor* sensor, ThresholdTimer& thresholdTimer) + + void assertThresholds(Sensor* sensor, double assertValue, + thresholds::Level level, thresholds::Direction direction, +- bool assert) ++ bool assert, bool force) + { + std::string property; + std::shared_ptr<sdbusplus::asio::dbus_interface> interface; +@@ -432,7 +433,9 @@ void assertThresholds(Sensor* sensor, double assertValue, + return; + } + +- if (interface->set_property<bool, true>(property, assert)) ++ bool propertyChanged = ++ interface->set_property<bool, true>(property, assert); ++ if (force || propertyChanged) + { + try + { +@@ -452,6 +455,14 @@ void assertThresholds(Sensor* sensor, double assertValue, + } + } + ++// Explicitely de-assert a threshold with existing sensor value ++// Should only be called on sensor desctruction ++void forceDeassertThresholds(Sensor* sensor, thresholds::Level level, ++ thresholds::Direction direction) ++{ ++ assertThresholds(sensor, sensor->value, level, direction, false, true); ++} ++ + bool parseThresholdsFromAttr( + std::vector<thresholds::Threshold>& thresholdVector, + const std::string& inputPath, const double& scaleFactor, +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0004-Fan-Tach-Sensor-Threshold-Ignore-Zero.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0004-Fan-Tach-Sensor-Threshold-Ignore-Zero.patch new file mode 100644 index 000000000..65558aba5 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0004-Fan-Tach-Sensor-Threshold-Ignore-Zero.patch @@ -0,0 +1,58 @@ +From 8f850ea8745aa7aafcb504aa50686ba00fdfcfee Mon Sep 17 00:00:00 2001 +From: Zhikui Ren <zhikui.ren@intel.com> +Date: Fri, 19 Feb 2021 12:14:05 -0800 +Subject: [PATCH] Fan Tach Sensor Threshold Ignore Zero + +Currently there are systems that have system fans plugged +into different fan connectors. Fan present detection is +not supported in most of these systems. Critical low +threshold is asserted for the non-utilized fans +resulting in FSC boost all fans. + +Skip threshold checking for fan tach reading less or equal +to zero. This is a temporary WA until a more robust solution +is available. + +Note: with this workaround a completely non-working fan +will not be detected. FSC will still boost fans due to other +constraints if the system can't be cooled with the working fans. + +Tested: +No cr event for the missing fans. + +Signed-off-by: Zhikui Ren <zhikui.ren@intel.com> +--- + src/TachSensor.cpp | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +diff --git a/src/TachSensor.cpp b/src/TachSensor.cpp +index 1ec979f..b17be98 100644 +--- a/src/TachSensor.cpp ++++ b/src/TachSensor.cpp +@@ -185,12 +185,18 @@ void TachSensor::handleResponse(const boost::system::error_code& err) + + void TachSensor::checkThresholds(void) + { +- bool status = thresholds::checkThresholds(this); +- +- if (redundancy && *redundancy) ++ // WA - treat value <= 0 as not present ++ bool status = false; ++ if (value > 0) + { +- (*redundancy) +- ->update("/xyz/openbmc_project/sensors/fan_tach/" + name, !status); ++ status = thresholds::checkThresholds(this); ++ ++ if (redundancy && *redundancy) ++ { ++ (*redundancy) ++ ->update("/xyz/openbmc_project/sensors/fan_tach/" + name, ++ !status); ++ } + } + + bool curLed = !status; +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0005-Fix-PECI-ioctl-number.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0005-Fix-PECI-ioctl-number.patch new file mode 100644 index 000000000..8119f7542 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0005-Fix-PECI-ioctl-number.patch @@ -0,0 +1,29 @@ +From f85dd776301371892ff5197c1995bf2224dd87ab Mon Sep 17 00:00:00 2001 +From: Jae Hyun Yoo <jae.hyun.yoo@intel.com> +Date: Mon, 22 Feb 2021 15:57:20 -0800 +Subject: [PATCH] Fix PECI ioctl number + +This commit fixes PECI ioctl number to 0xb8 to avoid conflicts in +kernel v5.10. + +Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com> +--- + include/linux/peci-ioctl.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/linux/peci-ioctl.h b/include/linux/peci-ioctl.h +index e5b4b8bd3275..1f44edf4fc04 100644 +--- a/include/linux/peci-ioctl.h ++++ b/include/linux/peci-ioctl.h +@@ -601,7 +601,7 @@ struct peci_crashdump_get_frame_msg { + __u8 data[16]; + } __attribute__((__packed__)); + +-#define PECI_IOC_BASE 0xb7 ++#define PECI_IOC_BASE 0xb8 + + #define PECI_IOC_XFER \ + _IOWR(PECI_IOC_BASE, PECI_CMD_XFER, struct peci_xfer_msg) +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend index 39a6f1581..bb1268e0a 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend @@ -1,13 +1,16 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" PROJECT_SRC_DIR := "${THISDIR}/${PN}" -SRCREV = "a3e8f2a391f389ffb2c379ca0c181e67de43824e" +SRCREV = "d05867c0d32065d36b13bd452f7aff9dcb20ac2f" #SRC_URI = "git://github.com/openbmc/dbus-sensors.git" SRC_URI += "\ file://intrusionsensor-depend-on-networkd.conf \ file://0001-Add-check-for-min-max-received-from-hwmon-files.patch \ file://0002-Fix-PECI-client-creation-flow.patch \ + file://0003-Fix-missing-threshold-de-assert-event-when-threshold.patch \ + file://0004-Fan-Tach-Sensor-Threshold-Ignore-Zero.patch \ + file://0005-Fix-PECI-ioctl-number.patch \ " DEPENDS_append = " libgpiod libmctp" @@ -24,14 +27,12 @@ PACKAGECONFIG += " \ psusensor \ " -PACKAGECONFIG[nvmesensor] = "-DDISABLE_NVME=OFF, -DDISABLE_NVME=ON" +PACKAGECONFIG[nvmesensor] = "-Dnvme=enabled, -Dnvme=disabled" SYSTEMD_SERVICE_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'nvmesensor', \ 'xyz.openbmc_project.nvmesensor.service', \ '', d)}" -PACKAGECONFIG_remove = "nvmesensor" - do_install_append() { svc="xyz.openbmc_project.intrusionsensor.service" srcf="${WORKDIR}/intrusionsensor-depend-on-networkd.conf" |