Fix Max fan speed with Deconfigured DIMM
Fan Speeds Remain at Maximum Speed With Deconfigured DIMMs
Tested: Injected Errors on DIMMs.
Signed-off-by: Sheldon Bailey <baileysh@us.ibm.com>
Change-Id: I797698f888cd9fb431d4f490c144eb5ad942bcd8
diff --git a/occ_manager.cpp b/occ_manager.cpp
index 4dc231f..88b0d26 100644
--- a/occ_manager.cpp
+++ b/occ_manager.cpp
@@ -403,7 +403,7 @@
}
#ifdef READ_OCC_SENSORS
// Clear OCC sensors
- setSensorValueToNonFunctional(instance);
+ setSensorValueToNaN(instance);
#endif
}
@@ -664,7 +664,7 @@
// OCC is not running yet
#ifdef READ_OCC_SENSORS
auto id = obj->getOccInstanceID();
- setSensorValueToNonFunctional(id);
+ setSensorValueToNaN(id);
#endif
continue;
}
@@ -842,6 +842,7 @@
continue;
}
+ // NOTE: if OCC sends back 0xFF kernal sets this fault value to 1.
if (faultValue != 0)
{
dbus::OccDBusSensors::getOccDBus().setValue(
@@ -1005,7 +1006,7 @@
return;
}
-void Manager::setSensorValueToNaN(uint32_t id)
+void Manager::setSensorValueToNaN(uint32_t id) const
{
for (const auto& [sensorPath, occId] : existingSensors)
{
@@ -1013,6 +1014,9 @@
{
dbus::OccDBusSensors::getOccDBus().setValue(
sensorPath, std::numeric_limits<double>::quiet_NaN());
+
+ dbus::OccDBusSensors::getOccDBus().setOperationalStatus(sensorPath,
+ true);
}
}
return;
diff --git a/occ_manager.hpp b/occ_manager.hpp
index 0a38b01..65d7545 100644
--- a/occ_manager.hpp
+++ b/occ_manager.hpp
@@ -145,6 +145,12 @@
/** @brief Notify pcap object to update bounds */
void updatePcapBounds() const;
+ /**
+ * @brief Set all sensor values of this OCC to NaN.
+ * @param[in] id - Id of the OCC.
+ * */
+ void setSensorValueToNaN(uint32_t id) const;
+
/** @brief Set all sensor values of this OCC to NaN and non functional.
*
* @param[in] id - Id of the OCC.
@@ -368,12 +374,6 @@
* */
void readPowerSensors(const fs::path& path, uint32_t id);
- /**
- * @brief Set all sensor values of this OCC to NaN.
- * @param[in] id - Id of the OCC.
- * */
- void setSensorValueToNaN(uint32_t id);
-
/** @brief Store the existing OCC sensors on D-BUS */
std::map<std::string, uint32_t> existingSensors;
diff --git a/occ_status.cpp b/occ_status.cpp
index cbacd1a..6174c91 100644
--- a/occ_status.cpp
+++ b/occ_status.cpp
@@ -512,7 +512,7 @@
}
#ifdef READ_OCC_SENSORS
- manager.setSensorValueToNonFunctional(instance);
+ manager.setSensorValueToNaN(instance);
#endif
// See occReadRetries for number of retry attempts.