From 0eea29e45f1d671f0a769bb433cb6593593b7017 Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Fri, 21 Jan 2022 13:03:56 -0800 Subject: Update to internal 1-0.86-7 Signed-off-by: Jason M. Bills --- .../0001-ADCSensor-Fix-for-P3V3-sensor.patch | 59 ++++++++++++++++++++++ .../sensors/dbus-sensors_%.bbappend | 3 ++ .../bmcweb/0026-Fix-Query-Parameters-issue.patch | 44 ++++++++++++++++ ...Increase-timer-queue-size-and-reduce-time.patch | 46 +++++++++++++++++ .../recipes-phosphor/interfaces/bmcweb_%.bbappend | 2 + ...eck-for-min-max-received-from-hwmon-files.patch | 8 +-- .../0002-Fix-PECI-client-creation-flow.patch | 20 ++++---- ...-threshold-de-assert-event-when-threshold.patch | 24 ++++----- ...004-Fan-Tach-Sensor-Threshold-Ignore-Zero.patch | 20 +++++--- .../dbus-sensors/0005-Fix-PECI-ioctl-number.patch | 4 +- ...sor-create-RequirediTempSensor-if-defined.patch | 22 ++++---- ...007-Add-support-for-the-energy-hwmon-type.patch | 33 ++++++------ .../0008-CPUSensor-additional-debug-message.patch | 12 ++--- ...or-Create-CPUConfig-for-each-PECI-adapter.patch | 6 +-- .../sensors/dbus-sensors_%.bbappend | 2 +- 15 files changed, 233 insertions(+), 72 deletions(-) create mode 100644 meta-openbmc-mods/meta-ast2600/recipes-phosphor/sensors/dbus-sensors/0001-ADCSensor-Fix-for-P3V3-sensor.patch create mode 100644 meta-openbmc-mods/meta-ast2600/recipes-phosphor/sensors/dbus-sensors_%.bbappend create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0026-Fix-Query-Parameters-issue.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0027-Workaround-Increase-timer-queue-size-and-reduce-time.patch diff --git a/meta-openbmc-mods/meta-ast2600/recipes-phosphor/sensors/dbus-sensors/0001-ADCSensor-Fix-for-P3V3-sensor.patch b/meta-openbmc-mods/meta-ast2600/recipes-phosphor/sensors/dbus-sensors/0001-ADCSensor-Fix-for-P3V3-sensor.patch new file mode 100644 index 000000000..458f234b6 --- /dev/null +++ b/meta-openbmc-mods/meta-ast2600/recipes-phosphor/sensors/dbus-sensors/0001-ADCSensor-Fix-for-P3V3-sensor.patch @@ -0,0 +1,59 @@ +From 9923811a2880ad4a8289af666b63adfd1807b5bd Mon Sep 17 00:00:00 2001 +From: Jayaprakash Mutyala +Date: Mon, 22 Nov 2021 22:12:00 +0000 +Subject: [PATCH] ADCSensor: Fix for P3V3 sensor + +Issue: As part of adapting to upstream ADC driver change for all the +platforms of AST2600, ADC scale factor settings in board configurations +is adjusted. +Patch: https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/47086 +Due to this change set sensor threshold is not updating for critical +threshold value of P3V3 sensor. + +Fix: Updating pre sensor scaling of "maxVoltageReading" to 2.5 can fix +this issue. + +Tested: +Verified using IPMI set sensor threshold command for P3V3 sensor and for +other sensors as well. +Before fix: +//Get sensor threshold for P3V3 sensor +Command : ipmitool raw 0x04 0x27 0x83 +Response: 1b d6 d0 00 f8 ff 00 +//Set sensor threshold for P3V3 sensor +Command : ipmitool raw 0x04 0x26 0x83 0x10 0x00 0x00 0x00 0x00 0xfd 0x00 +Response: //Success +Command : ipmitool raw 0x04 0x27 0x83 +Response: 1b d8 d1 00 f9 ff 00 + +After fix: +//Get sensor threshold for P3V3 sensor +Command : ipmitool raw 0x04 0x27 0x81 +Response: 1b b2 ad 00 ce d4 00 +//Set sensor threshold for P3V3 sensor +Command : ipmitool raw 0x04 0x26 0x81 0x10 0x00 0x00 0x00 0x00 0xfd 0x00 +Response: //Success +Command : ipmitool raw 0x04 0x27 0x81 +Response: 1b b2 ad 00 ce fd 00 + +Signed-off-by: Jayaprakash Mutyala +--- + src/ADCSensor.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ADCSensor.cpp b/src/ADCSensor.cpp +index 9758168..2f3c66f 100644 +--- a/src/ADCSensor.cpp ++++ b/src/ADCSensor.cpp +@@ -37,7 +37,7 @@ + static constexpr unsigned int sensorScaleFactor = 1000; + + static constexpr double roundFactor = 10000; // 3 decimal places +-static constexpr double maxVoltageReading = 1.8; // pre sensor scaling ++static constexpr double maxVoltageReading = 2.5; // pre sensor scaling + static constexpr double minVoltageReading = 0; + + ADCSensor::ADCSensor(const std::string& path, +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-ast2600/recipes-phosphor/sensors/dbus-sensors_%.bbappend b/meta-openbmc-mods/meta-ast2600/recipes-phosphor/sensors/dbus-sensors_%.bbappend new file mode 100644 index 000000000..7f412bfa4 --- /dev/null +++ b/meta-openbmc-mods/meta-ast2600/recipes-phosphor/sensors/dbus-sensors_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://0001-ADCSensor-Fix-for-P3V3-sensor.patch" diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0026-Fix-Query-Parameters-issue.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0026-Fix-Query-Parameters-issue.patch new file mode 100644 index 000000000..d4c629c5a --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0026-Fix-Query-Parameters-issue.patch @@ -0,0 +1,44 @@ +From e40f454d5784570d497449775ae9f77f77973353 Mon Sep 17 00:00:00 2001 +From: "Arun P. Mohanan" +Date: Sat, 4 Dec 2021 01:28:38 +0530 +Subject: [PATCH] Fix Query Parameters issue + +Due to upstream change https://github.com/openbmc/bmcweb/commit/59b98b2222fddbea3d6f678d9e94006521f0c381, +none of the query parameters are functional in bmcweb. + +This commit adds the code required to copy the query parameters to +the crow request which is the actual request object used for handling +incoming URI requests. + +Tested: +GET on https:///redfish/v1/Systems/system/LogServices/EventLog/Entries +and https:///redfish/v1/Systems/system/LogServices/EventLog/Entries?skip=1000 + +Gave different logs indication correct functionality of skip query +parameter + +https:///redfish/v1/EventService/Subscriptions/SSE?$filter=(MessageId%20eq%20SELEntryAddedsaf) +Succesfully returned error indicating correct functionality of +query parameters as SELEntryAddedsaf is an invalid message id. + +Signed-off-by: Arun P. Mohanan +Signed-off-by: P Dheeraj Srujan Kumar +--- + http/http_connection.hpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/http/http_connection.hpp b/http/http_connection.hpp +index cdd3707..940b8b8 100644 +--- a/http/http_connection.hpp ++++ b/http/http_connection.hpp +@@ -339,6 +339,7 @@ class Connection : + try + { + thisReq.urlView = boost::urls::url_view(thisReq.target()); ++ thisReq.urlParams = thisReq.urlView.params(); + thisReq.url = thisReq.urlView.encoded_path(); + } + catch (std::exception& p) +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0027-Workaround-Increase-timer-queue-size-and-reduce-time.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0027-Workaround-Increase-timer-queue-size-and-reduce-time.patch new file mode 100644 index 000000000..385f46279 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0027-Workaround-Increase-timer-queue-size-and-reduce-time.patch @@ -0,0 +1,46 @@ +From e829c49701c3fe613d2ae57e45b9aad7b64cf569 Mon Sep 17 00:00:00 2001 +From: "Jason M. Bills" +Date: Fri, 3 Dec 2021 08:48:53 -0800 +Subject: [PATCH] Workaround: Increase timer queue size and reduce timeout + +It appears that the EWS logout issue is caused when this timer +queue fills up on larger operations. As recommended by the bmcweb +maintainers in Discord, this change adds a workaround that both +increases the size of the queue and reduces the timeout to clear +it more quickly to avoid filling the queue. + +The issue is under investigation upstream to remove this workaround +in favor of the real fix. + +Tested: +Confirmed that loading the Overview, Event Logs, Inventory, and +Sensor pages repeatedly does not log out and return to the +login page. + +Change-Id: Ifa210e36ab8992225fde66acf6b6b0db5f32a3b4 +Signed-off-by: Jason M. Bills +--- + http/timer_queue.hpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/http/timer_queue.hpp b/http/timer_queue.hpp +index 24a4ab4c..ff61e328 100644 +--- a/http/timer_queue.hpp ++++ b/http/timer_queue.hpp +@@ -11,11 +11,11 @@ + namespace crow + { + +-constexpr const size_t timerQueueTimeoutSeconds = 5; ++constexpr const size_t timerQueueTimeoutSeconds = 1; + namespace detail + { + +-constexpr const size_t maxSize = 100; ++constexpr const size_t maxSize = 400; + // fast timer queue for fixed tick value. + class TimerQueue + { +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend index a716e612d..b73cd3cbd 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend @@ -27,6 +27,8 @@ SRC_URI += "file://0001-Firmware-update-configuration-changes.patch \ file://0023-Add-get-IPMI-session-id-s-to-Redfish.patch \ file://0024-Add-count-sensor-type.patch \ file://0025-Add-Model-CoreCount-to-ProcessorSummary.patch \ + file://0026-Fix-Query-Parameters-issue.patch \ + file://0027-Workaround-Increase-timer-queue-size-and-reduce-time.patch \ " # OOB Bios Config: diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0001-Add-check-for-min-max-received-from-hwmon-files.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0001-Add-check-for-min-max-received-from-hwmon-files.patch index 33d35ec5e..d864d3290 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0001-Add-check-for-min-max-received-from-hwmon-files.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0001-Add-check-for-min-max-received-from-hwmon-files.patch @@ -1,4 +1,4 @@ -From 2516d67f8bb5ecd241b8dcdec3f8c58d0e3c4744 Mon Sep 17 00:00:00 2001 +From 021b17af775b58a61661f75af595b71625509241 Mon Sep 17 00:00:00 2001 From: Wojciech Dembinski Date: Mon, 7 Dec 2020 19:23:10 +0100 Subject: [PATCH] Add check for min/max received from hwmon files @@ -21,7 +21,7 @@ Change-Id: Ia061f849b0f434812f822ed1902c8964d4c64b45 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/CPUSensor.cpp b/src/CPUSensor.cpp -index 2356821..01f5eb6 100644 +index cd1038f..16c3686 100644 --- a/src/CPUSensor.cpp +++ b/src/CPUSensor.cpp @@ -1,5 +1,5 @@ @@ -31,7 +31,7 @@ index 2356821..01f5eb6 100644 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. -@@ -146,19 +146,22 @@ void CPUSensor::setupRead(void) +@@ -166,19 +166,22 @@ void CPUSensor::setupRead(void) void CPUSensor::updateMinMaxValues(void) { @@ -62,7 +62,7 @@ index 2356821..01f5eb6 100644 if (auto fileParts = splitFileName(path)) { -@@ -168,26 +171,25 @@ void CPUSensor::updateMinMaxValues(void) +@@ -188,26 +191,25 @@ void CPUSensor::updateMinMaxValues(void) { for (const auto& vectorItem : mapIt->second) { 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 cfdc99d66..7c4dbfc19 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 0a1b2a13f6dbc64b5851ac2b1ca99d57afa78d60 Mon Sep 17 00:00:00 2001 +From 23ccb3de03ad9b49f2441aa0f7a0cfb20ea8ee78 Mon Sep 17 00:00:00 2001 From: Jae Hyun Yoo 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 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp -index f304e3f..92c1716 100644 +index a352735..abae170 100644 --- a/src/CPUSensorMain.cpp +++ b/src/CPUSensorMain.cpp -@@ -82,6 +82,7 @@ struct CPUConfig +@@ -83,6 +83,7 @@ struct CPUConfig }; static constexpr const char* peciDev = "/dev/peci-"; @@ -23,7 +23,7 @@ index f304e3f..92c1716 100644 static constexpr const unsigned int rankNumMax = 8; namespace fs = std::filesystem; -@@ -167,7 +168,7 @@ bool createSensors(boost::asio::io_service& io, +@@ -168,7 +169,7 @@ bool createSensors(boost::asio::io_service& io, } std::vector hwmonNamePaths; @@ -32,7 +32,7 @@ index f304e3f..92c1716 100644 R"(peci-\d+/\d+-.+/peci-.+/hwmon/hwmon\d+/name$)", hwmonNamePaths, 6)) { -@@ -403,7 +404,7 @@ bool createSensors(boost::asio::io_service& io, +@@ -404,7 +405,7 @@ bool createSensors(boost::asio::io_service& io, return true; } @@ -41,7 +41,7 @@ index f304e3f..92c1716 100644 { std::ostringstream hex; hex << std::hex << config.addr; -@@ -411,9 +412,12 @@ void exportDevice(const CPUConfig& config) +@@ -412,9 +413,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 f304e3f..92c1716 100644 const std::string& dir = devicePath.parent_path().string(); for (const auto& path : std::filesystem::directory_iterator(dir)) { -@@ -431,20 +435,38 @@ void exportDevice(const CPUConfig& config) +@@ -432,20 +436,38 @@ void exportDevice(const CPUConfig& config) std::cout << parameters << " on bus " << busStr << " is already exported\n"; } @@ -99,7 +99,7 @@ index f304e3f..92c1716 100644 } void detectCpu(boost::asio::deadline_timer& pingTimer, -@@ -460,6 +482,11 @@ void detectCpu(boost::asio::deadline_timer& pingTimer, +@@ -461,6 +483,11 @@ void detectCpu(boost::asio::deadline_timer& pingTimer, for (CPUConfig& config : cpuConfigs) { @@ -111,7 +111,7 @@ index f304e3f..92c1716 100644 std::string peciDevPath = peciDev + std::to_string(config.bus); auto file = open(peciDevPath.c_str(), O_RDWR | O_CLOEXEC); if (file < 0) -@@ -510,16 +537,29 @@ void detectCpu(boost::asio::deadline_timer& pingTimer, +@@ -511,16 +538,29 @@ void detectCpu(boost::asio::deadline_timer& pingTimer, newState = State::OFF; } @@ -145,7 +145,7 @@ index f304e3f..92c1716 100644 } if (newState == State::ON) -@@ -542,6 +582,8 @@ void detectCpu(boost::asio::deadline_timer& pingTimer, +@@ -543,6 +583,8 @@ void detectCpu(boost::asio::deadline_timer& pingTimer, keepPinging = true; } 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 index 1cba1095d..fe9ce264d 100644 --- 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 @@ -1,4 +1,4 @@ -From db4353de222b51726c8e3c765cc8f1df4ad67687 Mon Sep 17 00:00:00 2001 +From d477be5da32c62fc30096a99d1e601ed7c42a10c Mon Sep 17 00:00:00 2001 From: Zhikui Ren Date: Tue, 22 Jun 2021 11:35:12 -0700 Subject: [PATCH] Fix missing de-assert event when threshold changes @@ -46,10 +46,10 @@ Signed-off-by: Zhikui Ren 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/include/Thresholds.hpp b/include/Thresholds.hpp -index af63f72..fd507d0 100644 +index 209d68e..640fdb4 100644 --- a/include/Thresholds.hpp +++ b/include/Thresholds.hpp -@@ -44,7 +44,7 @@ struct Threshold +@@ -47,7 +47,7 @@ struct Threshold void assertThresholds(Sensor* sensor, double assertValue, thresholds::Level level, thresholds::Direction direction, @@ -59,18 +59,18 @@ index af63f72..fd507d0 100644 struct TimerUsed { diff --git a/include/sensor.hpp b/include/sensor.hpp -index b98241b..6235674 100644 +index d38bcde..b8cfd66 100644 --- a/include/sensor.hpp +++ b/include/sensor.hpp -@@ -71,6 +71,7 @@ struct Sensor - std::shared_ptr operationalInterface; +@@ -81,6 +81,7 @@ struct Sensor + std::shared_ptr valueMutabilityInterface; double value = std::numeric_limits::quiet_NaN(); double rawValue = std::numeric_limits::quiet_NaN(); + bool hadValidValue = false; bool overriddenState = false; bool internalSet = false; double hysteresisTrigger; -@@ -432,6 +433,7 @@ struct Sensor +@@ -462,6 +463,7 @@ struct Sensor { markFunctional(true); markAvailable(true); @@ -79,10 +79,10 @@ index b98241b..6235674 100644 } diff --git a/src/Thresholds.cpp b/src/Thresholds.cpp -index 821083a..da0d650 100644 +index 0581f21..84df7cf 100644 --- a/src/Thresholds.cpp +++ b/src/Thresholds.cpp -@@ -418,10 +418,19 @@ bool checkThresholds(Sensor* sensor) +@@ -426,10 +426,19 @@ bool checkThresholds(Sensor* sensor) { bool status = true; std::vector changes = checkThresholds(sensor, sensor->value); @@ -103,7 +103,7 @@ index 821083a..da0d650 100644 if (change.threshold.level == thresholds::Level::CRITICAL && change.asserted) { -@@ -443,6 +452,7 @@ void checkThresholdsPowerDelay(const std::weak_ptr& weakSensor, +@@ -451,6 +460,7 @@ void checkThresholdsPowerDelay(const std::weak_ptr& weakSensor, Sensor* sensor = sensorPtr.get(); std::vector changes = checkThresholds(sensor, sensor->value); @@ -111,7 +111,7 @@ index 821083a..da0d650 100644 for (const auto& change : changes) { // When CPU is powered off, some volatges are expected to -@@ -467,13 +477,13 @@ void checkThresholdsPowerDelay(const std::weak_ptr& weakSensor, +@@ -475,13 +485,13 @@ void checkThresholdsPowerDelay(const std::weak_ptr& weakSensor, } } assertThresholds(sensor, change.assertValue, change.threshold.level, @@ -127,7 +127,7 @@ index 821083a..da0d650 100644 { std::string property; std::shared_ptr interface; -@@ -513,7 +523,9 @@ void assertThresholds(Sensor* sensor, double assertValue, +@@ -521,7 +531,9 @@ void assertThresholds(Sensor* sensor, double assertValue, return; } 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 index 214fbe888..c04d16feb 100644 --- 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 @@ -1,4 +1,4 @@ -From 221aaf1431a01fefb5e7df2461a1c691738a50a7 Mon Sep 17 00:00:00 2001 +From 6c482ff2206cedea73615d3c0370f6edfd245a08 Mon Sep 17 00:00:00 2001 From: Zhikui Ren Date: Fri, 19 Feb 2021 12:14:05 -0800 Subject: [PATCH] Fan Tach Sensor Threshold Ignore Zero @@ -21,17 +21,23 @@ Tested: No cr event for the missing fans. Signed-off-by: Zhikui Ren +Signed-off-by: Saravanan Palanisamy +Change-Id: I6ef1d61573dcb8c15c0b76a6a6805f368be13fc0 --- - src/TachSensor.cpp | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) + src/TachSensor.cpp | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/TachSensor.cpp b/src/TachSensor.cpp -index c375dbf..e85a2a2 100644 +index 2c48cc9..e85a2a2 100644 --- a/src/TachSensor.cpp +++ b/src/TachSensor.cpp -@@ -186,10 +186,16 @@ void TachSensor::checkThresholds(void) - // WA - treat value <= 0 as not present - bool status = false; +@@ -183,12 +183,19 @@ void TachSensor::handleResponse(const boost::system::error_code& err) + + void TachSensor::checkThresholds(void) + { +- bool status = thresholds::checkThresholds(this); ++ // WA - treat value <= 0 as not present ++ bool status = false; - if (redundancy && *redundancy) + if (value > 0) 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 index 8119f7542..6fb1a27e6 100644 --- 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 @@ -1,4 +1,4 @@ -From f85dd776301371892ff5197c1995bf2224dd87ab Mon Sep 17 00:00:00 2001 +From 07f431e2d58e6e41482141c32a4cc2e9b62755d8 Mon Sep 17 00:00:00 2001 From: Jae Hyun Yoo Date: Mon, 22 Feb 2021 15:57:20 -0800 Subject: [PATCH] Fix PECI ioctl number @@ -12,7 +12,7 @@ Signed-off-by: Jae Hyun Yoo 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 +index e5b4b8b..1f44edf 100644 --- a/include/linux/peci-ioctl.h +++ b/include/linux/peci-ioctl.h @@ -601,7 +601,7 @@ struct peci_crashdump_get_frame_msg { diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0006-CPUSensor-create-RequirediTempSensor-if-defined.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0006-CPUSensor-create-RequirediTempSensor-if-defined.patch index 2083adfef..4c340a37a 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0006-CPUSensor-create-RequirediTempSensor-if-defined.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0006-CPUSensor-create-RequirediTempSensor-if-defined.patch @@ -1,4 +1,4 @@ -From 6ace96be5a7b6763545c1dfc572f8e2790d99d4b Mon Sep 17 00:00:00 2001 +From fefdd414b158d7b4424cb213dc74e89bab0507ab Mon Sep 17 00:00:00 2001 From: Zhikui Ren Date: Tue, 11 May 2021 11:14:55 -0700 Subject: [PATCH] CPUSensor: create RequiredTempSensor if defined @@ -28,10 +28,10 @@ Signed-off-by: Zhikui Ren 3 files changed, 123 insertions(+), 8 deletions(-) diff --git a/include/CPUSensor.hpp b/include/CPUSensor.hpp -index 8b51b76..93b7fcc 100644 +index 84a1e32..a083b9d 100644 --- a/include/CPUSensor.hpp +++ b/include/CPUSensor.hpp -@@ -26,6 +26,15 @@ class CPUSensor : public Sensor +@@ -26,6 +26,15 @@ class CPUSensor : public Sensor, public std::enable_shared_from_this std::vector&& thresholds, const std::string& configuration, int cpuId, bool show, double dtsOffset); @@ -48,11 +48,11 @@ index 8b51b76..93b7fcc 100644 static constexpr unsigned int sensorScaleFactor = 1000; static constexpr unsigned int sensorPollMs = 1000; diff --git a/src/CPUSensor.cpp b/src/CPUSensor.cpp -index c330088..3861ade 100644 +index 16c3686..5aab17f 100644 --- a/src/CPUSensor.cpp +++ b/src/CPUSensor.cpp @@ -98,6 +98,74 @@ CPUSensor::CPUSensor(const std::string& path, const std::string& objectType, - setupRead(); + setupPowerMatch(conn); } +// Create a dummy "not available" CPUSensor @@ -127,7 +127,7 @@ index c330088..3861ade 100644 { // close the input dev to cancel async operations diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp -index 0d94e4b..1d12fa6 100644 +index abae170..2b02d60 100644 --- a/src/CPUSensorMain.cpp +++ b/src/CPUSensorMain.cpp @@ -332,10 +332,9 @@ bool createSensors(boost::asio::io_service& io, @@ -143,7 +143,7 @@ index 0d94e4b..1d12fa6 100644 } // check hidden properties -@@ -636,9 +635,9 @@ void detectCpuAsync( +@@ -637,9 +636,9 @@ void detectCpuAsync( }); } @@ -155,7 +155,7 @@ index 0d94e4b..1d12fa6 100644 sdbusplus::asio::object_server& objectServer) { bool useCache = false; -@@ -700,6 +699,45 @@ bool getCpuConfig(const std::shared_ptr& systemBus, +@@ -701,6 +700,45 @@ bool getCpuConfig(const std::shared_ptr& systemBus, iface->register_property("Present", *present); iface->initialize(); inventoryIfaces[name] = std::move(iface); @@ -201,7 +201,7 @@ index 0d94e4b..1d12fa6 100644 } auto findBus = config.second.find("Bus"); -@@ -728,7 +766,6 @@ bool getCpuConfig(const std::shared_ptr& systemBus, +@@ -729,7 +767,6 @@ bool getCpuConfig(const std::shared_ptr& systemBus, std::cout << "name: " << name << "\n"; std::cout << "type: " << type << "\n"; } @@ -209,7 +209,7 @@ index 0d94e4b..1d12fa6 100644 cpuConfigs.emplace(bus, addr, name, State::OFF); } } -@@ -764,7 +801,8 @@ int main() +@@ -765,7 +802,8 @@ int main() return; // we're being canceled } @@ -219,7 +219,7 @@ index 0d94e4b..1d12fa6 100644 { detectCpuAsync(pingTimer, creationTimer, io, objectServer, systemBus, cpuConfigs, sensorConfigs); -@@ -792,7 +830,7 @@ int main() +@@ -793,7 +831,7 @@ int main() return; // we're being canceled } diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0007-Add-support-for-the-energy-hwmon-type.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0007-Add-support-for-the-energy-hwmon-type.patch index daaca7fae..ac7dfdfcf 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0007-Add-support-for-the-energy-hwmon-type.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0007-Add-support-for-the-energy-hwmon-type.patch @@ -1,4 +1,4 @@ -From 9f5ef2e8d9c34d9d9ddce34d450aaedd5c122b22 Mon Sep 17 00:00:00 2001 +From e280ca18317ec7095e876a97ab6164ab5100c1e0 Mon Sep 17 00:00:00 2001 From: Szymon Dompke Date: Tue, 18 May 2021 05:22:33 +0200 Subject: [PATCH] Add support for the energy hwmon type @@ -37,7 +37,7 @@ Signed-off-by: Szymon Dompke 3 files changed, 60 insertions(+), 51 deletions(-) diff --git a/include/CPUSensor.hpp b/include/CPUSensor.hpp -index 93b7fcc..76e43dc 100644 +index a083b9d..a6fbdad 100644 --- a/include/CPUSensor.hpp +++ b/include/CPUSensor.hpp @@ -16,6 +16,15 @@ @@ -53,10 +53,10 @@ index 93b7fcc..76e43dc 100644 + unsigned int scaleFactor; +}; + - class CPUSensor : public Sensor + class CPUSensor : public Sensor, public std::enable_shared_from_this { public: -@@ -25,7 +34,7 @@ class CPUSensor : public Sensor +@@ -25,7 +34,7 @@ class CPUSensor : public Sensor, public std::enable_shared_from_this boost::asio::io_service& io, const std::string& sensorName, std::vector&& thresholds, const std::string& configuration, int cpuId, bool show, @@ -65,7 +65,7 @@ index 93b7fcc..76e43dc 100644 // Create a CPUSensor without a path to sensor value CPUSensor(const std::string& objectType, -@@ -36,7 +45,6 @@ class CPUSensor : public Sensor +@@ -36,7 +45,6 @@ class CPUSensor : public Sensor, public std::enable_shared_from_this const std::string& sensorConfiguration); ~CPUSensor() override; @@ -73,19 +73,19 @@ index 93b7fcc..76e43dc 100644 static constexpr unsigned int sensorPollMs = 1000; static constexpr size_t warnAfterErrorCount = 10; static constexpr const char* labelTcontrol = "Tcontrol"; -@@ -54,6 +62,7 @@ class CPUSensor : public Sensor +@@ -55,6 +63,7 @@ class CPUSensor : public Sensor, public std::enable_shared_from_this size_t pollTime; bool loggedInterfaceDown = false; uint8_t minMaxReadCounter; + unsigned int scaleFactor; - void setupRead(void); void handleResponse(const boost::system::error_code& err); void checkThresholds(void) override; + void updateMinMaxValues(void); diff --git a/src/CPUSensor.cpp b/src/CPUSensor.cpp -index 3861ade..6737151 100644 +index 5aab17f..fefd89a 100644 --- a/src/CPUSensor.cpp +++ b/src/CPUSensor.cpp -@@ -39,58 +39,37 @@ CPUSensor::CPUSensor(const std::string& path, const std::string& objectType, +@@ -39,59 +39,38 @@ CPUSensor::CPUSensor(const std::string& path, const std::string& objectType, boost::asio::io_service& io, const std::string& sensorName, std::vector&& thresholdsIn, const std::string& sensorConfiguration, int cpuId, @@ -96,7 +96,8 @@ index 3861ade..6737151 100644 - objectType, false, false, 0, 0, conn, PowerState::on), + objectType, false, false, sensorProperties.max, sensorProperties.min, + conn, PowerState::on), - objServer(objectServer), inputDev(io), waitTimer(io), path(path), + std::enable_shared_from_this(), objServer(objectServer), + inputDev(io), waitTimer(io), path(path), privTcontrol(std::numeric_limits::quiet_NaN()), dtsOffset(dtsOffset), show(show), pollTime(CPUSensor::sensorPollMs), - minMaxReadCounter(0) @@ -164,7 +165,7 @@ index 3861ade..6737151 100644 } // call setup always as not all sensors call setInitialProperties -@@ -248,7 +227,7 @@ void CPUSensor::updateMinMaxValues(void) +@@ -262,7 +241,7 @@ void CPUSensor::updateMinMaxValues(void) auto& [suffix, oldValue, dbusName, newValue] = vectorItem; auto attrPath = boost::replace_all_copy(path, fileItem, suffix); @@ -173,7 +174,7 @@ index 3861ade..6737151 100644 { newValue.get() = *tmp; } -@@ -302,7 +281,7 @@ void CPUSensor::handleResponse(const boost::system::error_code& err) +@@ -316,7 +295,7 @@ void CPUSensor::handleResponse(const boost::system::error_code& err) std::getline(responseStream, response); rawValue = std::stod(response); responseStream.clear(); @@ -182,7 +183,7 @@ index 3861ade..6737151 100644 if (show) { -@@ -328,8 +307,7 @@ void CPUSensor::handleResponse(const boost::system::error_code& err) +@@ -342,8 +321,7 @@ void CPUSensor::handleResponse(const boost::system::error_code& err) { std::vector newThresholds; if (parseThresholdsFromAttr(newThresholds, path, @@ -193,7 +194,7 @@ index 3861ade..6737151 100644 if (!std::equal(thresholds.begin(), thresholds.end(), newThresholds.begin(), diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp -index 1d12fa6..e348aa7 100644 +index 2b02d60..a64d39c 100644 --- a/src/CPUSensorMain.cpp +++ b/src/CPUSensorMain.cpp @@ -94,6 +94,18 @@ static constexpr auto sensorTypes{std::to_array({"XeonCPU"})}; @@ -253,14 +254,14 @@ index 1d12fa6..e348aa7 100644 std::cerr << "error populating thresholds for " << sensorName << "\n"; @@ -384,7 +406,7 @@ bool createSensors(boost::asio::io_service& io, - sensorPtr = std::make_unique( + sensorPtr = std::make_shared( inputPathStr, sensorType, objectServer, dbusConnection, io, sensorName, std::move(sensorThresholds), *interfacePath, cpuId, - show, dtsOffset); + show, dtsOffset, prop); + sensorPtr->setupRead(); createdSensors.insert(sensorName); if (debug) - { -- 2.17.1 diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0008-CPUSensor-additional-debug-message.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0008-CPUSensor-additional-debug-message.patch index 40c8d46bd..be2f7fa9a 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0008-CPUSensor-additional-debug-message.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0008-CPUSensor-additional-debug-message.patch @@ -1,4 +1,4 @@ -From c045d0ace218a8f0c9e9af0b04aed24ec733fc79 Mon Sep 17 00:00:00 2001 +From 805ae6679f49d0d7a3a6448af97f3cb639b9634f Mon Sep 17 00:00:00 2001 From: Zhikui Ren Date: Tue, 22 Jun 2021 14:49:44 -0700 Subject: [PATCH] CPUSensor: additional debug message @@ -24,10 +24,10 @@ Signed-off-by: Zhikui Ren 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/CPUSensor.cpp b/src/CPUSensor.cpp -index 0621e04..65acdac 100644 +index fefd89a..de33f9b 100644 --- a/src/CPUSensor.cpp +++ b/src/CPUSensor.cpp -@@ -300,6 +300,7 @@ void CPUSensor::handleResponse(const boost::system::error_code& err) +@@ -315,6 +315,7 @@ void CPUSensor::handleResponse(const boost::system::error_code& err) : std::numeric_limits::quiet_NaN(); if (gTcontrol != privTcontrol) { @@ -35,7 +35,7 @@ index 0621e04..65acdac 100644 privTcontrol = gTcontrol; if (!thresholds.empty()) -@@ -318,6 +319,10 @@ void CPUSensor::handleResponse(const boost::system::error_code& err) +@@ -333,6 +334,10 @@ void CPUSensor::handleResponse(const boost::system::error_code& err) thresholds::updateThresholds(this); } } @@ -47,10 +47,10 @@ index 0621e04..65acdac 100644 else { diff --git a/src/Thresholds.cpp b/src/Thresholds.cpp -index 78ded55..283dacf 100644 +index 84df7cf..d1e04eb 100644 --- a/src/Thresholds.cpp +++ b/src/Thresholds.cpp -@@ -583,11 +583,8 @@ bool parseThresholdsFromAttr( +@@ -592,11 +592,8 @@ bool parseThresholdsFromAttr( if (auto val = readFile(attrPath, scaleFactor)) { *val += offset; diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0009-CPUSensor-Create-CPUConfig-for-each-PECI-adapter.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0009-CPUSensor-Create-CPUConfig-for-each-PECI-adapter.patch index 737ba9128..e1896ca7c 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0009-CPUSensor-Create-CPUConfig-for-each-PECI-adapter.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0009-CPUSensor-Create-CPUConfig-for-each-PECI-adapter.patch @@ -1,4 +1,4 @@ -From 262682632ee493d0b6593540cfc902d11286b7c3 Mon Sep 17 00:00:00 2001 +From c420a04ec18e9d62e11a69a0d5e88762b2a141a3 Mon Sep 17 00:00:00 2001 From: Iwona Winiarska Date: Tue, 13 Jul 2021 15:16:16 +0200 Subject: [PATCH] CPUSensor: Create CPUConfig for each PECI adapter @@ -27,7 +27,7 @@ Signed-off-by: Iwona Winiarska 1 file changed, 90 insertions(+) diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp -index 744ca50..6850df7 100644 +index a64d39c..32cb6b3 100644 --- a/src/CPUSensorMain.cpp +++ b/src/CPUSensorMain.cpp @@ -33,6 +33,7 @@ @@ -143,5 +143,5 @@ index 744ca50..6850df7 100644 } } -- -2.31.1 +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 765ad3739..08f28685f 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,7 +1,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" PROJECT_SRC_DIR := "${THISDIR}/${PN}" -SRCREV = "77518b28db824e01af18351094680a99b1ba3cae" +SRCREV = "04d050669c95218230d9fb45385479df43fc1a0d" #SRC_URI = "git://github.com/openbmc/dbus-sensors.git" SRC_URI += "\ -- cgit v1.2.3