summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor')
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-fru-device-Add-MUX-channel-name-to-FRU-objects.patch268
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend3
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0028-Add-FirmwareResiliency-and-FirmwareUpdateStatus.patch138
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0029-Fix-Property-PhysicalContext-is-invalid-none.patch520
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0030-Change-Severity-for-ServiceFailure-redfish-event.patch56
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0031-Change-PcieType-to-PCIeType.patch68
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/biosconfig/0001-Define-Redfish-interface-Registries-Bios.patch11
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/biosconfig/0006-Add-fix-for-broken-feature-Pending-Attributes.patch43
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0004-Add-Server-Sent-Events-support.patch38
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0014-Fix-Event-Subscription-URI.patch37
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0004-Fixed-timestamp-in-telemetry-service.patch106
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README5
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/vm/0008-Return-404-for-POST-on-Proxy-InsertMedia.patch379
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend8
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-user_mgmt-Fix-for-user-privilege-race-condition.patch152
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend1
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend10
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb2
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0010-Add-support-for-Get-PMBUS-Readings-method.patch457
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0011-Fix-for-cpusensor-going-into-D-state.patch224
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0012-Serialize-cpusensor-polling.patch343
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0013-Add-dummy-cpu-sensor-flag.patch60
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0014-Treat-zero-temperatures-readings-as-errors-in-IpmbSe.patch49
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors_%.bbappend5
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch58
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/virtual-media/virtual-media.bb2
27 files changed, 2972 insertions, 73 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-fru-device-Add-MUX-channel-name-to-FRU-objects.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-fru-device-Add-MUX-channel-name-to-FRU-objects.patch
new file mode 100644
index 000000000..5c301a7eb
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0001-fru-device-Add-MUX-channel-name-to-FRU-objects.patch
@@ -0,0 +1,268 @@
+From 7a5638d451dd323b81bd946ea7d688304b7a5b29 Mon Sep 17 00:00:00 2001
+From: Zhikui Ren <zhikui.ren@intel.com>
+Date: Tue, 21 Sep 2021 14:48:09 -0700
+Subject: [PATCH] fru-device: Add MUX channel name to FRU objects
+
+If multiple FRUs of the same type are plugged into different channels
+of a i2c mux, it may be desirable to be able to identify them
+in a predictable way instead of with a dynamically assigned bus number.
+
+Entity manager supports channel name configuration for MUX device type.
+Add a function to test if a FRU is behind a MUX and a channel name exists.
+If the channel name is found, set MUX property to the channel name.
+
+In templateCharReplace function, trim the leading and trailing spaces
+in the resulted string. Replace multiple spaces in middle of string
+with one single space. Example: "$MUX PSU" is parsed to "PSU" and
+"Pwm $MUX PSU" is parsed to "Pwm PSU" when $MUX is empty,
+ie FRU is connected without a mux.
+
+Now $MUX can be added as a template in a FRU's configuration JSON file.
+This gives identical inventory entities (FRUs) unique and meaningful
+names. SOLUM_PSSF162202_PSU.json is modified to use this new feature.
+
+Tested:
+1) Run on systems that have multiple PSUs connected to a I2C Mux.
+$MUX in config file is replaced with channel name for the mux.
+2) PSU connected without the mux, same objects are created as before.
+busctl tree xyz.openbmc_project.PSUSensor
+/xyz/openbmc_project/sensors
+ |-/xyz/openbmc_project/sensors/current
+ | |-/xyz/openbmc_project/sensors/current/PSU1_Input_Current
+ | `-/xyz/openbmc_project/sensors/current/PSU1_Output_Current
+3) phosphor-pid-control service starts up successfully
+
+Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
+Change-Id: Ide804dfd56c34c73e8dcffc0eab818609fe1a69c
+---
+ configurations/SOLUM_PSSF162202_PSU.json | 44 ++++++++++++++----------
+ src/FruDevice.cpp | 28 ++++++++++++++-
+ src/Utils.cpp | 3 ++
+ 3 files changed, 55 insertions(+), 20 deletions(-)
+
+diff --git a/configurations/SOLUM_PSSF162202_PSU.json b/configurations/SOLUM_PSSF162202_PSU.json
+index 1451830..2a5ff90 100644
+--- a/configurations/SOLUM_PSSF162202_PSU.json
++++ b/configurations/SOLUM_PSSF162202_PSU.json
+@@ -4,7 +4,7 @@
+ {
+ "Address": "$address",
+ "Bus": "$bus",
+- "Name": "SOLUM CO IS162F22 PSU FRU",
++ "Name": "$MUX SOLUM CO IS162F22 PSU FRU",
+ "Type": "EEPROM"
+ },
+ {
+@@ -15,14 +15,14 @@
+ "ILimitMax": 0.0,
+ "ILimitMin": 0.0,
+ "Inputs": [
+- "PSU$ADDRESS % 4 + 1 Fan Speed 1"
++ "$MUX PSU$ADDRESS % 4 + 1 Fan Speed 1"
+ ],
+- "Name": "PSU$ADDRESS % 4 + 1 Fan 1",
++ "Name": "$MUX PSU$ADDRESS % 4 + 1 Fan 1",
+ "NegativeHysteresis": 2.0,
+ "OutLimitMax": 100.0,
+ "OutLimitMin": 30.0,
+ "Outputs": [
+- "Pwm PSU$ADDRESS % 4 + 1 Fan 1"
++ "Pwm $MUX PSU$ADDRESS % 4 + 1 Fan 1"
+ ],
+ "PCoefficient": 0.0,
+ "PositiveHysteresis": 0.0,
+@@ -30,7 +30,7 @@
+ "SlewPos": 0.0,
+ "Type": "Pid",
+ "Zones": [
+- "PSU"
++ "$MUX PSU"
+ ]
+ },
+ {
+@@ -41,14 +41,14 @@
+ "ILimitMax": 0.0,
+ "ILimitMin": 0.0,
+ "Inputs": [
+- "PSU$ADDRESS % 4 + 1 Fan Speed 2"
++ "$MUX PSU$ADDRESS % 4 + 1 Fan Speed 2"
+ ],
+- "Name": "PSU$ADDRESS % 4 + 1 Fan 2",
++ "Name": "$MUX PSU$ADDRESS % 4 + 1 Fan 2",
+ "NegativeHysteresis": 2.0,
+ "OutLimitMax": 100.0,
+ "OutLimitMin": 30.0,
+ "Outputs": [
+- "Pwm PSU$ADDRESS % 4 + 1 Fan 2"
++ "Pwm $MUX PSU$ADDRESS % 4 + 1 Fan 2"
+ ],
+ "PCoefficient": 0.0,
+ "PositiveHysteresis": 0.0,
+@@ -56,7 +56,7 @@
+ "SlewPos": 0.0,
+ "Type": "Pid",
+ "Zones": [
+- "PSU"
++ "$MUX PSU"
+ ]
+ },
+ {
+@@ -67,9 +67,9 @@
+ "ILimitMax": 100,
+ "ILimitMin": 30,
+ "Inputs": [
+- "PSU$ADDRESS % 4 + 1 Temperature"
++ "$MUX PSU$ADDRESS % 4 + 1 Temperature"
+ ],
+- "Name": "PSU$ADDRESS % 4 + 1 Temperature",
++ "Name": "$MUX PSU$ADDRESS % 4 + 1 Temperature",
+ "NegativeHysteresis": 5.0,
+ "OutLimitMax": 100,
+ "OutLimitMin": 30,
+@@ -81,15 +81,15 @@
+ "SlewPos": 0.0,
+ "Type": "Pid",
+ "Zones": [
+- "PSU"
++ "$MUX PSU"
+ ]
+ },
+ {
+ "Class": "Floor",
+ "Inputs": [
+- "PSU$ADDRESS % 4 + 1 Temperature"
++ "$MUX PSU$ADDRESS % 4 + 1 Temperature"
+ ],
+- "Name": "PSU$ADDRESS % 4 + 1 LCC",
++ "Name": "$MUX PSU$ADDRESS % 4 + 1 LCC",
+ "NegativeHysteresis": 2,
+ "Output": [
+ 40.0,
+@@ -102,9 +102,15 @@
+ ],
+ "Type": "Stepwise",
+ "Zones": [
+- "PSU"
++ "$MUX PSU"
+ ]
+ },
++ {
++ "FailSafePercent": 100,
++ "MinThermalOutput": 30,
++ "Name": "$MUX PSU",
++ "Type": "Pid.Zone"
++ },
+ {
+ "Address": "$ADDRESS % 4 + 88",
+ "Bus": "$bus",
+@@ -118,8 +124,8 @@
+ "fan1",
+ "fan2"
+ ],
+- "Name": "PSU$ADDRESS % 4 + 1",
+- "Name1": "PSU$ADDRESS % 4 + 1",
++ "Name": "$MUX PSU$ADDRESS % 4 + 1",
++ "Name1": "$MUX PSU$ADDRESS % 4 + 1",
+ "Thresholds": [
+ {
+ "Direction": "greater than",
+@@ -167,7 +173,7 @@
+ "Type": "pmbus"
+ }
+ ],
+- "Name": "SOLUM CO IS162F22 PSU$ADDRESS % 4 + 1",
++ "Name": "$MUX SOLUM CO IS162F22 $ADDRESS % 4 + 1",
+ "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': 'IS162F22*'})",
+ "Type": "PowerSupply",
+ "xyz.openbmc_project.Inventory.Decorator.Asset": {
+@@ -177,4 +183,4 @@
+ "SerialNumber": "$PRODUCT_SERIAL_NUMBER"
+ }
+ }
+-]
++]
+\ No newline at end of file
+diff --git a/src/FruDevice.cpp b/src/FruDevice.cpp
+index 3774a2d..2200d35 100644
+--- a/src/FruDevice.cpp
++++ b/src/FruDevice.cpp
+@@ -172,6 +172,31 @@ static bool isMuxBus(size_t bus)
+ "/sys/bus/i2c/devices/i2c-" + std::to_string(bus) + "/mux_device"));
+ }
+
++static std::optional<std::string> getMuxBusChannelName(size_t bus)
++{
++ if (!fs::exists("/dev/i2c-mux"))
++ {
++ return std::nullopt;
++ }
++
++ auto ec = std::error_code();
++ auto devName = "i2c-" + std::to_string(bus);
++ for (auto& mux : fs::recursive_directory_iterator("/dev/i2c-mux"))
++ {
++ auto channel = std::filesystem::read_symlink(mux, ec);
++ if (ec)
++ {
++ continue;
++ }
++
++ if (devName == channel.filename())
++ {
++ return mux.path().filename();
++ }
++ }
++ return std::nullopt;
++}
++
+ static void makeProbeInterface(size_t bus, size_t address,
+ sdbusplus::asio::object_server& objServer)
+ {
+@@ -744,7 +769,7 @@ void addFruObjectToDbus(
+ std::shared_ptr<sdbusplus::asio::dbus_interface> iface =
+ objServer.add_interface(productName, "xyz.openbmc_project.FruDevice");
+ dbusInterfaceMap[std::pair<size_t, size_t>(bus, address)] = iface;
+-
++ auto muxChannel = getMuxBusChannelName(bus);
+ for (auto& property : formattedFRU)
+ {
+
+@@ -797,6 +822,7 @@ void addFruObjectToDbus(
+ // baseboard will be 0, 0
+ iface->register_property("BUS", bus);
+ iface->register_property("ADDRESS", address);
++ iface->register_property("MUX", muxChannel.value_or(""));
+
+ iface->initialize();
+ }
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 31a10bc..9ad9a56 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -23,6 +23,7 @@
+ #include <boost/algorithm/string/find.hpp>
+ #include <boost/algorithm/string/predicate.hpp>
+ #include <boost/algorithm/string/replace.hpp>
++#include <boost/algorithm/string/trim_all.hpp>
+ #include <boost/algorithm/string/split.hpp>
+ #include <boost/container/flat_map.hpp>
+ #include <boost/lexical_cast.hpp>
+@@ -242,6 +243,7 @@ std::optional<std::string> templateCharReplace(
+ boost::replace_all(*strPtr, *replaceStr,
+ std::to_string(foundDeviceIdx));
+ }
++ boost::trim_all(*strPtr);
+
+ for (auto& foundDevicePair : foundDevice)
+ {
+@@ -270,6 +272,7 @@ std::optional<std::string> templateCharReplace(
+ foundDevicePair.second);
+ boost::ireplace_all(*strPtr,
+ templateChar + foundDevicePair.first, val);
++ boost::trim_all(*strPtr);
+ continue;
+ }
+
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend
index 32f0a7857..a8a9f17c5 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager_%.bbappend
@@ -4,7 +4,8 @@ SRCREV = "3b802f1c8c030965b76737966b9b022433e6ef5b"
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
-SRC_URI += " file://0002-Entity-manager-Add-support-to-update-assetTag.patch \
+SRC_URI += " file://0001-fru-device-Add-MUX-channel-name-to-FRU-objects.patch \
+ file://0002-Entity-manager-Add-support-to-update-assetTag.patch \
file://0003-Add-logs-to-fwVersionIsSame.patch \
file://0004-Adding-MUX-and-Drives-present-in-HSBP-in-json-config.patch \
file://0005-Allow-MUX-idle-state-to-be-configured-as-DISCONNECT.patch \
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0028-Add-FirmwareResiliency-and-FirmwareUpdateStatus.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0028-Add-FirmwareResiliency-and-FirmwareUpdateStatus.patch
new file mode 100644
index 000000000..934573fd6
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0028-Add-FirmwareResiliency-and-FirmwareUpdateStatus.patch
@@ -0,0 +1,138 @@
+From 377fce592890a6dcc8bd45b3ff25290c4edb8908 Mon Sep 17 00:00:00 2001
+From: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
+Date: Fri, 21 Jan 2022 23:11:27 +0000
+Subject: [PATCH] Add FirmwareResiliency and FirmwareUpdateStatus
+
+Panic word not suitable for Platform firmware resiliency events. Hence
+add the following message registry for PFR events.
+1. FirmwareResiliency for warning severity events.
+2. FirmwareUpdateStatus for firmware update notifications with
+OK severity.
+
+These message registries are implemented in the following review.
+https://gerrit.openbmc-project.xyz/c/openbmc/pfr-manager/+/47609
+
+Tested:
+Redfish Service Validator test passed for this change.
+
+1. Update BMC firmware
+POST: https://<BMC_IP>/redfish/v1/UpdateService/
+ with <BMC_Update_Capsule> binary file
+After BMC reboots check for Event log in Redfish
+Command: GET: https://<BMC_IP>/redfish/v1/Systems/system/LogServices/
+ EventLog/Entries
+Response:
+{
+ "@odata.id": "/redfish/v1/Systems/system/LogServices/
+ EventLog/Entries/1618207226",
+ "@odata.type": "#LogEntry.v1_8_0.LogEntry",
+ "Created": "2021-04-12T06:00:26+00:00",
+ "EntryType": "Event",
+ "Id": "1618207226",
+ "Message": "Firmware update occurred due to BMC update
+ intent.",
+ "MessageArgs": [
+ "BMC update intent"
+ ],
+ "MessageId": "OpenBMC.0.2.FirmwareUpdateStatus",
+ "Name": "System Event Log Entry",
+ "Severity": "OK"
+}
+2. Reset BMC.
+Command: ipmitool raw 6 2
+After BMC reboots check for Event log in Redfish
+Command: GET: https://<BMC_IP>/redfish/v1/Systems/system/LogServices/
+ EventLog/Entries
+Response:
+{
+ "@odata.id": "/redfish/v1/Systems/system/LogServices/
+ EventLog/Entries/1618207249",
+ "@odata.type": "#LogEntry.v1_8_0.LogEntry",
+ "Created": "2021-04-12T06:02:49+00:00",
+ "EntryType": "Event",
+ "Id": "1618207249",
+ "Message": "Firmware resiliency event occurred due to BMC
+ reset detected.",
+ "MessageArgs": [
+ "BMC reset detected"
+ ],
+ "MessageId": "OpenBMC.0.2.FirmwareResiliency",
+ "Name": "System Event Log Entry",
+ "Severity": "Warning"
+}
+
+Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
+Signed-off-by: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com>
+---
+ .../registries/openbmc_message_registry.hpp | 33 ++++++++++++++++---
+ 1 file changed, 29 insertions(+), 4 deletions(-)
+
+diff --git a/redfish-core/include/registries/openbmc_message_registry.hpp b/redfish-core/include/registries/openbmc_message_registry.hpp
+index 967713f..3747aaf 100644
+--- a/redfish-core/include/registries/openbmc_message_registry.hpp
++++ b/redfish-core/include/registries/openbmc_message_registry.hpp
+@@ -21,15 +21,15 @@ namespace redfish::message_registries::openbmc
+ const Header header = {
+ "Copyright 2018 OpenBMC. All rights reserved.",
+ "#MessageRegistry.v1_4_0.MessageRegistry",
+- "OpenBMC.0.2.0",
++ "OpenBMC.0.3.0",
+ "OpenBMC Message Registry",
+ "en",
+ "This registry defines the base messages for OpenBMC.",
+ "OpenBMC",
+- "0.2.0",
++ "0.3.0",
+ "OpenBMC",
+ };
+-constexpr std::array<MessageEntry, 197> registry = {
++constexpr std::array<MessageEntry, 199> registry = {
+ MessageEntry{
+ "ADDDCCorrectable",
+ {
+@@ -560,9 +560,21 @@ constexpr std::array<MessageEntry, 197> registry = {
+ {"string"},
+ "None.",
+ }},
++ MessageEntry{"FirmwareResiliency",
++ {
++ "Indicates the reason for last firmware resiliency event.",
++ "Firmware resiliency event occurred due to %1.",
++ "Warning",
++ "Warning",
++ 1,
++ {
++ "string",
++ },
++ "None.",
++ }},
+ MessageEntry{"FirmwareResiliencyError",
+ {
+- "Indicates firmware encountered resilience error.",
++ "Indicates firmware encountered resiliency error.",
+ "Firmware resiliency error. Error reason: %1.",
+ "Critical",
+ "Critical",
+@@ -613,6 +625,19 @@ constexpr std::array<MessageEntry, 197> registry = {
+ {"string", "string"},
+ "None.",
+ }},
++ MessageEntry{
++ "FirmwareUpdateStatus",
++ {
++ "Indicates the reason for last firmware update on resiliency system.",
++ "Firmware update occurred due to %1.",
++ "OK",
++ "OK",
++ 1,
++ {
++ "string",
++ },
++ "None.",
++ }},
+ MessageEntry{
+ "GeneralFirmwareSecurityViolation",
+ {
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0029-Fix-Property-PhysicalContext-is-invalid-none.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0029-Fix-Property-PhysicalContext-is-invalid-none.patch
new file mode 100644
index 000000000..cf8148ff5
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0029-Fix-Property-PhysicalContext-is-invalid-none.patch
@@ -0,0 +1,520 @@
+From bf7ef9a5b2e3a6cac3f418d3c7753f29bea66913 Mon Sep 17 00:00:00 2001
+From: sunitakx <sunitax.kumari@intel.com>
+Date: Tue, 18 Jan 2022 11:05:05 +0000
+Subject: [PATCH] [Fix]: Property PhysicalContext is invalid "none"
+
+Issue: Redfish validator is throwing error "PhysicalContext:
+This type is invalid none" for multiple temperature sensors
+
+Endpoint : /redfish/v1/Chassis/<Baseboard>/Thermal#/Temperatures/
+
+Root Cause : PhysicalContext Schema was missing from redfish schema
+metadata
+
+Tested: Redfish validator script passed.
+
+*** /redfish/v1/Chassis/<baseboard>/Thermal#/Temperatures/0
+ Type (#Thermal.v1_3_0.Temperature), GET SUCCESS (time: 0)
+ PASS
+
+Signed-off-by: sunitakx <sunitax.kumari@intel.com>
+Change-Id: Ifbfe7d96e99030c0c5ba67a1aba5080cd049e57b
+---
+ scripts/update_schemas.py | 1 +
+ static/redfish/v1/$metadata/index.xml | 3 +
+ .../PhysicalContext/PhysicalContext.json | 62 +++
+ .../v1/JsonSchemas/PhysicalContext/index.json | 22 ++
+ .../redfish/v1/schema/PhysicalContext_v1.xml | 357 ++++++++++++++++++
+ 5 files changed, 445 insertions(+)
+ create mode 100644 static/redfish/v1/JsonSchemas/PhysicalContext/PhysicalContext.json
+ create mode 100644 static/redfish/v1/JsonSchemas/PhysicalContext/index.json
+ create mode 100644 static/redfish/v1/schema/PhysicalContext_v1.xml
+
+diff --git a/scripts/update_schemas.py b/scripts/update_schemas.py
+index eb6318f..3f0f57c 100755
+--- a/scripts/update_schemas.py
++++ b/scripts/update_schemas.py
+@@ -65,6 +65,7 @@ include_list = [
+ 'PCIeDeviceCollection',
+ 'PCIeFunction',
+ 'PCIeFunctionCollection',
++ 'PhysicalContext',
+ 'Power',
+ 'Privileges', # Used in Role
+ 'Processor',
+diff --git a/static/redfish/v1/$metadata/index.xml b/static/redfish/v1/$metadata/index.xml
+index c925581..9b080f3 100644
+--- a/static/redfish/v1/$metadata/index.xml
++++ b/static/redfish/v1/$metadata/index.xml
+@@ -1568,6 +1568,9 @@
+ <edmx:Reference Uri="/redfish/v1/schema/PCIeFunctionCollection_v1.xml">
+ <edmx:Include Namespace="PCIeFunctionCollection"/>
+ </edmx:Reference>
++ <edmx:Reference Uri="/redfish/v1/schema/PhysicalContext_v1.xml">
++ <edmx:Include Namespace="PhysicalContext"/>
++ </edmx:Reference>
+ <edmx:Reference Uri="/redfish/v1/schema/Power_v1.xml">
+ <edmx:Include Namespace="Power"/>
+ <edmx:Include Namespace="Power.v1_0_0"/>
+diff --git a/static/redfish/v1/JsonSchemas/PhysicalContext/PhysicalContext.json b/static/redfish/v1/JsonSchemas/PhysicalContext/PhysicalContext.json
+new file mode 100644
+index 0000000..c9ffeee
+--- /dev/null
++++ b/static/redfish/v1/JsonSchemas/PhysicalContext/PhysicalContext.json
+@@ -0,0 +1,62 @@
++{
++ "$schema": "http://redfish.dmtf.org/schemas/v1/redfish-schema.v1_3_0.json",
++ "copyright": "Copyright 2014-2017 Distributed Management Task Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright",
++ "definitions": {
++ "PhysicalContext": {
++ "deprecated": "This definition has been moved to the unversioned namespace so that external references can pick up changes over time.",
++ "enum": [
++ "Room",
++ "Intake",
++ "Exhaust",
++ "Front",
++ "Back",
++ "Upper",
++ "Lower",
++ "CPU",
++ "GPU",
++ "Backplane",
++ "SystemBoard",
++ "PowerSupply",
++ "VoltageRegulator",
++ "StorageDevice",
++ "NetworkingDevice",
++ "ComputeBay",
++ "StorageBay",
++ "NetworkBay",
++ "ExpansionBay",
++ "PowerSupplyBay",
++ "Memory",
++ "Chassis",
++ "Fan"
++ ],
++ "enumDescriptions": {
++ "Back": "The back of the chassis.",
++ "Backplane": "A backplane within the chassis.",
++ "CPU": "A Processor (CPU).",
++ "Chassis": "The entire chassis.",
++ "ComputeBay": "Within a compute bay.",
++ "Exhaust": "The exhaust point of the chassis.",
++ "ExpansionBay": "Within an expansion bay.",
++ "Fan": "A fan.",
++ "Front": "The front of the chassis.",
++ "GPU": "A Graphics Processor (GPU).",
++ "Intake": "The intake point of the chassis.",
++ "Lower": "The lower portion of the chassis.",
++ "Memory": "A memory device.",
++ "NetworkBay": "Within a networking bay.",
++ "NetworkingDevice": "A networking device.",
++ "PowerSupply": "A power supply.",
++ "PowerSupplyBay": "Within a power supply bay.",
++ "Room": "The room.",
++ "StorageBay": "Within a storage bay.",
++ "StorageDevice": "A storage device.",
++ "SystemBoard": "The system board (PCB).",
++ "Upper": "The upper portion of the chassis.",
++ "VoltageRegulator": "A voltage regulator device."
++ },
++ "type": "string"
++ }
++ },
++ "title": "#PhysicalContext.v1_3_0"
++}
++
+diff --git a/static/redfish/v1/JsonSchemas/PhysicalContext/index.json b/static/redfish/v1/JsonSchemas/PhysicalContext/index.json
+new file mode 100644
+index 0000000..729c0ca
+--- /dev/null
++++ b/static/redfish/v1/JsonSchemas/PhysicalContext/index.json
+@@ -0,0 +1,22 @@
++{
++ "@odata.context": "/redfish/v1/$metadata#JsonSchemaFile.JsonSchemaFile",
++ "@odata.id": "/redfish/v1/JsonSchemas/PhysicalContext",
++ "@odata.type": "#JsonSchemaFile.v1_0_2.JsonSchemaFile",
++ "Name": "PhysicalContext Schema File",
++ "Schema": "#PhysicalContext.PhysicalContext",
++ "Description": "PhysicalContext Schema File Location",
++ "Id": "PhysicalContext",
++ "Languages": [
++ "en"
++ ],
++ "Languages@odata.count": 1,
++ "Location": [
++ {
++ "Language": "en",
++ "PublicationUri": "http://redfish.dmtf.org/schemas/v1/PhysicalContext.json",
++ "Uri": "/redfish/v1/JsonSchemas/PhysicalContext/PhysicalContext.json"
++ }
++ ],
++ "Location@odata.count": 1
++}
++
+diff --git a/static/redfish/v1/schema/PhysicalContext_v1.xml b/static/redfish/v1/schema/PhysicalContext_v1.xml
+new file mode 100644
+index 0000000..4c54e3e
+--- /dev/null
++++ b/static/redfish/v1/schema/PhysicalContext_v1.xml
+@@ -0,0 +1,357 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!---->
++<!--################################################################################ -->
++<!--# Redfish Schema: PhysicalContext -->
++<!--# -->
++<!--# For a detailed change log, see the README file contained in the DSP8010 bundle, -->
++<!--# available at http://www.dmtf.org/standards/redfish -->
++<!--# Copyright 2014-2020 DMTF. -->
++<!--# For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright -->
++<!--################################################################################ -->
++<!---->
++<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
++ <edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Core.V1.xml">
++ <edmx:Include Namespace="Org.OData.Core.V1" Alias="OData"/>
++ </edmx:Reference>
++ <edmx:Reference Uri="http://redfish.dmtf.org/schemas/v1/RedfishExtensions_v1.xml">
++ <edmx:Include Namespace="RedfishExtensions.v1_0_0" Alias="Redfish"/>
++ </edmx:Reference>
++ <edmx:DataServices>
++ <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="PhysicalContext">
++ <Annotation Term="Redfish.OwningEntity" String="DMTF"/>
++ <Annotation Term="Redfish.Release" String="1.0"/>
++ <EnumType Name="PhysicalContext">
++ <Member Name="Room">
++ <Annotation Term="OData.Description" String="The room."/>
++ </Member>
++ <Member Name="Intake">
++ <Annotation Term="OData.Description" String="The air intake point or points or region of the chassis."/>
++ </Member>
++ <Member Name="Exhaust">
++ <Annotation Term="OData.Description" String="The air exhaust point or points or region of the chassis."/>
++ </Member>
++ <Member Name="LiquidInlet">
++ <Annotation Term="OData.Description" String="The liquid inlet point of the chassis."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2017.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="LiquidOutlet">
++ <Annotation Term="OData.Description" String="The liquid outlet point of the chassis."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2017.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="Front">
++ <Annotation Term="OData.Description" String="The front of the chassis."/>
++ </Member>
++ <Member Name="Back">
++ <Annotation Term="OData.Description" String="The back of the chassis."/>
++ </Member>
++ <Member Name="Upper">
++ <Annotation Term="OData.Description" String="The upper portion of the chassis."/>
++ </Member>
++ <Member Name="Lower">
++ <Annotation Term="OData.Description" String="The lower portion of the chassis."/>
++ </Member>
++ <Member Name="CPU">
++ <Annotation Term="OData.Description" String="A processor (CPU)."/>
++ </Member>
++ <Member Name="CPUSubsystem">
++ <Annotation Term="OData.Description" String="The entire processor (CPU) subsystem."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="GPU">
++ <Annotation Term="OData.Description" String="A graphics processor (GPU)."/>
++ </Member>
++ <Member Name="GPUSubsystem">
++ <Annotation Term="OData.Description" String="The entire graphics processor (GPU) subsystem."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="FPGA">
++ <Annotation Term="OData.Description" String="An FPGA."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="Accelerator">
++ <Annotation Term="OData.Description" String="An accelerator."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="ASIC">
++ <Annotation Term="OData.Description" String="An ASIC device, such as a networking chip or chipset component."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2017.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="Backplane">
++ <Annotation Term="OData.Description" String="A backplane within the chassis."/>
++ </Member>
++ <Member Name="SystemBoard">
++ <Annotation Term="OData.Description" String="The system board (PCB)."/>
++ </Member>
++ <Member Name="PowerSupply">
++ <Annotation Term="OData.Description" String="A power supply."/>
++ </Member>
++ <Member Name="PowerSubsystem">
++ <Annotation Term="OData.Description" String="The entire power subsystem."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2019.1"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="VoltageRegulator">
++ <Annotation Term="OData.Description" String="A voltage regulator device."/>
++ </Member>
++ <Member Name="Rectifier">
++ <Annotation Term="OData.Description" String="A rectifier device."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2019.1"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="StorageDevice">
++ <Annotation Term="OData.Description" String="A storage device."/>
++ </Member>
++ <Member Name="NetworkingDevice">
++ <Annotation Term="OData.Description" String="A networking device."/>
++ </Member>
++ <Member Name="ComputeBay">
++ <Annotation Term="OData.Description" String="Within a compute bay."/>
++ </Member>
++ <Member Name="StorageBay">
++ <Annotation Term="OData.Description" String="Within a storage bay."/>
++ </Member>
++ <Member Name="NetworkBay">
++ <Annotation Term="OData.Description" String="Within a networking bay."/>
++ </Member>
++ <Member Name="ExpansionBay">
++ <Annotation Term="OData.Description" String="Within an expansion bay."/>
++ </Member>
++ <Member Name="PowerSupplyBay">
++ <Annotation Term="OData.Description" String="Within a power supply bay."/>
++ </Member>
++ <Member Name="Memory">
++ <Annotation Term="OData.Description" String="A memory device."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2017.1"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="MemorySubsystem">
++ <Annotation Term="OData.Description" String="The entire memory subsystem."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="Chassis">
++ <Annotation Term="OData.Description" String="The entire chassis."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2017.2"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="Fan">
++ <Annotation Term="OData.Description" String="A fan."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2017.2"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="CoolingSubsystem">
++ <Annotation Term="OData.Description" String="The entire cooling, or air and liquid, subsystem."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="Motor">
++ <Annotation Term="OData.Description" String="A motor."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="Transformer">
++ <Annotation Term="OData.Description" String="A transformer."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="ACUtilityInput">
++ <Annotation Term="OData.Description" String="An AC utility input."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="ACStaticBypassInput">
++ <Annotation Term="OData.Description" String="An AC static bypass input."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="ACMaintenanceBypassInput">
++ <Annotation Term="OData.Description" String="An AC maintenance bypass input."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="DCBus">
++ <Annotation Term="OData.Description" String="A DC bus."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="ACOutput">
++ <Annotation Term="OData.Description" String="An AC output."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="ACInput">
++ <Annotation Term="OData.Description" String="An AC input."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ <Member Name="TrustedModule">
++ <Annotation Term="OData.Description" String="A trusted module."/>
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2020.4"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ </Member>
++ </EnumType>
++ <EnumType Name="PhysicalSubContext">
++ <Annotation Term="Redfish.Revisions">
++ <Collection>
++ <Record>
++ <PropertyValue Property="Kind" EnumMember="Redfish.RevisionKind/Added"/>
++ <PropertyValue Property="Version" String="2018.3"/>
++ </Record>
++ </Collection>
++ </Annotation>
++ <Member Name="Input">
++ <Annotation Term="OData.Description" String="The input."/>
++ </Member>
++ <Member Name="Output">
++ <Annotation Term="OData.Description" String="The output."/>
++ </Member>
++ </EnumType>
++ </Schema>
++ </edmx:DataServices>
++</edmx:Edmx>
++
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0030-Change-Severity-for-ServiceFailure-redfish-event.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0030-Change-Severity-for-ServiceFailure-redfish-event.patch
new file mode 100644
index 000000000..b2ff26c33
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0030-Change-Severity-for-ServiceFailure-redfish-event.patch
@@ -0,0 +1,56 @@
+From 12adbae465b3f6b3dc8aa2a444bc295e8261c382 Mon Sep 17 00:00:00 2001
+From: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
+Date: Tue, 15 Feb 2022 10:14:57 +0000
+Subject: [PATCH] Change Severity for ServiceFailure redfish event
+
+During Ac cycle stress, at times some services may exit unsuccessfully.
+This will not have any functionality impact. So updated Severity of
+"ServiceFailure" redfish event to "Ok".
+
+Tested:
+1. Redfish validator - passed for this with change
+2. Killed couple of process and observed Redfish EventLog shows updated
+ Severity.
+Redfish URI:
+GET: https://<BMC IP>/redfish/v1/Systems/system/LogServices/EventLog
+ /Entries
+{
+ "@odata.id": "/redfish/v1/Systems/system/LogServices/
+ EventLog/Entries/1624604288",
+ "@odata.type": "#LogEntry.v1_4_0.LogEntry",
+ "Created": "2021-06-25T06:58:08+00:00",
+ "EntryType": "Event",
+ "Id": "1624604288",
+ "Message": "Service phosphor-ipmi-host.service has exited
+ unsuccessfully.",
+ "MessageArgs": [
+ "phosphor-ipmi-host.service"
+ ],
+ "MessageId": "OpenBMC.0.1.ServiceFailure",
+ "Name": "System Event Log Entry",
+ "Severity": "OK"
+}
+
+Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
+---
+ redfish-core/include/registries/openbmc_message_registry.hpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/redfish-core/include/registries/openbmc_message_registry.hpp b/redfish-core/include/registries/openbmc_message_registry.hpp
+index 3747aaf..0b409cf 100644
+--- a/redfish-core/include/registries/openbmc_message_registry.hpp
++++ b/redfish-core/include/registries/openbmc_message_registry.hpp
+@@ -2375,8 +2375,8 @@ constexpr std::array<MessageEntry, 199> registry = {
+ {
+ "Indicates that a service has exited unsuccessfully.",
+ "Service %1 has exited unsuccessfully.",
+- "Warning",
+- "Warning",
++ "OK",
++ "OK",
+ 1,
+ {"string"},
+ "None.",
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0031-Change-PcieType-to-PCIeType.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0031-Change-PcieType-to-PCIeType.patch
new file mode 100644
index 000000000..71b364468
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0031-Change-PcieType-to-PCIeType.patch
@@ -0,0 +1,68 @@
+From 5b69a40d50b7ca024dea83dbadcfdaa5e045918d Mon Sep 17 00:00:00 2001
+From: Anjaliintel-21 <anjali.ray@intel.com>
+Date: Tue, 15 Feb 2022 16:01:14 +0000
+Subject: [PATCH] Change PcieType to PCIeType
+
+In the patch:https://github.com/openbmc/bmcweb/commit/62cd45af311e7741064c114581ba34186d6e508c
+
+Mismatch of PCIeType from pcie.hpp to PCIeDevice_v1.xml.In function requestRoutesSystemPCIeDevice,
+PCIeType mentioned for PCIeInterface details, was written as PcieType but in PCIeDevice_v1.xml,
+property name is PCIeType which was giving error in the validator.
+
+Tested using RedfishServiceValidator:
+*** /redfish/v1/Systems/system/PCIeDevices
+Type (#PCIeDeviceCollection.PCIeDeviceCollection), GET SUCCESS (time: 1.35205)
+PASS
+
+*** /redfish/v1/Systems/system/PCIeDevices/S0B1D0
+Type (#PCIeDevice.v1_4_0.PCIeDevice), GET SUCCESS (time: 1.290409)
+PASS
+
+*** /redfish/v1/Systems/system/PCIeDevices/S0B1D0/PCIeFunctions
+Type (#PCIeFunctionCollection.PCIeFunctionCollection), GET SUCCESS (time: 1.287055)
+PASS
+
+*** /redfish/v1/Systems/system/PCIeDevices/S0B1D0/PCIeFunctions/0
+Type (#PCIeFunction.v1_2_0.PCIeFunction), GET SUCCESS (time: 1.336434)
+PASS
+
+*** /redfish/v1/Systems/system/PCIeDevices/S0B2D0
+Type (#PCIeDevice.v1_4_0.PCIeDevice), GET SUCCESS (time: 1.282768)
+PASS
+
+*** /redfish/v1/Systems/system/PCIeDevices/S0B2D0/PCIeFunctions
+Type (#PCIeFunctionCollection.PCIeFunctionCollection), GET SUCCESS (time: 1.401044)
+PASS
+
+*** /redfish/v1/Systems/system/PCIeDevices/S0B2D0/PCIeFunctions/0
+Type (#PCIeFunction.v1_2_0.PCIeFunction), GET SUCCESS (time: 1.286989)
+PASS
+
+*** /redfish/v1/Systems/system/PCIeDevices/S0B3D0
+Type (#PCIeDevice.v1_4_0.PCIeDevice), GET SUCCESS (time: 1.331661)
+PASS
+Elapsed time: 0:01:17
+Counter({'metadataNamespaces': 2337, 'skipOptional': 67, 'pass': 51, 'passGet': 8, 'serviceNamespaces': 4})
+Validation has succeeded.
+
+Signed-off-by: Anjaliintel-21 <anjali.ray@intel.com>
+---
+ redfish-core/lib/pcie.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp
+index 1904c26..1b9e28e 100644
+--- a/redfish-core/lib/pcie.hpp
++++ b/redfish-core/lib/pcie.hpp
+@@ -223,7 +223,7 @@ inline void requestRoutesSystemPCIeDevice(App& app)
+ return;
+ }
+ asyncResp->res
+- .jsonValue["PCIeInterface"]["PcieType"] =
++ .jsonValue["PCIeInterface"]["PCIeType"] =
+ *generationInUse;
+ }
+ asyncResp->res.jsonValue["PCIeFunctions"] = {
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/biosconfig/0001-Define-Redfish-interface-Registries-Bios.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/biosconfig/0001-Define-Redfish-interface-Registries-Bios.patch
index 19a392873..57c183c76 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/biosconfig/0001-Define-Redfish-interface-Registries-Bios.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/biosconfig/0001-Define-Redfish-interface-Registries-Bios.patch
@@ -1,4 +1,4 @@
-From bde7f728d5a87522674bcd5515baaa02bf7b9373 Mon Sep 17 00:00:00 2001
+From 7956c74860a39e75d80f0caadcfbd5570569717d Mon Sep 17 00:00:00 2001
From: Kuiying Wang <kuiying.wang@intel.com>
Date: Fri, 4 Sep 2020 19:24:25 +0800
Subject: [PATCH] Define Redfish interface "/Registries/Bios" and enable
@@ -226,6 +226,7 @@ Oem - Resource.Oem No Optional
Change-Id: Iecc61018c350f0b8c89df59b2864b941508b1916
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
Signed-off-by: Snehalatha Venkatesh <snehalathax.v@intel.com>
+Signed-off-by: Smriti Ayushi <smriti.ayushi@intel.com>
---
redfish-core/include/redfish.hpp | 3 +
.../include/registries/bios_registry.hpp | 41 ++
@@ -235,7 +236,7 @@ Signed-off-by: Snehalatha Venkatesh <snehalathax.v@intel.com>
create mode 100644 redfish-core/include/registries/bios_registry.hpp
diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
-index 0a97150..07a9417 100644
+index 2479332..8bd4bf8 100644
--- a/redfish-core/include/redfish.hpp
+++ b/redfish-core/include/redfish.hpp
@@ -148,7 +148,10 @@ class RedfishService
@@ -297,7 +298,7 @@ index 0000000..c80937a
+};
+} // namespace redfish::message_registries::bios
diff --git a/redfish-core/lib/bios.hpp b/redfish-core/lib/bios.hpp
-index c2fb284..87536d6 100644
+index c2fb284..9d7157c 100644
--- a/redfish-core/lib/bios.hpp
+++ b/redfish-core/lib/bios.hpp
@@ -3,8 +3,140 @@
@@ -451,7 +452,7 @@ index c2fb284..87536d6 100644
+ {"SettingsObject",
+ {{"@odata.id", "/redfish/v1/Systems/system/Bios/Settings"}}}};
+ asyncResp->res.jsonValue["AttributeRegistry"] = "BiosAttributeRegistry";
-+ asyncResp->res.jsonValue["Attributes"] = {};
++ asyncResp->res.jsonValue["Attributes"] = nlohmann::json::object();
+
+ crow::connections::systemBus->async_method_call(
+ [asyncResp](const boost::system::error_code ec,
@@ -835,7 +836,7 @@ index c2fb284..87536d6 100644
* BiosReset class supports handle POST method for Reset bios.
* The class retrieves and sends data directly to D-Bus.
diff --git a/redfish-core/lib/message_registries.hpp b/redfish-core/lib/message_registries.hpp
-index 43359e3..b2fb43c 100644
+index ae02189..510b19a 100644
--- a/redfish-core/lib/message_registries.hpp
+++ b/redfish-core/lib/message_registries.hpp
@@ -17,6 +17,7 @@
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/biosconfig/0006-Add-fix-for-broken-feature-Pending-Attributes.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/biosconfig/0006-Add-fix-for-broken-feature-Pending-Attributes.patch
index 85b5b3494..e7036c28c 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/biosconfig/0006-Add-fix-for-broken-feature-Pending-Attributes.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/biosconfig/0006-Add-fix-for-broken-feature-Pending-Attributes.patch
@@ -1,6 +1,6 @@
-From 8225b2dc07279c65cdfe2ddc13964d84fd2ed8bb Mon Sep 17 00:00:00 2001
+From 5ba2b29277e982fddaf8622af39902b6a046e259 Mon Sep 17 00:00:00 2001
From: Arun Lal K M <arun.lal@intel.com>
-Date: Tue, 4 Jan 2022 01:56:57 +0000
+Date: Wed, 19 Jan 2022 14:44:07 +0000
Subject: [PATCH] Add fix for broken feature 'Pending Attributes'.
Fix is added for the following:
@@ -11,6 +11,7 @@ Fix is added for the following:
5) POST to '/redfish/v1/Systems/system/Bios/Actions
/Bios.ChangePassword/'.
6) Add support for Enumeration.
+7) Support DMTF standard of displaying "Value" in BIOS attribute registries.
Tested:
By giving PATCH to 'redfish/v1/Systems/system/Bios/Settings'
@@ -134,11 +135,11 @@ Validation has succeeded.
Signed-off-by: Arun Lal K M <arun.lal@intel.com>
Signed-off-by: Snehalatha Venkatesh <snehalathax.v@intel.com>
---
- redfish-core/lib/bios.hpp | 592 ++++++++++++++++++++++++--------------
- 1 file changed, 383 insertions(+), 209 deletions(-)
+ redfish-core/lib/bios.hpp | 602 +++++++++++++++++++++++++-------------
+ 1 file changed, 391 insertions(+), 211 deletions(-)
diff --git a/redfish-core/lib/bios.hpp b/redfish-core/lib/bios.hpp
-index 0bb0b9e..69340eb 100644
+index f6d6eff..c327053 100644
--- a/redfish-core/lib/bios.hpp
+++ b/redfish-core/lib/bios.hpp
@@ -12,13 +12,15 @@ map{attributeName,struct{attributeType,readonlyStatus,displayname,
@@ -637,9 +638,9 @@ index 0bb0b9e..69340eb 100644
BMCWEB_LOG_ERROR
- << "doPatch resp_handler got error " << ec;
+ << "getBiosAttributes DBUS error: " << ec;
- messages::internalError(asyncResp->res);
- return;
- }
++ messages::internalError(asyncResp->res);
++ return;
++ }
+
+ const BiosBaseTableType* baseBiosTable =
+ std::get_if<BiosBaseTableType>(&retBiosTable);
@@ -647,9 +648,9 @@ index 0bb0b9e..69340eb 100644
+ if (baseBiosTable == nullptr)
+ {
+ BMCWEB_LOG_ERROR << "baseBiosTable is empty.";
-+ messages::internalError(asyncResp->res);
-+ return;
-+ }
+ messages::internalError(asyncResp->res);
+ return;
+ }
+
+ PendingAttributesType pendingAttributes{};
+
@@ -895,10 +896,11 @@ index 0bb0b9e..69340eb 100644
}
if (optItemTypeRedfish == "OneOf")
{
-@@ -671,6 +817,17 @@ inline void requestRoutesBiosAttributeRegistry(App& app)
+@@ -671,7 +817,21 @@ inline void requestRoutesBiosAttributeRegistry(App& app)
std::get_if<std::string>(
&std::get<optItemValue>(
optItem));
+- optItemJson[optItemTypeRedfish] =
+
+ if (!currValue)
+ {
@@ -910,13 +912,18 @@ index 0bb0b9e..69340eb 100644
+ continue;
+ }
+
- optItemJson[optItemTypeRedfish] =
++ optItemJson["ValueDisplayName"] =
++ currValue != nullptr ? *currValue
++ : "";
++ optItemJson["ValueName"] =
currValue != nullptr ? *currValue
: "";
-@@ -681,6 +838,17 @@ inline void requestRoutesBiosAttributeRegistry(App& app)
+ }
+@@ -681,7 +841,21 @@ inline void requestRoutesBiosAttributeRegistry(App& app)
std::get_if<int64_t>(
&std::get<optItemValue>(
optItem));
+- optItemJson[optItemTypeRedfish] =
+
+ if (!currValue)
+ {
@@ -928,10 +935,14 @@ index 0bb0b9e..69340eb 100644
+ continue;
+ }
+
- optItemJson[optItemTypeRedfish] =
++ optItemJson["ValueDisplayName"] =
++ currValue != nullptr ? *currValue
++ : 0;
++ optItemJson["ValueName"] =
currValue != nullptr ? *currValue
: 0;
-@@ -689,6 +857,12 @@ inline void requestRoutesBiosAttributeRegistry(App& app)
+ }
+@@ -689,6 +863,12 @@ inline void requestRoutesBiosAttributeRegistry(App& app)
optionsArray.push_back(optItemJson);
}
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0004-Add-Server-Sent-Events-support.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0004-Add-Server-Sent-Events-support.patch
index dfa67935c..760462154 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0004-Add-Server-Sent-Events-support.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0004-Add-Server-Sent-Events-support.patch
@@ -1,4 +1,4 @@
-From ea7d0091545450721d8b9b901e2593401b50d24c Mon Sep 17 00:00:00 2001
+From 1b9e0f434a4c667f6edbaadb257f7a9709953429 Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Fri, 12 Mar 2021 18:53:25 +0000
Subject: [PATCH] Add Server-Sent-Events support
@@ -22,12 +22,15 @@ Tested:
Change-Id: I36956565cbba30c2007852c9471f477f6d1736e9
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>
+Signed-off-by: Ankita Vilas Gawade <ankita.gawade@intel.com>
+
+%% original patch: 0004-Add-Server-Sent-Events-support.patch
---
http/http_connection.hpp | 10 +-
http/http_response.hpp | 7 +-
- http/routing.hpp | 71 ++++++++++
- http/server_sent_event.hpp | 279 +++++++++++++++++++++++++++++++++++++
- 4 files changed, 362 insertions(+), 5 deletions(-)
+ http/routing.hpp | 71 +++++++++
+ http/server_sent_event.hpp | 298 +++++++++++++++++++++++++++++++++++++
+ 4 files changed, 381 insertions(+), 5 deletions(-)
create mode 100644 http/server_sent_event.hpp
diff --git a/http/http_connection.hpp b/http/http_connection.hpp
@@ -180,10 +183,10 @@ index fe9c7e9..c748580 100644
self_t* self = static_cast<self_t*>(this);
diff --git a/http/server_sent_event.hpp b/http/server_sent_event.hpp
new file mode 100644
-index 0000000..41d18ed
+index 0000000..c23a4ee
--- /dev/null
+++ b/http/server_sent_event.hpp
-@@ -0,0 +1,279 @@
+@@ -0,0 +1,298 @@
+#pragma once
+#include "http_request.hpp"
+
@@ -201,6 +204,8 @@ index 0000000..41d18ed
+
+namespace crow
+{
++constexpr auto inputBufferSize = 1024U * 64U;
++constexpr uint8_t maxFailCount = 5;
+
+struct SseConnection : std::enable_shared_from_this<SseConnection>
+{
@@ -443,6 +448,22 @@ index 0000000..41d18ed
+ }
+ rawData += "\n\n";
+
++ if (rawData.size() > inputBufferSize)
++ {
++ BMCWEB_LOG_DEBUG
++ << "Skipping Send Event/Report to SSE Subscription as Buffer Size Exceeded. Size: "
++ << rawData.size();
++ failCount++;
++ if (failCount > maxFailCount)
++ {
++ BMCWEB_LOG_ERROR
++ << "Fail Count Threshold reached. Closing SSE Connection";
++ close("max buffer size not suported");
++ }
++ return;
++ }
++ failCount = 0;
++
+ boost::asio::buffer_copy(inputBuffer.prepare(rawData.size()),
+ boost::asio::buffer(rawData));
+ inputBuffer.commit(rawData.size());
@@ -454,8 +475,9 @@ index 0000000..41d18ed
+ Adaptor adaptor;
+
+ boost::beast::flat_static_buffer<1024U * 8U> outputBuffer;
-+ boost::beast::flat_static_buffer<1024U * 64U> inputBuffer;
++ boost::beast::flat_static_buffer<inputBufferSize> inputBuffer;
+ bool doingWrite = false;
++ uint8_t failCount = 0;
+
+ std::function<void(std::shared_ptr<SseConnection>&, const crow::Request&,
+ crow::Response&)>
@@ -464,5 +486,5 @@ index 0000000..41d18ed
+};
+} // namespace crow
--
-2.17.1
+2.25.1
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0014-Fix-Event-Subscription-URI.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0014-Fix-Event-Subscription-URI.patch
new file mode 100644
index 000000000..a06389c46
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/eventservice/0014-Fix-Event-Subscription-URI.patch
@@ -0,0 +1,37 @@
+From 93daba6ca2de8a82492ea88a7da75a7d337123e1 Mon Sep 17 00:00:00 2001
+From: Gayathri Leburu <gayathri.leburu@intel.com>
+Date: Wed, 9 Feb 2022 10:45:19 +0000
+Subject: [PATCH] Fix Event Subscription URI
+
+While performing GET on /redfish/v1/EventService/Subscriptions/ results
+in error 405 - Method not allowed.
+
+This commit fixes the subscription URI while registering the ROUTE i.e.,
+during BMCWEB_ROUTE.
+
+TESTED :
+ - GET on /redfish/v1/EventService/Subscriptions/ successfully returned
+ all the list of subscribed events.
+
+Signed-off-by: Gayathri Leburu <gayathri.leburu@intel.com>
+Change-Id: I0edcfd8403e0178fe84d6b8328dabad71c4d5c98
+---
+ redfish-core/lib/event_service.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/redfish-core/lib/event_service.hpp b/redfish-core/lib/event_service.hpp
+index 9b4f6bd..7359a82 100644
+--- a/redfish-core/lib/event_service.hpp
++++ b/redfish-core/lib/event_service.hpp
+@@ -173,7 +173,7 @@ inline void requestRoutesSubmitTestEvent(App& app)
+
+ inline void requestRoutesEventDestinationCollection(App& app)
+ {
+- BMCWEB_ROUTE(app, "/redfish/v1/EventService/Subscriptions")
++ BMCWEB_ROUTE(app, "/redfish/v1/EventService/Subscriptions/")
+ .privileges(redfish::privileges::getEventDestinationCollection)
+ .methods(boost::beast::http::verb::get)(
+ [](const crow::Request&,
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0004-Fixed-timestamp-in-telemetry-service.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0004-Fixed-timestamp-in-telemetry-service.patch
new file mode 100644
index 000000000..0db2d00ae
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/0004-Fixed-timestamp-in-telemetry-service.patch
@@ -0,0 +1,106 @@
+From 45c367e066d36ed0f7a38a12c80c1a40930efdfb Mon Sep 17 00:00:00 2001
+From: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
+Date: Wed, 29 Dec 2021 10:28:53 +0100
+Subject: [PATCH] Fixed timestamp in telemetry service
+
+Telemetry service is using timestamp with milliseconds accuracy. Bmcweb
+code assumed that timestamp is in seconds which produced a bad result.
+This patchset updates the APIs, and adds a getDateTimeUintMs method,
+which can be used to convert a millisecond timestamp into a string. In
+the future, this can be used to get more precision out of the API.
+
+Reference: '9.4.3. Date-Time values'
+https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.8.0.pdf
+
+Tested:
+- Telemetry service timestamp show correct timestamp with milliseconds
+ precission. Example: 2022-01-11T13:06:58.648000+00:00
+- Other timestamps in bmcweb did not change
+- All unit tests are passing
+
+Reference: Properties.Readings
+https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Telemetry/Report.interface.yaml
+
+Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
+Signed-off-by: Ed Tanous <edtanous@google.com>
+Change-Id: I5b40ef6889b5af8c045ec0d35a758967e53dbed2
+---
+ http/utility.hpp | 28 +++++++++++++++++-----------
+ redfish-core/lib/metric_report.hpp | 4 ++--
+ 2 files changed, 19 insertions(+), 13 deletions(-)
+
+diff --git a/http/utility.hpp b/http/utility.hpp
+index 033755e..374caea 100644
+--- a/http/utility.hpp
++++ b/http/utility.hpp
+@@ -572,29 +572,35 @@ inline bool base64Decode(const std::string_view input, std::string& output)
+ return true;
+ }
+
+-/**
+- * Method returns Date Time information in the ISO extended format
+- *
+- * @param[in] timestamp in second since the Epoch; it can be negative
+- *
+- * @return Date Time in the ISO extended format
+- */
+-inline std::string getDateTime(boost::posix_time::seconds secondsSinceEpoch)
++namespace details
++{
++inline std::string getDateTime(boost::posix_time::milliseconds timeSinceEpoch)
+ {
+ boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
+- boost::posix_time::ptime time = epoch + secondsSinceEpoch;
++ boost::posix_time::ptime time = epoch + timeSinceEpoch;
+ // append zero offset to the end according to the Redfish spec for Date-Time
+ return boost::posix_time::to_iso_extended_string(time) + "+00:00";
+ }
++} // namespace details
+
+ inline std::string getDateTimeUint(uint64_t secondsSinceEpoch)
+ {
+- return getDateTime(boost::posix_time::seconds(secondsSinceEpoch));
++ boost::posix_time::seconds boostSeconds(secondsSinceEpoch);
++ return details::getDateTime(
++ boost::posix_time::milliseconds(boostSeconds.total_milliseconds()));
++}
++
++inline std::string getDateTimeUintMs(uint64_t millisSecondsSinceEpoch)
++{
++ return details::getDateTime(
++ boost::posix_time::milliseconds(millisSecondsSinceEpoch));
+ }
+
+ inline std::string getDateTimeStdtime(std::time_t secondsSinceEpoch)
+ {
+- return getDateTime(boost::posix_time::seconds(secondsSinceEpoch));
++ boost::posix_time::ptime time =
++ boost::posix_time::from_time_t(secondsSinceEpoch);
++ return boost::posix_time::to_iso_extended_string(time) + "+00:00";
+ }
+
+ /**
+diff --git a/redfish-core/lib/metric_report.hpp b/redfish-core/lib/metric_report.hpp
+index b7ebb99..f933cd4 100644
+--- a/redfish-core/lib/metric_report.hpp
++++ b/redfish-core/lib/metric_report.hpp
+@@ -28,7 +28,7 @@ inline nlohmann::json toMetricValues(const Readings& readings)
+ {"MetricId", id},
+ {"MetricProperty", metadata},
+ {"MetricValue", std::to_string(sensorValue)},
+- {"Timestamp", crow::utility::getDateTimeUint(timestamp)},
++ {"Timestamp", crow::utility::getDateTimeUintMs(timestamp)},
+ });
+ }
+
+@@ -46,7 +46,7 @@ inline bool fillReport(nlohmann::json& json, const std::string& id,
+ telemetry::metricReportDefinitionUri + std::string("/") + id;
+
+ const auto& [timestamp, readings] = timestampReadings;
+- json["Timestamp"] = crow::utility::getDateTimeUint(timestamp);
++ json["Timestamp"] = crow::utility::getDateTimeUintMs(timestamp);
+ json["MetricValues"] = toMetricValues(readings);
+ return true;
+ }
+--
+2.25.1
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README
index 541fa6aba..9bb1e5eb9 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/telemetry/README
@@ -9,4 +9,7 @@ Current revisions:
file://telemetry/0002-Revert-Remove-LogService-from-TelemetryService.patch
- Switched bmcweb to use new telemetry service API
- https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/44270/28
+ file://telemetry/0003-Switched-bmcweb-to-use-new-telemetry-service-API.patch
+
+- Fixed timestamp in telemetry service
+ https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/50027/3
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/vm/0008-Return-404-for-POST-on-Proxy-InsertMedia.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/vm/0008-Return-404-for-POST-on-Proxy-InsertMedia.patch
new file mode 100644
index 000000000..2d9ab1dae
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/vm/0008-Return-404-for-POST-on-Proxy-InsertMedia.patch
@@ -0,0 +1,379 @@
+From 793e4d6952b2a121da55d866eb510b26e179750c Mon Sep 17 00:00:00 2001
+From: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
+Date: Fri, 4 Feb 2022 15:41:54 +0100
+Subject: [PATCH] Return 404 for POST on Proxy InsertMedia
+
+.../Actions/VirtualMedia.InsertMedia does not exist for proxy mode. But
+it does for legacy, so handler needs to return 404 for proxy and run
+mounting in legacy. Similar action has to be done for get, delete and
+patch.
+
+As the check shares the same codebase besides the action itself, this
+patch creates generic function for parsing GetManagedObjects, finding
+valid VirtualMedia endpoint and invoking specific action handler.
+
+Tested:
+Manually, with the following set of commands:
+POST /Proxy /InsertAction : returned 404
+POST /Legacy/InsertAction : returned 200 (mounted)
+GET /Proxy /InsertAction : returned 404
+GET /Legacy/InsertAction : returned 405
+PATCH /Proxy /InsertAction : returned 404
+PATCH /Legacy/InsertAction : returned 405
+DELETE/Proxy /InsertAction : returned 404
+DELETE/Legacy/InsertAction : returned 405
+
+Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
+---
+ redfish-core/lib/virtual_media.hpp | 265 ++++++++++++-----------------
+ 1 file changed, 108 insertions(+), 157 deletions(-)
+
+diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
+index da66b4b..6dfc726 100644
+--- a/redfish-core/lib/virtual_media.hpp
++++ b/redfish-core/lib/virtual_media.hpp
+@@ -19,6 +19,7 @@
+ #include <boost/container/flat_map.hpp>
+ #include <boost/process/async_pipe.hpp>
+ #include <boost/type_traits/has_dereference.hpp>
++#include <sdbusplus/message/native_types.hpp>
+ #include <utils/json_utils.hpp>
+ // for GetObjectType and ManagedObjectType
+
+@@ -32,13 +33,14 @@ namespace redfish
+ {
+
+ /**
+- * @brief Function checks if insert media request is Legacy or Proxy type
+- * and sets suitable response code for unsupported REST method.
++ * @brief Function parses getManagedObject response, finds item, makes generic
++ * validation and invokes callback handler on this item.
+ *
+ */
+-void checkProxyMode(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+- const crow::Request& req, const std::string& name,
+- const std::string& resName)
++template <typename T>
++void findItemAndRunHandler(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
++ const crow::Request& req, const std::string& name,
++ const std::string& resName, T&& handler)
+ {
+ if (name != "bmc")
+ {
+@@ -48,8 +50,8 @@ void checkProxyMode(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+ }
+
+ crow::connections::systemBus->async_method_call(
+- [aResp, req, resName](const boost::system::error_code ec,
+- const GetObjectType& getObjectType) {
++ [aResp, req, resName, handler](const boost::system::error_code ec,
++ const GetObjectType& getObjectType) {
+ if (ec)
+ {
+ BMCWEB_LOG_ERROR << "ObjectMapper::GetObject call failed: "
+@@ -70,9 +72,9 @@ void checkProxyMode(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+ BMCWEB_LOG_DEBUG << "GetObjectType: " << service;
+
+ crow::connections::systemBus->async_method_call(
+- [service, resName, req,
+- aResp](const boost::system::error_code ec,
+- ManagedObjectType& subtree) {
++ [service, resName, req, aResp,
++ handler](const boost::system::error_code ec,
++ ManagedObjectType& subtree) {
+ if (ec)
+ {
+ BMCWEB_LOG_DEBUG << "DBUS response error";
+@@ -105,26 +107,8 @@ void checkProxyMode(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+ continue;
+ }
+
+- // Check if dbus path is Legacy type
+- if (mode.filename() == "Legacy")
+- {
+- BMCWEB_LOG_DEBUG << "InsertMedia only allowed "
+- "with POST method "
+- "in legacy mode";
+- aResp->res.result(
+- boost::beast::http::status::method_not_allowed);
+-
+- return;
+- }
+- // Check if dbus path is Proxy type
+- if (mode.filename() == "Proxy")
++ if (handler(service, aResp, item) == true)
+ {
+- // Not possible in proxy mode
+- BMCWEB_LOG_DEBUG << "InsertMedia not "
+- "allowed in proxy mode";
+- aResp->res.result(
+- boost::beast::http::status::not_found);
+-
+ return;
+ }
+ }
+@@ -289,10 +273,7 @@ static std::optional<uint64_t>
+ std::chrono::seconds(*timeoutValue + timeoutMarginSeconds))
+ .count();
+ }
+- else
+- {
+- return std::nullopt;
+- }
++ return std::nullopt;
+ }
+
+ /**
+@@ -972,14 +953,43 @@ struct InsertMediaActionParams
+
+ inline void requestNBDVirtualMediaRoutes(App& app)
+ {
++ auto handler = []([[maybe_unused]] const std::string& service,
++ const std::shared_ptr<bmcweb::AsyncResp>& aResp,
++ std::pair<sdbusplus::message::object_path,
++ DbusInterfaceType>& item) {
++ auto mode = item.first.parent_path();
++ auto type = mode.parent_path();
++ // Check if dbus path is Legacy type
++ if (mode.filename() == "Legacy")
++ {
++ BMCWEB_LOG_DEBUG << "InsertMedia only allowed "
++ "with POST method "
++ "in legacy mode";
++ aResp->res.result(boost::beast::http::status::method_not_allowed);
++
++ return true;
++ }
++ // Check if dbus path is Proxy type
++ if (mode.filename() == "Proxy")
++ {
++ // Not possible in proxy mode
++ BMCWEB_LOG_DEBUG << "InsertMedia not "
++ "allowed in proxy mode";
++ aResp->res.result(boost::beast::http::status::not_found);
++
++ return true;
++ }
++ return false;
++ };
+ BMCWEB_ROUTE(app, "/redfish/v1/Managers/<str>/VirtualMedia/<str>/Actions/"
+ "VirtualMedia.InsertMedia")
+ .privileges({{"Login"}})
+ .methods(boost::beast::http::verb::get)(
+- [](const crow::Request& req,
+- const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+- const std::string& name, const std::string& resName) {
+- checkProxyMode(asyncResp, req, name, resName);
++ [handler](const crow::Request& req,
++ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
++ const std::string& name, const std::string& resName) {
++ findItemAndRunHandler(asyncResp, req, name, resName,
++ std::move(handler));
+ });
+
+ for (auto method :
+@@ -991,10 +1001,12 @@ inline void requestNBDVirtualMediaRoutes(App& app)
+ "VirtualMedia.InsertMedia")
+ .privileges({{"ConfigureManager"}})
+ .methods(method)(
+- [](const crow::Request& req,
+- const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+- const std::string& name, const std::string& resName) {
+- checkProxyMode(asyncResp, req, name, resName);
++ [handler = std::move(handler)](
++ const crow::Request& req,
++ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
++ const std::string& name, const std::string& resName) {
++ findItemAndRunHandler(asyncResp, req, name, resName,
++ std::move(handler));
+ });
+ }
+
+@@ -1006,129 +1018,68 @@ inline void requestNBDVirtualMediaRoutes(App& app)
+ [](const crow::Request& req,
+ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
+ const std::string& name, const std::string& resName) {
+- if (name != "bmc")
+- {
+- messages::resourceNotFound(asyncResp->res,
+- "VirtualMedia.Insert", resName);
+-
+- return;
+- }
+- InsertMediaActionParams actionParams;
+-
+- // Read obligatory parameters (url of
+- // image)
+- if (!json_util::readJson(
+- req, asyncResp->res, "Image", actionParams.imageUrl,
+- "WriteProtected", actionParams.writeProtected,
+- "UserName", actionParams.userName, "Password",
+- actionParams.password, "Inserted",
+- actionParams.inserted, "TransferMethod",
+- actionParams.transferMethod, "TransferProtocolType",
+- actionParams.transferProtocolType))
+- {
+- BMCWEB_LOG_DEBUG << "Image is not provided";
+- return;
+- }
+-
+- bool paramsValid = validateParams(
+- asyncResp->res, actionParams.imageUrl,
+- actionParams.inserted, actionParams.transferMethod,
+- actionParams.transferProtocolType);
+-
+- if (paramsValid == false)
+- {
+- return;
+- }
+-
+- crow::connections::systemBus->async_method_call(
+- [asyncResp, actionParams,
+- resName](const boost::system::error_code ec,
+- const GetObjectType& getObjectType) mutable {
+- if (ec)
++ // handle legacy mode (parse parameters and start action
++ // for proxy mode return 404.
++ auto handler =
++ [req, resName](
++ const std::string& service,
++ const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
++ std::pair<sdbusplus::message::object_path,
++ DbusInterfaceType>& item) {
++ auto mode = item.first.parent_path();
++ auto type = mode.parent_path();
++ if (mode.filename() == "Proxy")
+ {
+- BMCWEB_LOG_ERROR
+- << "ObjectMapper::GetObject call failed: "
+- << ec;
+- messages::internalError(asyncResp->res);
++ // Not possible in proxy mode
++ BMCWEB_LOG_DEBUG << "InsertMedia not "
++ "allowed in proxy mode";
++ messages::resourceNotFound(
++ asyncResp->res, "VirtualMedia.InsertMedia",
++ resName);
+
+- return;
++ return true;
+ }
+- std::string service = getObjectType.begin()->first;
+- BMCWEB_LOG_DEBUG << "GetObjectType: " << service;
+-
+- crow::connections::systemBus->async_method_call(
+- [service, resName, actionParams,
+- asyncResp](const boost::system::error_code ec,
+- ManagedObjectType& subtree) mutable {
+- if (ec)
+- {
+- BMCWEB_LOG_DEBUG << "DBUS response error";
+
+- return;
+- }
+-
+- for (const auto& object : subtree)
+- {
+- const std::string& path =
+- static_cast<const std::string&>(
+- object.first);
+-
+- std::size_t lastIndex = path.rfind('/');
+- if (lastIndex == std::string::npos)
+- {
+- continue;
+- }
+-
+- lastIndex += 1;
+-
+- if (path.substr(lastIndex) == resName)
+- {
+- lastIndex = path.rfind("Proxy");
+- if (lastIndex != std::string::npos)
+- {
+- // Not possible in proxy mode
+- BMCWEB_LOG_DEBUG
+- << "InsertMedia not "
+- "allowed in proxy mode";
+- messages::resourceNotFound(
+- asyncResp->res,
+- "VirtualMedia.InsertMedia",
+- resName);
+-
+- return;
+- }
++ InsertMediaActionParams actionParams;
++
++ // Read obligatory parameters (url of
++ // image)
++ if (!json_util::readJson(
++ req, asyncResp->res, "Image",
++ actionParams.imageUrl, "WriteProtected",
++ actionParams.writeProtected, "UserName",
++ actionParams.userName, "Password",
++ actionParams.password, "Inserted",
++ actionParams.inserted, "TransferMethod",
++ actionParams.transferMethod,
++ "TransferProtocolType",
++ actionParams.transferProtocolType))
++ {
++ BMCWEB_LOG_DEBUG << "Image is not provided";
++ return true;
++ }
+
+- lastIndex = path.rfind("Legacy");
+- if (lastIndex == std::string::npos)
+- {
+- continue;
+- }
++ bool paramsValid = validateParams(
++ asyncResp->res, actionParams.imageUrl,
++ actionParams.inserted, actionParams.transferMethod,
++ actionParams.transferProtocolType);
+
+- // manager is irrelevant for
+- // VirtualMedia dbus calls
+- doMountVmLegacy(
+- asyncResp, service, resName,
+- actionParams.imageUrl,
+- !(*actionParams.writeProtected),
+- std::move(*actionParams.userName),
+- std::move(*actionParams.password));
++ if (paramsValid == false)
++ {
++ return true;
++ }
+
+- return;
+- }
+- }
+- BMCWEB_LOG_DEBUG << "Parent item not found";
+- messages::resourceNotFound(
+- asyncResp->res, "VirtualMedia", resName);
+- },
+- service, "/xyz/openbmc_project/VirtualMedia",
+- "org.freedesktop.DBus.ObjectManager",
+- "GetManagedObjects");
+- },
+- "xyz.openbmc_project.ObjectMapper",
+- "/xyz/openbmc_project/object_mapper",
+- "xyz.openbmc_project.ObjectMapper", "GetObject",
+- "/xyz/openbmc_project/VirtualMedia",
+- std::array<const char*, 0>());
++ // manager is irrelevant for
++ // VirtualMedia dbus calls
++ doMountVmLegacy(asyncResp, service, resName,
++ actionParams.imageUrl,
++ !(*actionParams.writeProtected),
++ std::move(*actionParams.userName),
++ std::move(*actionParams.password));
++
++ return true;
++ };
++ findItemAndRunHandler(asyncResp, req, name, resName, handler);
+ });
+
+ BMCWEB_ROUTE(
+--
+2.31.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 7183dfffa..f7154bda1 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb_%.bbappend
@@ -23,6 +23,10 @@ SRC_URI += "file://0001-Firmware-update-configuration-changes.patch \
file://0025-Add-Model-to-ProcessorSummary.patch \
file://0026-Revert-Delete-the-copy-constructor-on-the-Request.patch \
file://0027-Convert-VariantType-to-DbusVariantType.patch \
+ file://0028-Add-FirmwareResiliency-and-FirmwareUpdateStatus.patch \
+ file://0029-Fix-Property-PhysicalContext-is-invalid-none.patch \
+ file://0030-Change-Severity-for-ServiceFailure-redfish-event.patch \
+ file://0031-Change-PcieType-to-PCIeType.patch \
"
# OOB Bios Config:
@@ -44,6 +48,7 @@ SRC_URI += " \
file://vm/0005-Set-Inserted-redfish-property-for-not-inserted-resou.patch \
file://vm/0006-Bmcweb-handle-permission-denied-exception.patch \
file://vm/0007-Fix-unmounting-image-in-proxy-mode.patch \
+ file://vm/0008-Return-404-for-POST-on-Proxy-InsertMedia.patch \
"
# EventService: Temporary pulled to downstream. See eventservice\README for details
@@ -58,6 +63,7 @@ SRC_URI += "file://eventservice/0001-Add-unmerged-changes-for-http-retry-support
file://eventservice/0011-Fix-bmcweb-crash-while-deleting-terminated-subscriptions.patch \
file://eventservice/0012-Add-support-for-deleting-terminated-subscriptions.patch \
file://eventservice/0013-event-service-fix-added-Context-field-to-response.patch \
+ file://eventservice/0014-Fix-Event-Subscription-URI.patch \
"
@@ -65,6 +71,7 @@ SRC_URI += "file://eventservice/0001-Add-unmerged-changes-for-http-retry-support
SRC_URI += " file://telemetry/0001-Add-support-for-POST-on-TriggersCollection.patch \
file://telemetry/0002-Revert-Remove-LogService-from-TelemetryService.patch \
file://telemetry/0003-Switched-bmcweb-to-use-new-telemetry-service-API.patch \
+ file://telemetry/0004-Fixed-timestamp-in-telemetry-service.patch \
"
# Temporary downstream patch for routing and privilege changes
@@ -83,6 +90,7 @@ EXTRA_OEMESON += " -Dvm-nbdproxy=enabled"
# Disable dependency on external nbd-proxy application
EXTRA_OEMESON += " -Dvm-websocket=disabled"
+EXTRA_OEMESON += " -Dredfish-host-logger=disabled"
RDEPENDS:${PN}:remove += "jsnbd"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-user_mgmt-Fix-for-user-privilege-race-condition.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-user_mgmt-Fix-for-user-privilege-race-condition.patch
new file mode 100644
index 000000000..7f0a63b77
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/0064-user_mgmt-Fix-for-user-privilege-race-condition.patch
@@ -0,0 +1,152 @@
+From 2c40b63025d39382db78dc4ec62e6fb55c7c66a7 Mon Sep 17 00:00:00 2001
+From: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
+Date: Fri, 1 Oct 2021 16:01:57 +0000
+Subject: [PATCH] user_mgmt: Fix for user privilege race condition
+
+This is porting of main line upstream review change #47382.
+
+The ipmid and netipmid processes cache IPMI user data in a shared file.
+The current implementation has coherency and consistency problems:
+
+Coherence: If a user account is created and immediately enabled with
+IPMI commands, the updated data may not be propagated to netipmid. This
+condition can last indefinitely, so the cache is not coherent. The
+problem is caused by a lock that doesn't work and allows both processes
+to register signal handlers that write to the file.
+
+Consistency: This cache scheme does not have a strict (or linearizable)
+consistency model. The ipmid and netipmid processes have an inconsistent
+view of the user database until changes propagate to netipmid. Cache
+file reads are controlled by mtime comparisons with a one-second
+granularity.
+
+So mitigated the second problem by using the full 10ms resolution of
+mtime. Now a new user is ready to use much faster than a client can
+submit two commands.
+
+Mitigating the second (consistency) problem does not fix the first
+problem. It might hide it, but the result will still depend on
+non-deterministic timing of DBus signals and mtime granularity.
+
+To fix the coherency problem, changed sigHndlrLock to use a different
+file that isn't closed after each operation. Closing a POSIX file lock
+releases the lock.
+
+Tested:
+1. Verified using IPMI commands by creating multiple users continuously.
+Successfully created all users and able to perform RMCPP with that user.
+
+Command: ipmitool user set name <used id> <username>
+Response: //User created successfully
+Command: ipmitool user set password <used id> <password>
+Response: Set User Password command successful <user name>
+Command: ipmitool channel setaccess <channel#> <user id> link=on ipmi=on
+ callin=on privilege=4
+Response: Set User Access (channel<number > id <user id>) successful.
+Command: ipmitool raw 0x6 0x43 0x9<channel #> <user id> 0x4 0x0
+ // Set User Access Command
+Response: //Success
+Command: ipmitool user enable <user id>
+Response: //Success
+Command: ipmitool -H <BMC IP> -U <user name> -P <password> -C 17 -I
+ lanplus raw 0x06 0x01
+Response: <device ID> //Success
+
+Signed-off-by: Luke Phillips <lucas.phillips@intel.com>
+Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
+Change-Id: If5ede3b0f97a2ba2b33cf358a9aaaf93d765d359
+---
+ user_channel/user_mgmt.cpp | 27 +++++++++++++++++++++------
+ user_channel/user_mgmt.hpp | 4 ++--
+ 2 files changed, 23 insertions(+), 8 deletions(-)
+
+diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
+index 2459de7..1644154 100644
+--- a/user_channel/user_mgmt.cpp
++++ b/user_channel/user_mgmt.cpp
+@@ -70,6 +70,8 @@ static constexpr const char* getObjectMethod = "GetObject";
+ static constexpr const char* ipmiUserMutex = "ipmi_usr_mutex";
+ static constexpr const char* ipmiMutexCleanupLockFile =
+ "/var/lib/ipmi/ipmi_usr_mutex_cleanup";
++static constexpr const char* ipmiUserSignalLockFile =
++ "/var/lib/ipmi/ipmi_usr_signal_mutex";
+ static constexpr const char* ipmiUserDataFile = "/var/lib/ipmi/ipmi_user.json";
+ static constexpr const char* ipmiGrpName = "ipmi";
+ static constexpr size_t privNoAccess = 0xF;
+@@ -1504,8 +1506,10 @@ void UserAccess::deleteUserIndex(const size_t& usrIdx)
+
+ void UserAccess::checkAndReloadUserData()
+ {
+- std::time_t updateTime = getUpdatedFileTime();
+- if (updateTime != fileLastUpdatedTime || updateTime == -EIO)
++ std::timespec updateTime = getUpdatedFileTime();
++ if ((updateTime.tv_sec != fileLastUpdatedTime.tv_sec ||
++ updateTime.tv_nsec != fileLastUpdatedTime.tv_nsec) ||
++ (updateTime.tv_sec == 0 && updateTime.tv_nsec == 0))
+ {
+ std::fill(reinterpret_cast<uint8_t*>(&usersTbl),
+ reinterpret_cast<uint8_t*>(&usersTbl) + sizeof(usersTbl), 0);
+@@ -1557,15 +1561,15 @@ void UserAccess::getSystemPrivAndGroups()
+ return;
+ }
+
+-std::time_t UserAccess::getUpdatedFileTime()
++std::timespec UserAccess::getUpdatedFileTime()
+ {
+ struct stat fileStat;
+ if (stat(ipmiUserDataFile, &fileStat) != 0)
+ {
+ log<level::DEBUG>("Error in getting last updated time stamp");
+- return -EIO;
++ return std::timespec{0, 0};
+ }
+- return fileStat.st_mtime;
++ return fileStat.st_mtim;
+ }
+
+ void UserAccess::getUserProperties(const DbusUserObjProperties& properties,
+@@ -1631,7 +1635,18 @@ void UserAccess::cacheUserDataFile()
+ }
+ writeUserData();
+ }
+- sigHndlrLock = boost::interprocess::file_lock(ipmiUserDataFile);
++ // Create lock file if it does not exist
++ int fd = open(ipmiUserSignalLockFile, O_CREAT | O_TRUNC | O_SYNC,
++ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
++ if (fd < 0)
++ {
++ log<level::ERR>("Error in creating IPMI user signal lock file");
++ throw std::ios_base::failure(
++ "Error in creating temporary IPMI user signal lock file");
++ }
++ close(fd);
++
++ sigHndlrLock = boost::interprocess::file_lock(ipmiUserSignalLockFile);
+ // Register it for single object and single process either netipimd /
+ // host-ipmid
+ if (userUpdatedSignal == nullptr && sigHndlrLock.try_lock())
+diff --git a/user_channel/user_mgmt.hpp b/user_channel/user_mgmt.hpp
+index 833f6a1..602d549 100644
+--- a/user_channel/user_mgmt.hpp
++++ b/user_channel/user_mgmt.hpp
+@@ -379,7 +379,7 @@ class UserAccess
+ std::vector<std::string> availablePrivileges;
+ std::vector<std::string> availableGroups;
+ sdbusplus::bus::bus bus;
+- std::time_t fileLastUpdatedTime;
++ std::timespec fileLastUpdatedTime;
+ bool signalHndlrObject = false;
+ boost::interprocess::file_lock sigHndlrLock;
+ boost::interprocess::file_lock mutexCleanupLock;
+@@ -388,7 +388,7 @@ class UserAccess
+ *
+ * @return time stamp or -EIO for failure
+ */
+- std::time_t getUpdatedFileTime();
++ std::timespec getUpdatedFileTime();
+
+ /** @brief function to available system privileges and groups
+ *
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
index 5c0908515..9225fb36d 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
@@ -10,6 +10,7 @@ SRC_URI += "file://phosphor-ipmi-host.service \
file://0059-Move-Set-SOL-config-parameter-to-host-ipmid.patch \
file://0060-Move-Get-SOL-config-parameter-to-host-ipmid.patch \
file://0063-Save-the-pre-timeout-interrupt-in-dbus-property.patch \
+ file://0064-user_mgmt-Fix-for-user-privilege-race-condition.patch \
"
EXTRA_OECONF:append = " --disable-i2c-whitelist-check"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend
index 853d68d87..d7204990d 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend
@@ -3,20 +3,12 @@ inherit useradd
# TODO: This should be removed, once up-stream bump up
# issue is resolved
SRC_URI += "git://github.com/openbmc/phosphor-net-ipmid"
-SRCREV = "af23add2a2cf73226cdc72af4793fde6357e8932"
+SRCREV = "2528dfbdfdac5e0167d6529a25ee12b556577e1a"
USERADD_PACKAGES = "${PN}"
# add a group called ipmi
GROUPADD_PARAM:${PN} = "ipmi "
-# Default rmcpp iface is eth0; channel 1
-# Add channel 2 instance (eth1)
-RMCPP_EXTRA = "eth1"
-SYSTEMD_SERVICE:${PN} += " \
- ${PN}@${RMCPP_EXTRA}.service \
- ${PN}@${RMCPP_EXTRA}.socket \
- "
-
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI += " file://10-nice-rules.conf \
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb
index 1710c1acd..687a71caf 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/mctpd.bb
@@ -5,7 +5,7 @@ LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
SRC_URI = "git://git@github.com/Intel-BMC/mctpd.git;protocol=ssh;branch=main"
-SRCREV = "60c0862eb286b2de8cee93a2f6736a3d317d9739"
+SRCREV = "1d8974fda04b2888032b99fdcc8022353cab52f3"
S = "${WORKDIR}/git"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb
index 661db1ea0..c641132be 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/pmci/pldmd.bb
@@ -4,7 +4,7 @@ DESCRIPTION = "Implementation of PLDM specifications"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
-SRC_URI += "git://git@github.com/Intel-BMC/pldmd.git;protocol=ssh;branch=main;branch=main"
+SRC_URI += "git://git@github.com/Intel-BMC/pldmd.git;protocol=ssh;branch=main"
SRCREV = "5a698ca08b8159d935f8ccbc09a84960cf201896"
S = "${WORKDIR}/git"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0010-Add-support-for-Get-PMBUS-Readings-method.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0010-Add-support-for-Get-PMBUS-Readings-method.patch
new file mode 100644
index 000000000..d305ef008
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0010-Add-support-for-Get-PMBUS-Readings-method.patch
@@ -0,0 +1,457 @@
+From 5c2fbc31b076a32d0291e74046a576de852ac90c Mon Sep 17 00:00:00 2001
+From: Arun Lal K M <arun.lal@intel.com>
+Date: Thu, 6 Jan 2022 20:30:09 +0000
+Subject: [PATCH] Add support for 'Get PMBUS Readings' method.
+
+VR sensor is currently read in the following way:
+BMC gives read command, and ME proxy forward it to VR sensor.
+
+In 'Get PMBUS Readings' method BMC reads the data from ME.
+This is used in platforms where ME cannot proxy forward PMBUS command.
+
+Command:
+0x2E 0xF5 0x57 0x01 0x00 0x<ID> 0x0F 0x00
+
+0x2E is net function
+0xF5 is corresponding to 'Get PMBUS Readings'
+0x57 0x01 0x00 is Intel manufacturers ID
+ID is the ID of senssor in ME (not actual sensor address)
+0x0F is PMBUS-enabled Device Index
+0x00 is reserved byte
+
+New configuration parameters in Baseboard.json:
+1) DeviceIndex: ID of the sensor in ME.
+2) ReadMethod: use "ReadME" for 'Get PMBUS Readings'.
+3) Register: Register to read in the response byte array.
+ For example,
+ Registers 1 = Temperature
+ Registers 2 = Voltage
+ Registers 3 = Current
+
+Note:
+This is not a complete replacement for the old method, we are adding
+one more way to read these sensors. The old implementation is still
+present, as in, new code with old configuration file
+(xx_Baseboard.json) will work (using the old method of reading the
+sensor).
+
+References:
+1) Intelligent Power Node Manager External Interface Specification
+ Using IPMI.
+2) PMBus-Specification.
+
+Tested:
+Case 1: Using proxy (Backward compatibility testing)
+Sample configuration in Baseboard.json:
+{
+ "Address": "0xXX",
+ "Class": "MpsBridgeTemp",
+ "Name": "XX VR Temp",
+ "Thresholds": [...],
+ "Type": "IpmbSensor"
+}
+
+Give command 'ipmitool sdr elist'
+Response:
+CPU1 PVCCD VR Te | 31h | ok | 0.1 | 37 degrees C
+CPU2 PVCCD VR Te | 36h | ok | 0.1 | 37 degrees C
+CPU1 PVCCFA EHV | 32h | ok | 0.1 | 34 degrees C
+CPU2 PVCCFA EHV | 37h | ok | 0.1 | 33 degrees C
+CPU1 VCCIN VR Te | 34h | ok | 0.1 | 48 degrees C
+CPU2 VCCIN VR Te | 39h | ok | 0.1 | 58 degrees C
+
+Case 2: Using 'Get PMBUS Readings' method
+Sample configuration in Baseboard.json:
+{
+ "Address": "0xXX",
+ "DeviceIndex": "0xXX",
+ "Class": "MpsBridgeTemp",
+ "Register": 1,
+ "ReadMethod": "ReadME",
+ "Name": "XX VR Temp",
+ "Thresholds": [...],
+ "Type": "IpmbSensor"
+}
+
+Give command 'ipmitool sdr elist'
+Response:
+CPU1 PVCCD VR Te | 31h | ok | 0.1 | 41 degrees C
+CPU2 PVCCD VR Te | 36h | ok | 0.1 | 43 degrees C
+CPU1 PVCCFA EHV | 32h | ok | 0.1 | 37 degrees C
+CPU2 PVCCFA EHV | 37h | ok | 0.1 | 37 degrees C
+CPU1 VCCIN VR Te | 34h | ok | 0.1 | 60 degrees C
+CPU2 VCCIN VR Te | 39h | ok | 0.1 | 56 degrees C
+
+Signed-off-by: Arun Lal K M <arun.lal@intel.com>
+---
+ include/IpmbSensor.hpp | 51 ++++++++++
+ src/IpmbSensor.cpp | 217 ++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 233 insertions(+), 35 deletions(-)
+
+diff --git a/include/IpmbSensor.hpp b/include/IpmbSensor.hpp
+index 18d10c1..2a89251 100644
+--- a/include/IpmbSensor.hpp
++++ b/include/IpmbSensor.hpp
+@@ -43,6 +43,51 @@ namespace sensor
+ {
+ constexpr uint8_t netFn = 0x04;
+ constexpr uint8_t getSensorReading = 0x2d;
++constexpr uint8_t manufacturerId[3] = {0x57, 0x01, 0x00};
++
++namespace read_me
++{
++/**
++ * Refernce:
++ * Intelligent Power Node Manager External Interface Specification
++ * getPmbusReadings = Get PMBUS Readings (F5h)
++ *
++ * bytesForTimestamp and bytesForManufacturerId are decoded from
++ * response bytes for Get PMBUS Readings.
++ */
++constexpr uint8_t getPmbusReadings = 0xF5;
++constexpr uint8_t bytesForTimestamp = 4;
++constexpr uint8_t bytesForManufacturerId = 3;
++
++constexpr size_t fixedOffset = bytesForTimestamp + bytesForManufacturerId;
++
++void getRawData(uint8_t registerToRead, const std::vector<uint8_t>& input,
++ std::vector<uint8_t>& result)
++{
++ if (input.size() < 3)
++ {
++ return;
++ }
++
++ /* Every register is two bytes*/
++ size_t offset = fixedOffset + (registerToRead * 2);
++ if (input.size() <= (offset + 1))
++ {
++ return;
++ }
++
++ result.reserve(5);
++
++ // ID
++ result.emplace_back(input[0]);
++ result.emplace_back(input[1]);
++ result.emplace_back(input[2]);
++
++ // Value in registerToRead
++ result.emplace_back(input[offset]);
++ result.emplace_back(input[offset + 1]);
++}
++} // namespace read_me
+
+ static bool isValid(const std::vector<uint8_t>& data)
+ {
+@@ -91,6 +136,7 @@ struct IpmbSensor : public Sensor
+ void loadDefaults(void);
+ void runInitCmd(void);
+ bool processReading(const std::vector<uint8_t>& data, double& resp);
++ void setReadMethod(const SensorBaseConfigMap& sensorBaseConfig);
+
+ IpmbType type;
+ IpmbSubType subType;
+@@ -102,6 +148,9 @@ struct IpmbSensor : public Sensor
+ uint8_t deviceAddress;
+ uint8_t errorCount;
+ uint8_t hostSMbusIndex;
++ uint8_t registerToRead = 0;
++ bool isReadMe = false;
++ uint8_t deviceIndex = 0;
+ std::vector<uint8_t> commandData;
+ std::optional<uint8_t> initCommand;
+ std::vector<uint8_t> initData;
+@@ -112,4 +161,6 @@ struct IpmbSensor : public Sensor
+ private:
+ sdbusplus::asio::object_server& objectServer;
+ boost::asio::deadline_timer waitTimer;
++
++ void getMeCommand();
+ };
+diff --git a/src/IpmbSensor.cpp b/src/IpmbSensor.cpp
+index eedf21e..75f74b5 100644
+--- a/src/IpmbSensor.cpp
++++ b/src/IpmbSensor.cpp
+@@ -150,6 +150,39 @@ void IpmbSensor::runInitCmd()
+ }
+ }
+
++/**
++ * Refernce:
++ * Intelligent Power Node Manager External Interface Specification
++ */
++void IpmbSensor::getMeCommand()
++{
++ /*
++ * Byte 1, 2, 3 = Manufacturer ID.
++ */
++ commandData.emplace_back(ipmi::sensor::manufacturerId[0]);
++ commandData.emplace_back(ipmi::sensor::manufacturerId[1]);
++ commandData.emplace_back(ipmi::sensor::manufacturerId[2]);
++
++ /*
++ * Byte 4 = Device Index.
++ */
++ commandData.emplace_back(deviceIndex);
++
++ /*
++ * Byte 5 = History index.
++ * bit 0 to 3 = History index. Supported value: 0Fh to retrieve
++ * current samples.
++ * bit 4 to 7 = Page number – used only for devices which support
++ * pages.
++ */
++ commandData.emplace_back(0x0F);
++
++ /*
++ * Byte 6 = First Register Offset.
++ */
++ commandData.emplace_back(0x00);
++}
++
+ void IpmbSensor::loadDefaults()
+ {
+ if (type == IpmbType::meSensor)
+@@ -164,28 +197,44 @@ void IpmbSensor::loadDefaults()
+ {
+ commandAddress = meAddress;
+ netfn = ipmi::me_bridge::netFn;
+- command = ipmi::me_bridge::sendRawPmbus;
+- initCommand = ipmi::me_bridge::sendRawPmbus;
+- // pmbus read temp
+- commandData = {0x57, 0x01, 0x00, 0x16, hostSMbusIndex,
+- deviceAddress, 0x00, 0x00, 0x00, 0x00,
+- 0x01, 0x02, 0x8d};
+- // goto page 0
+- initData = {0x57, 0x01, 0x00, 0x14, hostSMbusIndex,
+- deviceAddress, 0x00, 0x00, 0x00, 0x00,
+- 0x02, 0x00, 0x00, 0x00};
+ readingFormat = ReadingFormat::linearElevenBit;
++ if (isReadMe)
++ {
++ command = ipmi::sensor::read_me::getPmbusReadings;
++ getMeCommand();
++ }
++ else
++ {
++ command = ipmi::me_bridge::sendRawPmbus;
++ initCommand = ipmi::me_bridge::sendRawPmbus;
++ // pmbus read temp
++ commandData = {0x57, 0x01, 0x00, 0x16, hostSMbusIndex,
++ deviceAddress, 0x00, 0x00, 0x00, 0x00,
++ 0x01, 0x02, 0x8d};
++ // goto page 0
++ initData = {0x57, 0x01, 0x00, 0x14, hostSMbusIndex,
++ deviceAddress, 0x00, 0x00, 0x00, 0x00,
++ 0x02, 0x00, 0x00, 0x00};
++ }
+ }
+ else if (type == IpmbType::IR38363VR)
+ {
+ commandAddress = meAddress;
+ netfn = ipmi::me_bridge::netFn;
+- command = ipmi::me_bridge::sendRawPmbus;
+- // pmbus read temp
+- commandData = {0x57, 0x01, 0x00, 0x16, hostSMbusIndex,
+- deviceAddress, 00, 0x00, 0x00, 0x00,
+- 0x01, 0x02, 0x8D};
+ readingFormat = ReadingFormat::elevenBitShift;
++ if (isReadMe)
++ {
++ command = ipmi::sensor::read_me::getPmbusReadings;
++ getMeCommand();
++ }
++ else
++ {
++ command = ipmi::me_bridge::sendRawPmbus;
++ // pmbus read temp
++ commandData = {0x57, 0x01, 0x00, 0x16, hostSMbusIndex,
++ deviceAddress, 00, 0x00, 0x00, 0x00,
++ 0x01, 0x02, 0x8D};
++ }
+ }
+ else if (type == IpmbType::ADM1278HSC)
+ {
+@@ -194,20 +243,28 @@ void IpmbSensor::loadDefaults()
+ {
+ case IpmbSubType::temp:
+ case IpmbSubType::curr:
+- uint8_t snsNum;
+- if (subType == IpmbSubType::temp)
++ netfn = ipmi::me_bridge::netFn;
++ readingFormat = ReadingFormat::elevenBit;
++ if (isReadMe)
+ {
+- snsNum = 0x8d;
++ command = ipmi::sensor::read_me::getPmbusReadings;
++ getMeCommand();
+ }
+ else
+ {
+- snsNum = 0x8c;
++ uint8_t snsNum;
++ if (subType == IpmbSubType::temp)
++ {
++ snsNum = 0x8d;
++ }
++ else
++ {
++ snsNum = 0x8c;
++ }
++ command = ipmi::me_bridge::sendRawPmbus;
++ commandData = {0x57, 0x01, 0x00, 0x86, deviceAddress,
++ 0x00, 0x00, 0x01, 0x02, snsNum};
+ }
+- netfn = ipmi::me_bridge::netFn;
+- command = ipmi::me_bridge::sendRawPmbus;
+- commandData = {0x57, 0x01, 0x00, 0x86, deviceAddress,
+- 0x00, 0x00, 0x01, 0x02, snsNum};
+- readingFormat = ReadingFormat::elevenBit;
+ break;
+ case IpmbSubType::power:
+ case IpmbSubType::volt:
+@@ -224,17 +281,25 @@ void IpmbSensor::loadDefaults()
+ {
+ commandAddress = meAddress;
+ netfn = ipmi::me_bridge::netFn;
+- command = ipmi::me_bridge::sendRawPmbus;
+- initCommand = ipmi::me_bridge::sendRawPmbus;
+- // pmbus read temp
+- commandData = {0x57, 0x01, 0x00, 0x16, hostSMbusIndex,
+- deviceAddress, 0x00, 0x00, 0x00, 0x00,
+- 0x01, 0x02, 0x8d};
+- // goto page 0
+- initData = {0x57, 0x01, 0x00, 0x14, hostSMbusIndex,
+- deviceAddress, 0x00, 0x00, 0x00, 0x00,
+- 0x02, 0x00, 0x00, 0x00};
+ readingFormat = ReadingFormat::byte3;
++ if (isReadMe)
++ {
++ command = ipmi::sensor::read_me::getPmbusReadings;
++ getMeCommand();
++ }
++ else
++ {
++ command = ipmi::me_bridge::sendRawPmbus;
++ initCommand = ipmi::me_bridge::sendRawPmbus;
++ // pmbus read temp
++ commandData = {0x57, 0x01, 0x00, 0x16, hostSMbusIndex,
++ deviceAddress, 0x00, 0x00, 0x00, 0x00,
++ 0x01, 0x02, 0x8d};
++ // goto page 0
++ initData = {0x57, 0x01, 0x00, 0x14, hostSMbusIndex,
++ deviceAddress, 0x00, 0x00, 0x00, 0x00,
++ 0x02, 0x00, 0x00, 0x00};
++ }
+ }
+ else
+ {
+@@ -362,7 +427,19 @@ void IpmbSensor::read(void)
+ read();
+ return;
+ }
+- const std::vector<uint8_t>& data = std::get<5>(response);
++
++ std::vector<uint8_t> data;
++
++ if (isReadMe)
++ {
++ ipmi::sensor::read_me::getRawData(
++ registerToRead, std::get<5>(response), data);
++ }
++ else
++ {
++ data = std::get<5>(response);
++ }
++
+ if constexpr (debug)
+ {
+ std::cout << name << ": ";
+@@ -408,6 +485,74 @@ void IpmbSensor::read(void)
+ "sendRequest", commandAddress, netfn, lun, command, commandData);
+ });
+ }
++
++void IpmbSensor::setReadMethod(const SensorBaseConfigMap& sensorBaseConfig)
++{
++ /*
++ * Some sensor can be read in two ways
++ * 1) Using proxy: BMC read command is proxy forward by ME
++ * to sensor. 2) Using 'Get PMBUS Readings': ME responds to
++ * BMC with sensor data.
++ *
++ * By default we assume the method is 1. And if ReadMethod
++ * == "ReadME" we switch to method 2.
++ */
++ auto readMethod = sensorBaseConfig.find("ReadMethod");
++ if (readMethod == sensorBaseConfig.end())
++ {
++ std::cerr << "'ReadMethod' not found, defaulting to "
++ "proxy method of reading sensor\n";
++ return;
++ }
++
++ if (std::visit(VariantToStringVisitor(), readMethod->second) != "ReadME")
++ {
++ std::cerr << "'ReadMethod' != 'ReadME', defaulting to "
++ "proxy method of reading sensor\n";
++ return;
++ }
++
++ /*
++ * In 'Get PMBUS Readings' the response containt a
++ * set of registers from the sensor. And different
++ * values such as temperature power voltage will be
++ * mapped to different registers.
++ */
++ auto registerToReadConfig = sensorBaseConfig.find("Register");
++ if (registerToReadConfig == sensorBaseConfig.end())
++ {
++ std::cerr << "'Register' not found, defaulting to "
++ "proxy method of reading sensor\n";
++ return;
++ }
++
++ registerToRead =
++ std::visit(VariantToUnsignedIntVisitor(), registerToReadConfig->second);
++
++ /*
++ * In 'Get PMBUS Readings' since ME is
++ * responding with the sensor data we need
++ * to use the address for sensor in ME, this
++ * is different from the actual sensor
++ * address.
++ */
++ auto deviceIndexConfig = sensorBaseConfig.find("SensorMeAddress");
++ if (deviceIndexConfig == sensorBaseConfig.end())
++ {
++ std::cerr << "'SensorMeAddress' not found, defaulting to "
++ "proxy method of reading sensor\n";
++ return;
++ }
++
++ deviceIndex =
++ std::visit(VariantToUnsignedIntVisitor(), deviceIndexConfig->second);
++
++ /*
++ * We found all parameters to use 'Get PMBUS Readings'
++ * method.
++ */
++ isReadMe = true;
++}
+ void createSensors(
+ boost::asio::io_service& io, sdbusplus::asio::object_server& objectServer,
+ boost::container::flat_map<std::string, std::unique_ptr<IpmbSensor>>&
+@@ -485,6 +630,8 @@ void createSensors(
+ std::move(sensorThresholds), deviceAddress,
+ hostSMbusIndex, pollRate, sensorTypeName);
+
++ sensor->setReadMethod(entry.second);
++
+ /* Initialize scale and offset value */
+ sensor->scaleVal = 1;
+ sensor->offsetVal = 0;
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0011-Fix-for-cpusensor-going-into-D-state.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0011-Fix-for-cpusensor-going-into-D-state.patch
new file mode 100644
index 000000000..cc9587bf7
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0011-Fix-for-cpusensor-going-into-D-state.patch
@@ -0,0 +1,224 @@
+From dd880b25d01c0c7e25d65930ba0d38ddd1a6ec76 Mon Sep 17 00:00:00 2001
+From: Arun Lal K M <arun.lal@intel.com>
+Date: Fri, 31 Dec 2021 13:29:56 +0000
+Subject: [PATCH] Fix for cpusensor going into D state.
+
+When PECI driver returns the error code EAGAIN, async_read_until will
+go into a keep trying again loop. As async_read_until does not handle
+EAGAIN reliably.
+
+Same issue was identified and fix for PSUSensor:
+https://github.com/openbmc/dbus-sensors/commit/bcf76717697238e380be785bd28150963ecf0e9e
+
+Fix for this is to use async_wait instead of async_read_until.
+
+Tested:
+In Intel system verified cpusensor daemon is not getting into D state
+when there is a peci error EAGAIN.
+Verified sensors are getting populated as expected when there is no PECI
+error.
+
+Signed-off-by: Arun Lal K M <arun.lal@intel.com>
+Signed-off-by: Arun P. Mohanan <arun.p.m@linux.intel.com>
+Change-Id: I52e35075e522d0ae0d99e1c893db76156e299871
+---
+ include/CPUSensor.hpp | 3 ++
+ src/CPUSensor.cpp | 119 ++++++++++++++++++++++++++----------------
+ 2 files changed, 77 insertions(+), 45 deletions(-)
+
+diff --git a/include/CPUSensor.hpp b/include/CPUSensor.hpp
+index a6fbdad..12d8788 100644
+--- a/include/CPUSensor.hpp
++++ b/include/CPUSensor.hpp
+@@ -64,9 +64,12 @@ class CPUSensor : public Sensor, public std::enable_shared_from_this<CPUSensor>
+ bool loggedInterfaceDown = false;
+ uint8_t minMaxReadCounter;
+ unsigned int scaleFactor;
++ int fd;
+ void handleResponse(const boost::system::error_code& err);
+ void checkThresholds(void) override;
+ void updateMinMaxValues(void);
++ bool initInputDev();
++ void restartRead(void);
+ };
+
+ extern boost::container::flat_map<std::string, std::shared_ptr<CPUSensor>>
+diff --git a/src/CPUSensor.cpp b/src/CPUSensor.cpp
+index de33f9b..4ced5e2 100644
+--- a/src/CPUSensor.cpp
++++ b/src/CPUSensor.cpp
+@@ -75,6 +75,7 @@ CPUSensor::CPUSensor(const std::string& path, const std::string& objectType,
+
+ // call setup always as not all sensors call setInitialProperties
+ setupPowerMatch(conn);
++ initInputDev();
+ }
+
+ // Create a dummy "not available" CPUSensor
+@@ -161,56 +162,60 @@ CPUSensor::~CPUSensor()
+ }
+ }
+
+-void CPUSensor::setupRead(void)
++bool CPUSensor::initInputDev()
+ {
+- std::weak_ptr<CPUSensor> weakRef = weak_from_this();
+-
+- if (readingStateGood())
+- {
+- inputDev.close();
+- int fd = open(path.c_str(), O_RDONLY);
+- if (fd >= 0)
+- {
+- inputDev.assign(fd);
+-
+- boost::asio::async_read_until(
+- inputDev, readBuf, '\n',
+- [weakRef](const boost::system::error_code& ec,
+- std::size_t /*bytes_transfered*/) {
+- std::shared_ptr<CPUSensor> self = weakRef.lock();
+- if (!self)
+- {
+- return;
+- }
+- self->handleResponse(ec);
+- });
+- }
+- else
+- {
+- std::cerr << name << " unable to open fd!\n";
+- pollTime = sensorFailedPollTimeMs;
+- }
+- }
+- else
++ fd = open(path.c_str(), O_RDONLY | O_NONBLOCK);
++ if (fd < 0)
+ {
+- pollTime = sensorFailedPollTimeMs;
+- markAvailable(false);
++ std::cerr << "CPU sensor failed to open file\n";
++ return false;
+ }
++
++ inputDev.assign(fd);
++ return true;
++}
++
++void CPUSensor::restartRead(void)
++{
++ std::weak_ptr<CPUSensor> weakRef = weak_from_this();
+ waitTimer.expires_from_now(boost::posix_time::milliseconds(pollTime));
+ waitTimer.async_wait([weakRef](const boost::system::error_code& ec) {
+ if (ec == boost::asio::error::operation_aborted)
+ {
+- return; // we're being canceled
++ std::cerr << "Failed to reschedule\n";
++ return;
+ }
+ std::shared_ptr<CPUSensor> self = weakRef.lock();
+- if (!self)
++
++ if (self)
+ {
+- return;
++ self->setupRead();
+ }
+- self->setupRead();
+ });
+ }
+
++void CPUSensor::setupRead(void)
++{
++ if (!readingStateGood())
++ {
++ markAvailable(false);
++ updateValue(std::numeric_limits<double>::quiet_NaN());
++ restartRead();
++ return;
++ }
++
++ std::weak_ptr<CPUSensor> weakRef = weak_from_this();
++ inputDev.async_wait(boost::asio::posix::descriptor_base::wait_read,
++ [weakRef](const boost::system::error_code& ec) {
++ std::shared_ptr<CPUSensor> self = weakRef.lock();
++
++ if (self)
++ {
++ self->handleResponse(ec);
++ }
++ });
++}
++
+ void CPUSensor::updateMinMaxValues(void)
+ {
+ double newMin = std::numeric_limits<double>::quiet_NaN();
+@@ -265,8 +270,8 @@ void CPUSensor::updateMinMaxValues(void)
+
+ void CPUSensor::handleResponse(const boost::system::error_code& err)
+ {
+-
+- if (err == boost::system::errc::bad_file_descriptor)
++ if ((err == boost::system::errc::bad_file_descriptor) ||
++ (err == boost::asio::error::misc_errors::not_found))
+ {
+ return; // we're being destroyed
+ }
+@@ -285,16 +290,35 @@ void CPUSensor::handleResponse(const boost::system::error_code& err)
+ return;
+ }
+ loggedInterfaceDown = false;
+- pollTime = CPUSensor::sensorPollMs;
+- std::istream responseStream(&readBuf);
+- if (!err)
++
++ if (err)
+ {
+- std::string response;
++ pollTime = sensorFailedPollTimeMs;
++ incrementError();
++ if (fd >= 0)
++ {
++ lseek(fd, 0, SEEK_SET);
++ }
++ return;
++ }
++
++ static constexpr uint32_t bufLen = 128;
++ std::string response;
++ response.resize(bufLen);
++ int rdLen = 0;
++
++ if (fd >= 0)
++ {
++ lseek(fd, 0, SEEK_SET);
++ rdLen = read(fd, response.data(), bufLen);
++ }
++
++ if (rdLen > 0)
++ {
++
+ try
+ {
+- std::getline(responseStream, response);
+ rawValue = std::stod(response);
+- responseStream.clear();
+ double nvalue = rawValue / scaleFactor;
+
+ if (show)
+@@ -358,7 +382,12 @@ void CPUSensor::handleResponse(const boost::system::error_code& err)
+ incrementError();
+ }
+
+- responseStream.clear();
++ if (fd >= 0)
++ {
++ lseek(fd, 0, SEEK_SET);
++ }
++
++ restartRead();
+ }
+
+ void CPUSensor::checkThresholds(void)
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0012-Serialize-cpusensor-polling.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0012-Serialize-cpusensor-polling.patch
new file mode 100644
index 000000000..4617235f1
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0012-Serialize-cpusensor-polling.patch
@@ -0,0 +1,343 @@
+From dbcdef1ba1ee2445d2a571d1fd47be256833f94b Mon Sep 17 00:00:00 2001
+From: Arun Lal K M <arun.lal@intel.com>
+Date: Fri, 31 Dec 2021 13:29:56 +0000
+Subject: [PATCH] Serialize cpusensor polling
+
+Say we have 100 cpusensor objects, there will be 100 reads made
+to peci driver. And in peci driver, if a read fails, it will keep
+trying again till timeout. Timeout is 0.7 sec.
+
+Which means, under peci error state, cpusensor daemon will
+make 100 calls to peci driver. And each of that call will take 0.7 sec.
+
+This ultimately result in io having a queue of 100 request at the same
+time. And since we only has one thread for io (and peci can only do one read
+at a time) these calls will make io nonresponsive.
+
+As io is busy:
+1) busctl tree or introspect to xyz.openbmc_project.CPUSensor will fail.
+2) phosphor-pid-control will try to get data from cpusensor,
+and after trying for 5 times, phosphor-pid-control will gracefully exit.
+
+Fix for this is to serialize the requests made to peci from cpusensor daemon.
+This is done via single poll loop for all cpu sensors using coroutine.
+This basically avoid overloading the io with flooding of requests.
+
+Also, the polling frequency of individual sensors are modified to small
+delay between 2 sensor reads.
+
+Tested:
+Negative test case: In Intel system which has peci error.
+By giving busctl tree or introspect to xyz.openbmc_project.CPUSensor
+And making sure tree is populated.
+
+Positive test case: In Intel system which does not have peci error.
+By giving command ipmitool sensor list and making sure CPU sensors
+in are showing values as expected.
+
+Signed-off-by: Arun Lal K M <arun.lal@intel.com>
+Signed-off-by: Arun P. Mohanan <arun.p.m@linux.intel.com>
+Change-Id: Id435d198d6427e3141517ea517a8fa6f946c5dd5
+---
+ .clang-tidy | 1 +
+ include/CPUSensor.hpp | 7 ++----
+ meson.build | 6 +++++
+ src/CPUSensor.cpp | 53 ++++++++++------------------------------
+ src/CPUSensorMain.cpp | 57 ++++++++++++++++++++++++++++++++++++++++++-
+ 5 files changed, 78 insertions(+), 46 deletions(-)
+
+diff --git a/.clang-tidy b/.clang-tidy
+index 13f6a4b..9d58421 100644
+--- a/.clang-tidy
++++ b/.clang-tidy
+@@ -258,4 +258,5 @@ CheckOptions:
+ - { key: readability-identifier-naming.ParameterCase, value: camelBack }
+ - { key: readability-identifier-naming.NamespaceCase, value: lower_case }
+ - { key: readability-identifier-naming.StructCase, value: CamelCase }
++ - { key: performance-unnecessary-value-param.AllowedTypes, value: 'boost::asio::yield_context' }
+
+diff --git a/include/CPUSensor.hpp b/include/CPUSensor.hpp
+index 12d8788..0ba4090 100644
+--- a/include/CPUSensor.hpp
++++ b/include/CPUSensor.hpp
+@@ -45,22 +45,20 @@ class CPUSensor : public Sensor, public std::enable_shared_from_this<CPUSensor>
+ const std::string& sensorConfiguration);
+
+ ~CPUSensor() override;
+- static constexpr unsigned int sensorPollMs = 1000;
++ static constexpr unsigned int sensorScaleFactor = 1000;
+ static constexpr size_t warnAfterErrorCount = 10;
+ static constexpr const char* labelTcontrol = "Tcontrol";
+- void setupRead(void);
++ void setupRead(boost::asio::yield_context yield);
+
+ private:
+ sdbusplus::asio::object_server& objServer;
+ boost::asio::streambuf readBuf;
+ boost::asio::posix::stream_descriptor inputDev;
+- boost::asio::deadline_timer waitTimer;
+ std::string nameTcontrol;
+ std::string path;
+ double privTcontrol;
+ double dtsOffset;
+ bool show;
+- size_t pollTime;
+ bool loggedInterfaceDown = false;
+ uint8_t minMaxReadCounter;
+ unsigned int scaleFactor;
+@@ -69,7 +67,6 @@ class CPUSensor : public Sensor, public std::enable_shared_from_this<CPUSensor>
+ void checkThresholds(void) override;
+ void updateMinMaxValues(void);
+ bool initInputDev();
+- void restartRead(void);
+ };
+
+ extern boost::container::flat_map<std::string, std::shared_ptr<CPUSensor>>
+diff --git a/meson.build b/meson.build
+index 7e8a3e6..b9dd039 100644
+--- a/meson.build
++++ b/meson.build
+@@ -43,6 +43,11 @@ sdbusplus = dependency(
+ ],
+ )
+
++boost = dependency(
++ 'boost',
++ modules: ['coroutine'],
++)
++
+ phosphor_logging_dep = dependency(
+ 'phosphor-logging',
+ fallback: ['phosphor-logging', 'phosphor_logging_dep'],
+@@ -70,6 +75,7 @@ default_deps = [
+ nlohmann_json,
+ phosphor_logging_dep,
+ sdbusplus,
++ boost,
+ ]
+
+ thresholds_a = static_library(
+diff --git a/src/CPUSensor.cpp b/src/CPUSensor.cpp
+index 4ced5e2..8c49bc5 100644
+--- a/src/CPUSensor.cpp
++++ b/src/CPUSensor.cpp
+@@ -45,10 +45,10 @@ CPUSensor::CPUSensor(const std::string& path, const std::string& objectType,
+ objectType, false, false, sensorProperties.max, sensorProperties.min,
+ conn, PowerState::on),
+ std::enable_shared_from_this<CPUSensor>(), objServer(objectServer),
+- inputDev(io), waitTimer(io), path(path),
++ inputDev(io), path(path),
+ privTcontrol(std::numeric_limits<double>::quiet_NaN()),
+- dtsOffset(dtsOffset), show(show), pollTime(CPUSensor::sensorPollMs),
+- minMaxReadCounter(0), scaleFactor(sensorProperties.scaleFactor)
++ dtsOffset(dtsOffset), show(show), minMaxReadCounter(0),
++ scaleFactor(sensorProperties.scaleFactor)
+ {
+ nameTcontrol = labelTcontrol;
+ nameTcontrol += " CPU" + std::to_string(cpuId);
+@@ -89,9 +89,9 @@ CPUSensor::CPUSensor(const std::string& objectType,
+ const std::string& sensorConfiguration) :
+ Sensor(escapeName(sensorName), std::move(thresholdsIn), sensorConfiguration,
+ objectType, false, false, 0, 0, conn, PowerState::on),
+- objServer(objectServer), inputDev(io), waitTimer(io),
++ objServer(objectServer), inputDev(io),
+ privTcontrol(std::numeric_limits<double>::quiet_NaN()), dtsOffset(0),
+- show(true), pollTime(CPUSensor::sensorPollMs), minMaxReadCounter(0)
++ show(true), minMaxReadCounter(0)
+ {
+ // assume it is a temperature sensor for now
+ // support for other type can be added later
+@@ -150,7 +150,6 @@ CPUSensor::~CPUSensor()
+ {
+ // close the input dev to cancel async operations
+ inputDev.close();
+- waitTimer.cancel();
+ if (show)
+ {
+ objServer.remove_interface(thresholdInterfaceWarning);
+@@ -175,45 +174,24 @@ bool CPUSensor::initInputDev()
+ return true;
+ }
+
+-void CPUSensor::restartRead(void)
+-{
+- std::weak_ptr<CPUSensor> weakRef = weak_from_this();
+- waitTimer.expires_from_now(boost::posix_time::milliseconds(pollTime));
+- waitTimer.async_wait([weakRef](const boost::system::error_code& ec) {
+- if (ec == boost::asio::error::operation_aborted)
+- {
+- std::cerr << "Failed to reschedule\n";
+- return;
+- }
+- std::shared_ptr<CPUSensor> self = weakRef.lock();
+-
+- if (self)
+- {
+- self->setupRead();
+- }
+- });
+-}
+-
+-void CPUSensor::setupRead(void)
++void CPUSensor::setupRead(boost::asio::yield_context yield)
+ {
+ if (!readingStateGood())
+ {
+ markAvailable(false);
+ updateValue(std::numeric_limits<double>::quiet_NaN());
+- restartRead();
+ return;
+ }
+
+ std::weak_ptr<CPUSensor> weakRef = weak_from_this();
++ boost::system::error_code ec;
+ inputDev.async_wait(boost::asio::posix::descriptor_base::wait_read,
+- [weakRef](const boost::system::error_code& ec) {
+- std::shared_ptr<CPUSensor> self = weakRef.lock();
+-
+- if (self)
+- {
+- self->handleResponse(ec);
+- }
+- });
++ yield[ec]);
++ std::shared_ptr<CPUSensor> self = weakRef.lock();
++ if (self)
++ {
++ self->handleResponse(ec);
++ }
+ }
+
+ void CPUSensor::updateMinMaxValues(void)
+@@ -284,7 +262,6 @@ void CPUSensor::handleResponse(const boost::system::error_code& err)
+ std::cerr << name << " interface down!\n";
+ loggedInterfaceDown = true;
+ }
+- pollTime = CPUSensor::sensorPollMs * 10u;
+ markFunctional(false);
+ }
+ return;
+@@ -293,7 +270,6 @@ void CPUSensor::handleResponse(const boost::system::error_code& err)
+
+ if (err)
+ {
+- pollTime = sensorFailedPollTimeMs;
+ incrementError();
+ if (fd >= 0)
+ {
+@@ -378,7 +354,6 @@ void CPUSensor::handleResponse(const boost::system::error_code& err)
+ }
+ else
+ {
+- pollTime = sensorFailedPollTimeMs;
+ incrementError();
+ }
+
+@@ -386,8 +361,6 @@ void CPUSensor::handleResponse(const boost::system::error_code& err)
+ {
+ lseek(fd, 0, SEEK_SET);
+ }
+-
+- restartRead();
+ }
+
+ void CPUSensor::checkThresholds(void)
+diff --git a/src/CPUSensorMain.cpp b/src/CPUSensorMain.cpp
+index 32cb6b3..0de6673 100644
+--- a/src/CPUSensorMain.cpp
++++ b/src/CPUSensorMain.cpp
+@@ -51,6 +51,10 @@
+ // clang-format on
+
+ static constexpr bool debug = false;
++static std::unique_ptr<boost::asio::deadline_timer> waitTimer = nullptr;
++static bool sensorMapUpdated = false;
++static constexpr unsigned int sensorPollWaitMs = 20;
++static constexpr unsigned int sensorEmptyWaitMs = 500;
+
+ boost::container::flat_map<std::string, std::shared_ptr<CPUSensor>> gCpuSensors;
+ boost::container::flat_map<std::string,
+@@ -408,7 +412,7 @@ bool createSensors(boost::asio::io_service& io,
+ inputPathStr, sensorType, objectServer, dbusConnection, io,
+ sensorName, std::move(sensorThresholds), *interfacePath, cpuId,
+ show, dtsOffset, prop);
+- sensorPtr->setupRead();
++ sensorMapUpdated = true;
+ createdSensors.insert(sensorName);
+ if (debug)
+ {
+@@ -427,6 +431,52 @@ bool createSensors(boost::asio::io_service& io,
+ return true;
+ }
+
++bool doWait(boost::asio::yield_context yield, int delay)
++{
++ boost::system::error_code ec;
++ waitTimer->expires_from_now(boost::posix_time::milliseconds(delay));
++ waitTimer->async_wait(yield[ec]);
++ if (ec == boost::asio::error::operation_aborted)
++ {
++ std::cerr << "Timer aborted\n";
++ return false;
++ }
++ if (ec)
++ {
++ std::cerr << "Timer failed\n";
++ return false;
++ }
++ return true;
++}
++
++void pollCPUSensors(boost::asio::yield_context yield)
++{
++ while (true)
++ {
++ sensorMapUpdated = false;
++ for (auto& [name, sensor] : gCpuSensors)
++ {
++ sensor->setupRead(yield);
++ if (!doWait(yield, sensorPollWaitMs))
++ {
++ throw std::runtime_error("Wait timer failed");
++ }
++ if (sensorMapUpdated)
++ {
++ break;
++ }
++ }
++
++ if (gCpuSensors.size() == 0)
++ {
++ if (!doWait(yield, sensorEmptyWaitMs))
++ {
++ throw std::runtime_error("Wait timer failed");
++ }
++ }
++ }
++}
++
+ int exportDevice(const CPUConfig& config)
+ {
+ std::ostringstream hex;
+@@ -905,6 +955,7 @@ int main()
+ boost::asio::deadline_timer pingTimer(io);
+ boost::asio::deadline_timer creationTimer(io);
+ boost::asio::deadline_timer filterTimer(io);
++ waitTimer = std::make_unique<boost::asio::deadline_timer>(io);
+ ManagedObjectType sensorConfigs;
+
+ filterTimer.expires_from_now(boost::posix_time::seconds(1));
+@@ -966,6 +1017,10 @@ int main()
+ systemBus->request_name("xyz.openbmc_project.CPUSensor");
+
+ setupManufacturingModeMatch(*systemBus);
++
++ boost::asio::spawn(
++ io, [](boost::asio::yield_context yield) { pollCPUSensors(yield); });
++
+ io.run();
+ return 0;
+ }
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0013-Add-dummy-cpu-sensor-flag.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0013-Add-dummy-cpu-sensor-flag.patch
new file mode 100644
index 000000000..01f3fda09
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0013-Add-dummy-cpu-sensor-flag.patch
@@ -0,0 +1,60 @@
+From 1429b5e9d7a1aa2b0ac9b997b56f53728f8de712 Mon Sep 17 00:00:00 2001
+From: "Arun P. Mohanan" <arun.p.m@linux.intel.com>
+Date: Thu, 3 Feb 2022 23:56:33 +0530
+Subject: [PATCH] Add dummy cpu sensor flag
+
+With updated cpu sensor logic, the setupRead() will get called for
+dummy sensors as well. This will cause cpu sensor to exit unsuccessfully.
+
+Add a flag to skip dummy sensors from polling.
+
+Tested:
+CPU sensor polling worked as expected.
+Unsuccessfull service exit issue is not observed.
+
+Signed-off-by: Arun P. Mohanan <arun.p.m@linux.intel.com>
+---
+ include/CPUSensor.hpp | 1 +
+ src/CPUSensor.cpp | 7 ++++++-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/include/CPUSensor.hpp b/include/CPUSensor.hpp
+index 0ba4090..b5921b9 100644
+--- a/include/CPUSensor.hpp
++++ b/include/CPUSensor.hpp
+@@ -63,6 +63,7 @@ class CPUSensor : public Sensor, public std::enable_shared_from_this<CPUSensor>
+ uint8_t minMaxReadCounter;
+ unsigned int scaleFactor;
+ int fd;
++ bool dummySensor = false;
+ 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 8c49bc5..7990e99 100644
+--- a/src/CPUSensor.cpp
++++ b/src/CPUSensor.cpp
+@@ -91,7 +91,7 @@ CPUSensor::CPUSensor(const std::string& objectType,
+ objectType, false, false, 0, 0, conn, PowerState::on),
+ objServer(objectServer), inputDev(io),
+ privTcontrol(std::numeric_limits<double>::quiet_NaN()), dtsOffset(0),
+- show(true), minMaxReadCounter(0)
++ show(true), minMaxReadCounter(0), dummySensor(true)
+ {
+ // assume it is a temperature sensor for now
+ // support for other type can be added later
+@@ -176,6 +176,11 @@ bool CPUSensor::initInputDev()
+
+ void CPUSensor::setupRead(boost::asio::yield_context yield)
+ {
++ if (dummySensor)
++ {
++ return;
++ }
++
+ if (!readingStateGood())
+ {
+ markAvailable(false);
+--
+2.17.1
+
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0014-Treat-zero-temperatures-readings-as-errors-in-IpmbSe.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0014-Treat-zero-temperatures-readings-as-errors-in-IpmbSe.patch
new file mode 100644
index 000000000..25b6d5cab
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/sensors/dbus-sensors/0014-Treat-zero-temperatures-readings-as-errors-in-IpmbSe.patch
@@ -0,0 +1,49 @@
+From 3659064b5ef97e78f054823657670d226bb0420e Mon Sep 17 00:00:00 2001
+From: Arun Lal K M <arun.lal@intel.com>
+Date: Thu, 10 Feb 2022 17:21:30 +0000
+Subject: [PATCH] Treat zero temperatures readings as errors in IpmbSensors
+
+During normal operations, IpmbSensors temperature sensors are not
+expected to read zero value. There might be some other root cause
+need to be identified and addressed. Treat zeros readings as errors
+in temperatures as a workaround.
+
+Tested:
+Valid temperature reading is being reported in IpmbSensors.
+By giving ipmitool sensors list command.
+
+CPU1 North VR Te | 36.000
+CPU1 PVCCD VR Te | 39.000
+CPU1 PVCCFA EHV | 37.000
+CPU1 South VR Te | 37.000
+CPU1 VCCIN VR Te | 51.000
+CPU2 North VR Te | 40.000
+CPU2 PVCCD VR Te | 43.000
+CPU2 PVCCFA EHV | 38.000
+CPU2 South VR Te | 36.000
+CPU2 VCCIN VR Te | 50.000
+
+Signed-off-by: Arun Lal K M <arun.lal@intel.com>
+---
+ src/IpmbSensor.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/IpmbSensor.cpp b/src/IpmbSensor.cpp
+index 75f74b5..e7d1ded 100644
+--- a/src/IpmbSensor.cpp
++++ b/src/IpmbSensor.cpp
+@@ -458,7 +458,10 @@ void IpmbSensor::read(void)
+
+ double value = 0;
+
+- if (!processReading(data, value))
++ // Temperature sensors are not expected to read 0
++ // treat them as errors
++ if (!processReading(data, value) ||
++ (subType == IpmbSubType::temp && value == 0.0))
+ {
+ incrementError();
+ read();
+--
+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 23a44d69a..09a2a50ed 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
@@ -15,6 +15,11 @@ SRC_URI += "\
file://0007-Add-support-for-the-energy-hwmon-type.patch \
file://0008-CPUSensor-additional-debug-message.patch \
file://0009-CPUSensor-Create-CPUConfig-for-each-PECI-adapter.patch \
+ file://0010-Add-support-for-Get-PMBUS-Readings-method.patch \
+ file://0011-Fix-for-cpusensor-going-into-D-state.patch \
+ file://0012-Serialize-cpusensor-polling.patch \
+ file://0013-Add-dummy-cpu-sensor-flag.patch \
+ file://0014-Treat-zero-temperatures-readings-as-errors-in-IpmbSe.patch \
"
DEPENDS:append = " libgpiod libmctp"
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch
index 0a8962698..0eff20be1 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/users/phosphor-user-manager/0005-Added-suport-for-multiple-user-manager-services.patch
@@ -1,4 +1,4 @@
-From d03ec9b688a5d93f8f44e775eb74358d30d9d314 Mon Sep 17 00:00:00 2001
+From 604b4c8b3f028497cbed815b27cf7f60dfb8ceab Mon Sep 17 00:00:00 2001
From: Radivoje Jovanovic <radivoje.jovanovic@intel.com>
Date: Mon, 2 Jul 2018 19:23:25 -0700
Subject: [PATCH] Added suport for multiple user manager services
@@ -9,14 +9,15 @@ Signed-off-by: Alberto Salazar Perez <alberto.salazar.perez@intel.com>
Signed-off-by: Radivoje Jovanovic <radivoje.jovanovic@intel.com>
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
Signed-off-by: Arun P. Mohanan <arun.p.m@linux.intel.com>
+Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
---
Makefile.am | 5 +-
mainapp.cpp | 90 +++++-
- user_mgr.cpp | 305 ++----------------
+ user_mgr.cpp | 299 ++----------------
user_mgr.hpp | 9 +-
- user_service.cpp | 789 +++++++++++++++++++++++++++++++++++++++++++++++
+ user_service.cpp | 793 +++++++++++++++++++++++++++++++++++++++++++++++
user_service.hpp | 233 ++++++++++++++
- 6 files changed, 1150 insertions(+), 281 deletions(-)
+ 6 files changed, 1152 insertions(+), 277 deletions(-)
create mode 100644 user_service.cpp
create mode 100644 user_service.hpp
@@ -152,7 +153,7 @@ index e08da61..f4b7f8c 100644
// Claim the bus now
bus.request_name(USER_MANAGER_BUSNAME);
diff --git a/user_mgr.cpp b/user_mgr.cpp
-index 8fc899f..acc16b0 100644
+index 8fc899f..c49fbef 100644
--- a/user_mgr.cpp
+++ b/user_mgr.cpp
@@ -18,43 +18,34 @@
@@ -281,7 +282,7 @@ index 8fc899f..acc16b0 100644
bool UserMgr::isUserExist(const std::string& userName)
{
if (userName.empty())
-@@ -299,44 +217,15 @@ void UserMgr::createUser(std::string userName,
+@@ -299,39 +217,12 @@ void UserMgr::createUser(std::string userName,
{
throwForInvalidPrivilege(priv);
throwForInvalidGroups(groupNames);
@@ -321,16 +322,9 @@ index 8fc899f..acc16b0 100644
+ // Tell the User Service to create a new user with the info provided.
+ userSrvc->createUser(userName, groupNames, priv, enabled);
-- // Add the users object before sending out the signal
-- sdbusplus::message::object_path tempObjPath(usersObjPath);
-- tempObjPath /= userName;
-- std::string userObj(tempObjPath);
-+ // Add the users to the local list before sending out the signal
-+ std::string userObj = std::string(usersObjPath) + "/" + userName;
- std::sort(groupNames.begin(), groupNames.end());
- usersList.emplace(
- userName, std::move(std::make_unique<phosphor::user::Users>(
-@@ -349,19 +238,11 @@ void UserMgr::createUser(std::string userName,
+ // Add the users object before sending out the signal
+ sdbusplus::message::object_path tempObjPath(usersObjPath);
+@@ -349,19 +240,11 @@ void UserMgr::createUser(std::string userName,
void UserMgr::deleteUser(std::string userName)
{
@@ -354,7 +348,7 @@ index 8fc899f..acc16b0 100644
usersList.erase(userName);
-@@ -372,24 +253,13 @@ void UserMgr::deleteUser(std::string userName)
+@@ -372,24 +255,13 @@ void UserMgr::deleteUser(std::string userName)
void UserMgr::renameUser(std::string userName, std::string newUserName)
{
@@ -382,7 +376,7 @@ index 8fc899f..acc16b0 100644
const auto& user = usersList[userName];
std::string priv = user.get()->userPrivilege();
std::vector<std::string> groupNames = user.get()->userGroups();
-@@ -415,8 +285,6 @@ void UserMgr::updateGroupsAndPriv(const std::string& userName,
+@@ -415,8 +287,6 @@ void UserMgr::updateGroupsAndPriv(const std::string& userName,
{
throwForInvalidPrivilege(priv);
throwForInvalidGroups(groupNames);
@@ -391,7 +385,7 @@ index 8fc899f..acc16b0 100644
throwForUserDoesNotExist(userName);
const std::vector<std::string>& oldGroupNames =
usersList[userName].get()->userGroups();
-@@ -432,29 +300,8 @@ void UserMgr::updateGroupsAndPriv(const std::string& userName,
+@@ -432,29 +302,8 @@ void UserMgr::updateGroupsAndPriv(const std::string& userName,
throwForMaxGrpUserCount(groupNames);
}
@@ -423,7 +417,7 @@ index 8fc899f..acc16b0 100644
log<level::INFO>("User groups / privilege updated successfully",
entry("USER_NAME=%s", userName.c_str()));
-@@ -650,21 +497,9 @@ int UserMgr::setPamModuleArgValue(const std::string& moduleName,
+@@ -650,21 +499,9 @@ int UserMgr::setPamModuleArgValue(const std::string& moduleName,
void UserMgr::userEnable(const std::string& userName, bool enabled)
{
@@ -447,7 +441,7 @@ index 8fc899f..acc16b0 100644
log<level::INFO>("User enabled/disabled state updated successfully",
entry("USER_NAME=%s", userName.c_str()),
-@@ -787,54 +622,8 @@ bool UserMgr::userPasswordExpired(const std::string& userName)
+@@ -787,54 +624,8 @@ bool UserMgr::userPasswordExpired(const std::string& userName)
UserSSHLists UserMgr::getUserAndSshGrpList()
{
@@ -504,7 +498,7 @@ index 8fc899f..acc16b0 100644
}
size_t UserMgr::getIpmiUsersCount()
-@@ -845,49 +634,14 @@ size_t UserMgr::getIpmiUsersCount()
+@@ -845,49 +636,14 @@ size_t UserMgr::getIpmiUsersCount()
bool UserMgr::isUserEnabled(const std::string& userName)
{
@@ -558,7 +552,7 @@ index 8fc899f..acc16b0 100644
}
DbusUserObj UserMgr::getPrivilegeMapperObject(void)
-@@ -1114,11 +868,9 @@ void UserMgr::initUserObjects(void)
+@@ -1114,11 +870,9 @@ void UserMgr::initUserObjects(void)
{
// All user management lock has to be based on /etc/shadow
// TODO phosphor-user-manager#10 phosphor::user::shadow::Lock lock{};
@@ -572,7 +566,7 @@ index 8fc899f..acc16b0 100644
if (!userNameList.empty())
{
-@@ -1175,8 +927,10 @@ void UserMgr::initUserObjects(void)
+@@ -1175,8 +929,10 @@ void UserMgr::initUserObjects(void)
}
}
@@ -585,7 +579,7 @@ index 8fc899f..acc16b0 100644
{
UserMgrIface::allPrivileges(privMgr);
std::sort(groupsMgr.begin(), groupsMgr.end());
-@@ -1284,6 +1038,7 @@ UserMgr::UserMgr(sdbusplus::bus::bus& bus, const char* path) :
+@@ -1284,6 +1040,7 @@ UserMgr::UserMgr(sdbusplus::bus::bus& bus, const char* path) :
}
AccountPolicyIface::accountUnlockTimeout(value32);
}
@@ -637,10 +631,10 @@ index f5aac22..5d5ca99 100644
"priv-user", "priv-noaccess"};
diff --git a/user_service.cpp b/user_service.cpp
new file mode 100644
-index 0000000..6e11755
+index 0000000..457f488
--- /dev/null
+++ b/user_service.cpp
-@@ -0,0 +1,789 @@
+@@ -0,0 +1,793 @@
+/*
+// Copyright (c) 2018 Intel Corporation
+//
@@ -839,10 +833,12 @@ index 0000000..6e11755
+
+ try
+ {
++ // set EXPIRE_DATE to 0 to disable user, PAM takes 0 as expire on
++ // 1970-01-01, that's an implementation-defined behavior
+ phosphor::user::executeCmd(
+ "/usr/sbin/useradd", userName.c_str(), "-G", groups.c_str(),
+ "-m", "-N", "-s", (sshRequested ? "/bin/sh" : "/bin/nologin"),
-+ "-e", (enabled ? "" : "1970-01-02"));
++ "-e", (enabled ? "" : "1970-01-01"));
+ }
+ catch (const phosphor::user::InternalFailure& e)
+ {
@@ -934,8 +930,10 @@ index 0000000..6e11755
+ // TODO phosphor-user-manager#10 phosphor::user::shadow::Lock lock{};
+ try
+ {
++ // set EXPIRE_DATE to 0 to disable user, PAM takes 0 as expire on
++ // 1970-01-01, that's an implementation-defined behavior
+ phosphor::user::executeCmd("/usr/sbin/usermod", userName.c_str(),
-+ "-e", (enabled ? "" : "1970-01-02"));
++ "-e", (enabled ? "" : "1970-01-01"));
+ }
+ catch (const phosphor::user::InternalFailure& e)
+ {
@@ -1670,5 +1668,5 @@ index 0000000..50ee4db
+} // namespace user
+} // namespace phosphor
--
-2.17.1
+2.25.1
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/virtual-media/virtual-media.bb b/meta-openbmc-mods/meta-common/recipes-phosphor/virtual-media/virtual-media.bb
index f41ae7e3a..a74260f68 100644
--- a/meta-openbmc-mods/meta-common/recipes-phosphor/virtual-media/virtual-media.bb
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/virtual-media/virtual-media.bb
@@ -2,7 +2,7 @@ SUMMARY = "Virtual Media Service"
DESCRIPTION = "Virtual Media Service"
SRC_URI = "git://git@github.com/Intel-BMC/virtual-media.git;protocol=ssh;branch=main"
-SRCREV = "6165e07cd0ef6da314ed1ef4f58fe47b7d8112db"
+SRCREV = "6df74a76eeacc5240d36fa7e62717cd1cdd238a7"
S = "${WORKDIR}/git"
PV = "1.0+git${SRCPV}"