summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/sensors
diff options
context:
space:
mode:
authorjmbills <jason.m.bills@intel.com>2022-01-18 21:55:05 +0300
committerGitHub <noreply@github.com>2022-01-18 21:55:05 +0300
commit7cf0c1cd0ce835d1833509b7b911e8a97380278b (patch)
tree0b45c3beaa9874facc4ed1a2395a31e42be0135d /meta-openbmc-mods/meta-common/recipes-phosphor/sensors
parent4dac5fcd49b5e2de1074f1363775ec0f19041072 (diff)
parent1fc0d70f658da30091bcd49f9bf29aecd6b99ba7 (diff)
downloadopenbmc-7cf0c1cd0ce835d1833509b7b911e8a97380278b.tar.xz
Merge pull request #76 from Intel-BMC/update1-0.86
Update
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor/sensors')
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0004-Fan-Tach-Sensor-Threshold-Ignore-Zero.patch18
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0006-CPUSensor-create-RequirediTempSensor-if-defined.patch33
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0007-Add-support-for-the-energy-hwmon-type.patch49
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend2
4 files changed, 48 insertions, 54 deletions
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 65558aba5..214fbe888 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 8f850ea8745aa7aafcb504aa50686ba00fdfcfee Mon Sep 17 00:00:00 2001
+From 221aaf1431a01fefb5e7df2461a1c691738a50a7 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
@@ -22,22 +22,18 @@ 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(-)
+ src/TachSensor.cpp | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/TachSensor.cpp b/src/TachSensor.cpp
-index 1ec979f..b17be98 100644
+index c375dbf..e85a2a2 100644
--- a/src/TachSensor.cpp
+++ b/src/TachSensor.cpp
-@@ -185,12 +185,18 @@ void TachSensor::handleResponse(const boost::system::error_code& err)
+@@ -186,10 +186,16 @@ void TachSensor::checkThresholds(void)
+ // WA - treat value <= 0 as not present
+ bool status = false;
- 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)
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 0a6e73708..2083adfef 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 ba069b63307352ae0dc0a94a837306dc0bc51e94 Mon Sep 17 00:00:00 2001
+From 6ace96be5a7b6763545c1dfc572f8e2790d99d4b Mon Sep 17 00:00:00 2001
From: Zhikui Ren <zhikui.ren@intel.com>
Date: Tue, 11 May 2021 11:14:55 -0700
Subject: [PATCH] CPUSensor: create RequiredTempSensor if defined
@@ -23,12 +23,12 @@ failure case. More work will follow to support a more generic
Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
---
include/CPUSensor.hpp | 9 ++++++
- src/CPUSensor.cpp | 69 +++++++++++++++++++++++++++++++++++++++++++
- src/CPUSensorMain.cpp | 54 ++++++++++++++++++++++++++++-----
- 3 files changed, 124 insertions(+), 8 deletions(-)
+ src/CPUSensor.cpp | 68 +++++++++++++++++++++++++++++++++++++++++++
+ src/CPUSensorMain.cpp | 54 +++++++++++++++++++++++++++++-----
+ 3 files changed, 123 insertions(+), 8 deletions(-)
diff --git a/include/CPUSensor.hpp b/include/CPUSensor.hpp
-index 29b8209..5d09e4e 100644
+index 8b51b76..93b7fcc 100644
--- a/include/CPUSensor.hpp
+++ b/include/CPUSensor.hpp
@@ -26,6 +26,15 @@ class CPUSensor : public Sensor
@@ -48,10 +48,10 @@ index 29b8209..5d09e4e 100644
static constexpr unsigned int sensorScaleFactor = 1000;
static constexpr unsigned int sensorPollMs = 1000;
diff --git a/src/CPUSensor.cpp b/src/CPUSensor.cpp
-index c882698..277dd3f 100644
+index c330088..3861ade 100644
--- a/src/CPUSensor.cpp
+++ b/src/CPUSensor.cpp
-@@ -99,6 +99,75 @@ CPUSensor::CPUSensor(const std::string& path, const std::string& objectType,
+@@ -98,6 +98,74 @@ CPUSensor::CPUSensor(const std::string& path, const std::string& objectType,
setupRead();
}
@@ -64,9 +64,8 @@ index c882698..277dd3f 100644
+ boost::asio::io_service& io, const std::string& sensorName,
+ std::vector<thresholds::Threshold>&& thresholdsIn,
+ const std::string& sensorConfiguration) :
-+ Sensor(boost::replace_all_copy(sensorName, " ", "_"),
-+ std::move(thresholdsIn), sensorConfiguration, objectType, false, 0,
-+ 0, conn, PowerState::on),
++ Sensor(escapeName(sensorName), std::move(thresholdsIn), sensorConfiguration,
++ objectType, false, false, 0, 0, conn, PowerState::on),
+ objServer(objectServer), inputDev(io), waitTimer(io),
+ privTcontrol(std::numeric_limits<double>::quiet_NaN()), dtsOffset(0),
+ show(true), pollTime(CPUSensor::sensorPollMs), minMaxReadCounter(0)
@@ -128,10 +127,10 @@ index c882698..277dd3f 100644
{
// close the input dev to cancel async operations
diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp
-index c565890..a28a5be 100644
+index 0d94e4b..1d12fa6 100644
--- a/src/CPUSensorMain.cpp
+++ b/src/CPUSensorMain.cpp
-@@ -333,10 +333,9 @@ bool createSensors(boost::asio::io_service& io,
+@@ -332,10 +332,9 @@ bool createSensors(boost::asio::io_service& io,
{
if (debug)
{
@@ -144,7 +143,7 @@ index c565890..a28a5be 100644
}
// check hidden properties
-@@ -637,9 +636,9 @@ void detectCpuAsync(
+@@ -636,9 +635,9 @@ void detectCpuAsync(
});
}
@@ -156,7 +155,7 @@ index c565890..a28a5be 100644
sdbusplus::asio::object_server& objectServer)
{
bool useCache = false;
-@@ -701,6 +700,45 @@ bool getCpuConfig(const std::shared_ptr<sdbusplus::asio::connection>& systemBus,
+@@ -700,6 +699,45 @@ bool getCpuConfig(const std::shared_ptr<sdbusplus::asio::connection>& systemBus,
iface->register_property("Present", *present);
iface->initialize();
inventoryIfaces[name] = std::move(iface);
@@ -202,7 +201,7 @@ index c565890..a28a5be 100644
}
auto findBus = config.second.find("Bus");
-@@ -729,7 +767,6 @@ bool getCpuConfig(const std::shared_ptr<sdbusplus::asio::connection>& systemBus,
+@@ -728,7 +766,6 @@ bool getCpuConfig(const std::shared_ptr<sdbusplus::asio::connection>& systemBus,
std::cout << "name: " << name << "\n";
std::cout << "type: " << type << "\n";
}
@@ -210,7 +209,7 @@ index c565890..a28a5be 100644
cpuConfigs.emplace(bus, addr, name, State::OFF);
}
}
-@@ -765,7 +802,8 @@ int main()
+@@ -764,7 +801,8 @@ int main()
return; // we're being canceled
}
@@ -220,7 +219,7 @@ index c565890..a28a5be 100644
{
detectCpuAsync(pingTimer, creationTimer, io, objectServer,
systemBus, cpuConfigs, sensorConfigs);
-@@ -793,7 +831,7 @@ int main()
+@@ -792,7 +830,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 dbe851fde..daaca7fae 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 b839028a4dda6fcec027f3a26887e0de0e8172bb Mon Sep 17 00:00:00 2001
+From 9f5ef2e8d9c34d9d9ddce34d450aaedd5c122b22 Mon Sep 17 00:00:00 2001
From: Szymon Dompke <szymon.dompke@intel.com>
Date: Tue, 18 May 2021 05:22:33 +0200
Subject: [PATCH] Add support for the energy hwmon type
@@ -31,13 +31,13 @@ Tested:
Authored-by: Zbigniew Kurzynski <zbigniew.kurzynski@intel.com>
Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
---
- include/CPUSensor.hpp | 13 ++++++--
- src/CPUSensor.cpp | 69 +++++++++++++++----------------------------
+ include/CPUSensor.hpp | 13 +++++++--
+ src/CPUSensor.cpp | 68 +++++++++++++++----------------------------
src/CPUSensorMain.cpp | 30 ++++++++++++++++---
- 3 files changed, 60 insertions(+), 52 deletions(-)
+ 3 files changed, 60 insertions(+), 51 deletions(-)
diff --git a/include/CPUSensor.hpp b/include/CPUSensor.hpp
-index 5d09e4e..cb3742a 100644
+index 93b7fcc..76e43dc 100644
--- a/include/CPUSensor.hpp
+++ b/include/CPUSensor.hpp
@@ -16,6 +16,15 @@
@@ -82,21 +82,20 @@ index 5d09e4e..cb3742a 100644
void handleResponse(const boost::system::error_code& err);
void checkThresholds(void) override;
diff --git a/src/CPUSensor.cpp b/src/CPUSensor.cpp
-index 277dd3f..0621e04 100644
+index 3861ade..6737151 100644
--- a/src/CPUSensor.cpp
+++ b/src/CPUSensor.cpp
-@@ -39,59 +39,37 @@ CPUSensor::CPUSensor(const std::string& path, const std::string& objectType,
+@@ -39,58 +39,37 @@ CPUSensor::CPUSensor(const std::string& path, const std::string& objectType,
boost::asio::io_service& io, const std::string& sensorName,
std::vector<thresholds::Threshold>&& thresholdsIn,
const std::string& sensorConfiguration, int cpuId,
- bool show, double dtsOffset) :
+ bool show, double dtsOffset,
+ const SensorProperties& sensorProperties) :
- Sensor(boost::replace_all_copy(sensorName, " ", "_"),
-- std::move(thresholdsIn), sensorConfiguration, objectType, false, 0,
-- 0, conn, PowerState::on),
-+ std::move(thresholdsIn), sensorConfiguration, objectType, false,
-+ sensorProperties.max, sensorProperties.min, conn, PowerState::on),
+ Sensor(escapeName(sensorName), std::move(thresholdsIn), sensorConfiguration,
+- 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),
privTcontrol(std::numeric_limits<double>::quiet_NaN()),
dtsOffset(dtsOffset), show(show), pollTime(CPUSensor::sensorPollMs),
@@ -152,12 +151,12 @@ index 277dd3f..0621e04 100644
- setInitialProperties(conn, units);
+ thresholdInterfaceWarning = objectServer.add_interface(
+ interfacePath, "xyz.openbmc_project.Sensor.Threshold.Warning");
-+ }
+ }
+ if (thresholds::hasCriticalInterface(thresholds))
+ {
+ thresholdInterfaceCritical = objectServer.add_interface(
+ interfacePath, "xyz.openbmc_project.Sensor.Threshold.Critical");
- }
++ }
+ association =
+ objectServer.add_interface(interfacePath, association::interface);
+
@@ -165,7 +164,7 @@ index 277dd3f..0621e04 100644
}
// call setup always as not all sensors call setInitialProperties
-@@ -248,7 +226,7 @@ void CPUSensor::updateMinMaxValues(void)
+@@ -248,7 +227,7 @@ void CPUSensor::updateMinMaxValues(void)
auto& [suffix, oldValue, dbusName, newValue] = vectorItem;
auto attrPath = boost::replace_all_copy(path, fileItem, suffix);
@@ -174,7 +173,7 @@ index 277dd3f..0621e04 100644
{
newValue.get() = *tmp;
}
-@@ -302,7 +280,7 @@ void CPUSensor::handleResponse(const boost::system::error_code& err)
+@@ -302,7 +281,7 @@ void CPUSensor::handleResponse(const boost::system::error_code& err)
std::getline(responseStream, response);
rawValue = std::stod(response);
responseStream.clear();
@@ -183,7 +182,7 @@ index 277dd3f..0621e04 100644
if (show)
{
-@@ -328,8 +306,7 @@ void CPUSensor::handleResponse(const boost::system::error_code& err)
+@@ -328,8 +307,7 @@ void CPUSensor::handleResponse(const boost::system::error_code& err)
{
std::vector<thresholds::Threshold> newThresholds;
if (parseThresholdsFromAttr(newThresholds, path,
@@ -194,12 +193,12 @@ index 277dd3f..0621e04 100644
if (!std::equal(thresholds.begin(), thresholds.end(),
newThresholds.begin(),
diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp
-index a28a5be..baa2bb6 100644
+index 1d12fa6..e348aa7 100644
--- a/src/CPUSensorMain.cpp
+++ b/src/CPUSensorMain.cpp
-@@ -94,6 +94,18 @@ static constexpr std::array<const char*, 1> sensorTypes = {"XeonCPU"};
- static constexpr std::array<const char*, 3> hiddenProps = {
- CPUSensor::labelTcontrol, "Tthrottle", "Tjmax"};
+@@ -94,6 +94,18 @@ static constexpr auto sensorTypes{std::to_array<const char*>({"XeonCPU"})};
+ static constexpr auto hiddenProps{std::to_array<const char*>(
+ {CPUSensor::labelTcontrol, "Tthrottle", "Tjmax"})};
+static const boost::container::flat_map<std::string, SensorProperties>
+ sensorPropertiesMap = {
@@ -216,7 +215,7 @@ index a28a5be..baa2bb6 100644
void detectCpuAsync(
boost::asio::deadline_timer& pingTimer,
boost::asio::deadline_timer& creationTimer, boost::asio::io_service& io,
-@@ -297,7 +309,8 @@ bool createSensors(boost::asio::io_service& io,
+@@ -296,7 +308,8 @@ bool createSensors(boost::asio::io_service& io,
auto directory = hwmonNamePath.parent_path();
std::vector<fs::path> inputPaths;
@@ -226,7 +225,7 @@ index a28a5be..baa2bb6 100644
inputPaths, 0))
{
std::cerr << "No temperature sensors in system\n";
-@@ -365,6 +378,16 @@ bool createSensors(boost::asio::io_service& io,
+@@ -364,6 +377,16 @@ bool createSensors(boost::asio::io_service& io,
}
}
@@ -243,7 +242,7 @@ index a28a5be..baa2bb6 100644
std::vector<thresholds::Threshold> sensorThresholds;
std::string labelHead = label.substr(0, label.find(' '));
parseThresholdsFromConfig(*sensorData, sensorThresholds,
-@@ -372,8 +395,7 @@ bool createSensors(boost::asio::io_service& io,
+@@ -371,8 +394,7 @@ bool createSensors(boost::asio::io_service& io,
if (sensorThresholds.empty())
{
if (!parseThresholdsFromAttr(sensorThresholds, inputPathStr,
@@ -253,7 +252,7 @@ index a28a5be..baa2bb6 100644
{
std::cerr << "error populating thresholds for "
<< sensorName << "\n";
-@@ -385,7 +407,7 @@ bool createSensors(boost::asio::io_service& io,
+@@ -384,7 +406,7 @@ bool createSensors(boost::asio::io_service& io,
sensorPtr = std::make_unique<CPUSensor>(
inputPathStr, sensorType, objectServer, dbusConnection, io,
sensorName, std::move(sensorThresholds), *interfacePath, cpuId,
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 ccffb1e58..765ad3739 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 = "1e34cecad498e89fb52b4c73cb19e62a297f2329"
+SRCREV = "77518b28db824e01af18351094680a99b1ba3cae"
#SRC_URI = "git://github.com/openbmc/dbus-sensors.git"
SRC_URI += "\