diff --git a/patch/cisco-hwmon-pmbus_core-pec-support-check.patch b/patch/cisco-hwmon-pmbus_core-pec-support-check.patch index 3d836b9c1f64..bd6d5cedd80e 100644 --- a/patch/cisco-hwmon-pmbus_core-pec-support-check.patch +++ b/patch/cisco-hwmon-pmbus_core-pec-support-check.patch @@ -1,6 +1,6 @@ -From a3e00e49a8647ea9ba6f08a36c1bf6884f91619a Mon Sep 17 00:00:00 2001 +From 8451736f488d2e24da57a6d6d8a3880bd023812b Mon Sep 17 00:00:00 2001 From: Madhava Reddy Siddareddygari -Date: Tue, 1 Jun 2021 22:42:41 -0700 +Date: Tue, 9 Nov 2021 10:54:31 -0800 Subject: [PATCH] hwmon: (pmbus_core) Check adapter PEC support Currently, for Packet Error Checking (PEC) only the controller @@ -12,33 +12,36 @@ adapter supports it. Added code to check PEC capability for adapter and enable it only if both controller and adapter supports PEC. +This patch was applied to Linux 5.14 in commit +4e5418f787ec56d7fe3c6efee486b8f508c58baf +(hwmon: (pmbus_core) Check adapter PEC support). + Signed-off-by: Madhava Reddy Siddareddygari --- - drivers/hwmon/pmbus/pmbus_core.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) + drivers/hwmon/pmbus/pmbus_core.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c -index df4a6de24..2f98b4785 100644 +index 192442b3b..634615324 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c -@@ -2082,10 +2082,14 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data, +@@ -2203,10 +2203,12 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data, data->has_status_word = true; } - /* Enable PEC if the controller supports it */ -+ /* Enable PEC if the controller and bus supports it */ - ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY); +- ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY); - if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK)) - client->flags |= I2C_CLIENT_PEC; -+ if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK)) { -+ if (i2c_check_functionality(client->adapter, -+ I2C_FUNC_SMBUS_PEC)) { ++ /* Enable PEC if the controller and bus support it */ ++ if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_PEC)) { ++ ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY); ++ if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK)) + client->flags |= I2C_CLIENT_PEC; -+ } + } - if (data->info->pages) - pmbus_clear_faults(client); + /* + * Check if the chip is write protected. If it is, we can not clear -- -2.26.2 +2.25.1 diff --git a/patch/series b/patch/series index a74240b9e6d1..bf91d5dd2142 100755 --- a/patch/series +++ b/patch/series @@ -97,6 +97,7 @@ cisco-x86-gpio-config.patch cisco-acpi-spi-nor.patch cisco-Enable-static-memory-reservation-for-OIRable-PCIe-de.patch cisco-npu-disable-other-bars.patch +cisco-hwmon-pmbus_core-pec-support-check.patch # # Marvell platform patches for 4.19