diff --git a/patch/0001-i2c-mlxcpld-Update-module-license.patch b/patch/0001-i2c-mlxcpld-Update-module-license.patch index a80d1564d6db..e956bd44bca0 100644 --- a/patch/0001-i2c-mlxcpld-Update-module-license.patch +++ b/patch/0001-i2c-mlxcpld-Update-module-license.patch @@ -1,6 +1,7 @@ +From ff35f857e936ddd68635b390c789b203c7cbbbc2 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Thu, 10 Dec 2020 18:51:11 +0200 -Subject: 0001 i2c: mlxcpld: Update module license +Subject: [PATCH backport 5.10 001/182] i2c: mlxcpld: Update module license Update license to SPDX-License. @@ -53,5 +54,5 @@ index 71d7bae2cbca..dbd185368c38 100644 #include -- -2.17.1 +2.20.1 diff --git a/patch/0002-i2c-mlxcpld-Decrease-polling-time-for-performan.patch b/patch/0002-i2c-mlxcpld-Decrease-polling-time-for-performance-im.patch similarity index 86% rename from patch/0002-i2c-mlxcpld-Decrease-polling-time-for-performan.patch rename to patch/0002-i2c-mlxcpld-Decrease-polling-time-for-performance-im.patch index 8c5755b906a0..8335086471e6 100644 --- a/patch/0002-i2c-mlxcpld-Decrease-polling-time-for-performan.patch +++ b/patch/0002-i2c-mlxcpld-Decrease-polling-time-for-performance-im.patch @@ -1,6 +1,7 @@ +From 12fe50acf879f7552616a539e7b4a580da809a7b Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Thu, 10 Dec 2020 18:51:12 +0200 -Subject: 0002 i2c: mlxcpld: Decrease polling time for +Subject: [PATCH backport 5.10 002/182] i2c: mlxcpld: Decrease polling time for performance improvement Decrease polling time 'MLXCPLD_I2C_POLL_TIME' from 2000 usec to 400 @@ -29,5 +30,5 @@ index dbd185368c38..9e45214d1eb6 100644 /* LPC I2C registers */ #define MLXCPLD_LPCI2C_CPBLTY_REG 0x0 -- -2.17.1 +2.20.1 diff --git a/patch/0003-i2c-mlxcpld-Add-support-for-I2C-bus-frequency-s.patch b/patch/0003-i2c-mlxcpld-Add-support-for-I2C-bus-frequency-settin.patch similarity index 95% rename from patch/0003-i2c-mlxcpld-Add-support-for-I2C-bus-frequency-s.patch rename to patch/0003-i2c-mlxcpld-Add-support-for-I2C-bus-frequency-settin.patch index 4aa3589d9e01..e33c562439a6 100644 --- a/patch/0003-i2c-mlxcpld-Add-support-for-I2C-bus-frequency-s.patch +++ b/patch/0003-i2c-mlxcpld-Add-support-for-I2C-bus-frequency-settin.patch @@ -1,7 +1,8 @@ +From 70a2f64a3d7b680a509c519015e4a46b6bc15ca4 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Wed, 6 Jan 2021 01:33:47 +0200 -Subject: 0003 i2c: mlxcpld: Add support for I2C bus frequency - setting +Subject: [PATCH backport 5.10 003/182] i2c: mlxcpld: Add support for I2C bus + frequency setting Add support for I2C bus frequency setting according to the specific system capability. This capability is obtained from CPLD frequency @@ -123,5 +124,5 @@ index 9e45214d1eb6..4e0b7c2882ce 100644 } -- -2.17.1 +2.20.1 diff --git a/patch/0004-i2c-mux-mlxcpld-Update-module-license.patch b/patch/0004-i2c-mux-mlxcpld-Update-module-license.patch index ed6c12647ec0..726f12379035 100644 --- a/patch/0004-i2c-mux-mlxcpld-Update-module-license.patch +++ b/patch/0004-i2c-mux-mlxcpld-Update-module-license.patch @@ -1,6 +1,8 @@ +From 9f63205197ecd85ef2f7e0c54c4aac5f7aecc9b8 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Fri, 22 Jan 2021 21:24:56 +0200 -Subject: 0004 i2c: mux: mlxcpld: Update module license +Subject: [PATCH backport 5.10 004/182] i2c: mux: mlxcpld: Update module + license Update license to SPDX-License. @@ -55,5 +57,5 @@ index 5ed55ca4fe93..53bce81cf5c9 100644 #include -- -2.17.1 +2.20.1 diff --git a/patch/0005-i2c-mux-mlxcpld-Move-header-file-out-of-x86-rea.patch b/patch/0005-i2c-mux-mlxcpld-Move-header-file-out-of-x86-realm.patch similarity index 88% rename from patch/0005-i2c-mux-mlxcpld-Move-header-file-out-of-x86-rea.patch rename to patch/0005-i2c-mux-mlxcpld-Move-header-file-out-of-x86-realm.patch index 33c53aaea805..15ce3b5312c9 100644 --- a/patch/0005-i2c-mux-mlxcpld-Move-header-file-out-of-x86-rea.patch +++ b/patch/0005-i2c-mux-mlxcpld-Move-header-file-out-of-x86-realm.patch @@ -1,7 +1,8 @@ +From 0f351fad0a71a2b6ec4709af908e621a90649634 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Fri, 22 Jan 2021 21:24:58 +0200 -Subject: 0005 i2c: mux: mlxcpld: Move header file out of x86 - realm +Subject: [PATCH backport 5.10 005/182] i2c: mux: mlxcpld: Move header file out + of x86 realm Move out header file from include/linux/platform_data/x86/ to include/linux/platform_data/, since it does not depend on x86 @@ -35,5 +36,5 @@ similarity index 100% rename from include/linux/platform_data/x86/mlxcpld.h rename to include/linux/platform_data/mlxcpld.h -- -2.17.1 +2.20.1 diff --git a/patch/0006-i2c-mux-mlxcpld-Convert-driver-to-platform-driv.patch b/patch/0006-i2c-mux-mlxcpld-Convert-driver-to-platform-driver.patch similarity index 97% rename from patch/0006-i2c-mux-mlxcpld-Convert-driver-to-platform-driv.patch rename to patch/0006-i2c-mux-mlxcpld-Convert-driver-to-platform-driver.patch index dc8aeba9311d..0eecfd1f6c32 100644 --- a/patch/0006-i2c-mux-mlxcpld-Convert-driver-to-platform-driv.patch +++ b/patch/0006-i2c-mux-mlxcpld-Convert-driver-to-platform-driver.patch @@ -1,8 +1,8 @@ +From de8fd8e73df9249c260d174c5e55b7af6b3d11f5 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 8 Feb 2021 22:16:01 +0200 -Subject: 0006 i2c: mux: mlxcpld: Convert driver to platform - driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 - Content-Transfer-Encoding: 8bit +Subject: [PATCH backport 5.10 006/182] i2c: mux: mlxcpld: Convert driver to + platform driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -181,5 +181,5 @@ index 3d894cfb19df..b53f1479272d 100644 MODULE_AUTHOR("Michael Shych (michaels@mellanox.com)"); MODULE_DESCRIPTION("Mellanox I2C-CPLD-MUX driver"); -- -2.17.1 +2.20.1 diff --git a/patch/0007-i2c-mux-mlxcpld-Prepare-mux-selection-infrastru.patch b/patch/0007-i2c-mux-mlxcpld-Prepare-mux-selection-infrastructure.patch similarity index 93% rename from patch/0007-i2c-mux-mlxcpld-Prepare-mux-selection-infrastru.patch rename to patch/0007-i2c-mux-mlxcpld-Prepare-mux-selection-infrastructure.patch index f21617d28cca..dc2b25934043 100644 --- a/patch/0007-i2c-mux-mlxcpld-Prepare-mux-selection-infrastru.patch +++ b/patch/0007-i2c-mux-mlxcpld-Prepare-mux-selection-infrastructure.patch @@ -1,7 +1,8 @@ +From 36e27ec3550453192cdf3788a20f82d074122c58 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 8 Feb 2021 22:16:02 +0200 -Subject: 0007 i2c: mux: mlxcpld: Prepare mux selection - infrastructure for two-byte support +Subject: [PATCH backport 5.10 007/182] i2c: mux: mlxcpld: Prepare mux + selection infrastructure for two-byte support Allow to program register value zero to the mux register, which is required for word address mux register space support. @@ -84,5 +85,5 @@ index b53f1479272d..113ad84cdd94 100644 /* Create an adapter for each channel. */ for (num = 0; num < CPLD_MUX_MAX_NCHANS; num++) { -- -2.17.1 +2.20.1 diff --git a/patch/0008-i2c-mux-mlxcpld-Get-rid-of-adapter-numbers-enfo.patch b/patch/0008-i2c-mux-mlxcpld-Get-rid-of-adapter-numbers-enforceme.patch similarity index 92% rename from patch/0008-i2c-mux-mlxcpld-Get-rid-of-adapter-numbers-enfo.patch rename to patch/0008-i2c-mux-mlxcpld-Get-rid-of-adapter-numbers-enforceme.patch index a153d2427d6b..d8557be1a4db 100644 --- a/patch/0008-i2c-mux-mlxcpld-Get-rid-of-adapter-numbers-enfo.patch +++ b/patch/0008-i2c-mux-mlxcpld-Get-rid-of-adapter-numbers-enforceme.patch @@ -1,7 +1,8 @@ +From a57efb1d682024397507e3d1f21455289ae2af67 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 8 Feb 2021 22:16:03 +0200 -Subject: 0008 i2c: mux: mlxcpld: Get rid of adapter numbers - enforcement +Subject: [PATCH backport 5.10 008/182] i2c: mux: mlxcpld: Get rid of adapter + numbers enforcement Do not set the argument 'force_nr' of i2c_mux_add_adapter() routine, instead provide argument 'chan_id'. @@ -67,5 +68,5 @@ index b08dcb183fca..f3cb628bb779 100644 int sel_reg_addr; }; -- -2.17.1 +2.20.1 diff --git a/patch/0009-i2c-mux-mlxcpld-Extend-driver-to-support-word-a.patch b/patch/0009-i2c-mux-mlxcpld-Extend-driver-to-support-word-addres.patch similarity index 94% rename from patch/0009-i2c-mux-mlxcpld-Extend-driver-to-support-word-a.patch rename to patch/0009-i2c-mux-mlxcpld-Extend-driver-to-support-word-addres.patch index d616ecc9c05b..7bd99a3b5363 100644 --- a/patch/0009-i2c-mux-mlxcpld-Extend-driver-to-support-word-a.patch +++ b/patch/0009-i2c-mux-mlxcpld-Extend-driver-to-support-word-addres.patch @@ -1,7 +1,8 @@ +From 1436eab9059e8f2a137ca657cc133dd6aabfe7f0 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 8 Feb 2021 22:16:04 +0200 -Subject: 0009 i2c: mux: mlxcpld: Extend driver to support word - address space devices +Subject: [PATCH backport 5.10 009/182] i2c: mux: mlxcpld: Extend driver to + support word address space devices Extend driver to allow I2C routing control through CPLD devices with word address space. Till now only CPLD devices with byte address space @@ -111,5 +112,5 @@ index f3cb628bb779..341c7796e36b 100644 #endif /* _LINUX_I2C_MLXCPLD_H */ -- -2.17.1 +2.20.1 diff --git a/patch/0010-i2c-mux-mlxcpld-Extend-supported-mux-number.patch b/patch/0010-i2c-mux-mlxcpld-Extend-supported-mux-number.patch index c1b335ea176e..7693e62ac9e7 100644 --- a/patch/0010-i2c-mux-mlxcpld-Extend-supported-mux-number.patch +++ b/patch/0010-i2c-mux-mlxcpld-Extend-supported-mux-number.patch @@ -1,6 +1,8 @@ +From 3b78386d062ab776009356916ff5d82bd423cd8e Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 8 Feb 2021 22:16:05 +0200 -Subject: 0010 i2c: mux: mlxcpld: Extend supported mux number +Subject: [PATCH backport 5.10 010/182] i2c: mux: mlxcpld: Extend supported mux + number Allow to extend mux number supported by driver. Currently it is limited by eight, which is not enough for new coming @@ -51,5 +53,5 @@ index 10767ad4adb4..5e0672f9979b 100644 if (err) goto virt_reg_failed; -- -2.17.1 +2.20.1 diff --git a/patch/0011-i2c-mux-mlxcpld-Add-callback-to-notify-mux-crea.patch b/patch/0011-i2c-mux-mlxcpld-Add-callback-to-notify-mux-creation-.patch similarity index 91% rename from patch/0011-i2c-mux-mlxcpld-Add-callback-to-notify-mux-crea.patch rename to patch/0011-i2c-mux-mlxcpld-Add-callback-to-notify-mux-creation-.patch index 85d8c2047fd3..61d942c824dc 100644 --- a/patch/0011-i2c-mux-mlxcpld-Add-callback-to-notify-mux-crea.patch +++ b/patch/0011-i2c-mux-mlxcpld-Add-callback-to-notify-mux-creation-.patch @@ -1,7 +1,8 @@ +From d07723d636eed0ac64b2903d2e5bc92af9abfe40 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 8 Feb 2021 22:16:06 +0200 -Subject: 0011 i2c: mux: mlxcpld: Add callback to notify mux - creation completion +Subject: [PATCH backport 5.10 011/182] i2c: mux: mlxcpld: Add callback to + notify mux creation completion Add notification to inform caller that mux objects array has been created. It allows to user, invoked platform device registration for @@ -55,5 +56,5 @@ index 341c7796e36b..68f5c5a9b172 100644 #endif /* _LINUX_I2C_MLXCPLD_H */ -- -2.17.1 +2.20.1 diff --git a/patch/0012-hwmon-mlxreg-fan-Add-support-for-fan-drawers-ca.patch b/patch/0012-hwmon-mlxreg-fan-Add-support-for-fan-drawers-capabil.patch similarity index 95% rename from patch/0012-hwmon-mlxreg-fan-Add-support-for-fan-drawers-ca.patch rename to patch/0012-hwmon-mlxreg-fan-Add-support-for-fan-drawers-capabil.patch index f47cd11c0716..3ead7b7b0a2f 100644 --- a/patch/0012-hwmon-mlxreg-fan-Add-support-for-fan-drawers-ca.patch +++ b/patch/0012-hwmon-mlxreg-fan-Add-support-for-fan-drawers-capabil.patch @@ -1,7 +1,8 @@ +From 868be8beaf13aefd82d53a6aa9d5c9644652e5f4 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 22 Mar 2021 19:22:37 +0200 -Subject: 0012 hwmon: (mlxreg-fan) Add support for fan drawers - capability and present registers +Subject: [PATCH backport 5.10 012/182] hwmon: (mlxreg-fan) Add support for fan + drawers capability and present registers Add support for fan drawer's capability and present registers in order to set mapping between the fan drawers and tachometers. Some systems @@ -130,5 +131,5 @@ index bd8f5a3aaad9..89fe7b9fe26b 100644 for (i = 0; i < MLXREG_FAN_SPEED_MIN_LEVEL; i++) fan->cooling_levels[i] = MLXREG_FAN_SPEED_MIN_LEVEL; -- -2.17.1 +2.20.1 diff --git a/patch/0013-hwmon-pmbus-shrink-code-and-remove-pmbus_do_rem.patch b/patch/0013-hwmon-pmbus-shrink-code-and-remove-pmbus_do_remove.patch similarity index 98% rename from patch/0013-hwmon-pmbus-shrink-code-and-remove-pmbus_do_rem.patch rename to patch/0013-hwmon-pmbus-shrink-code-and-remove-pmbus_do_remove.patch index 110a5026de72..a33825f171cf 100644 --- a/patch/0013-hwmon-pmbus-shrink-code-and-remove-pmbus_do_rem.patch +++ b/patch/0013-hwmon-pmbus-shrink-code-and-remove-pmbus_do_remove.patch @@ -1,7 +1,7 @@ +From ab269af4b9fc3631547a09d9050b266a7b2fd113 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Mon, 26 Oct 2020 11:53:52 +0100 -Subject: 0013 hwmon: (pmbus) shrink code and remove - pmbus_do_remove() +Subject: [PATCH 13/66] hwmon: (pmbus) shrink code and remove pmbus_do_remove() The only action currently performed in pmbus_do_remove() is removing the debugfs hierarchy. We can schedule a devm action at probe time and remove @@ -150,10 +150,10 @@ index decbd07c6d6e..c7400d4f1bfa 100644 }; diff --git a/drivers/hwmon/pmbus/ibm-cffps.c b/drivers/hwmon/pmbus/ibm-cffps.c -index da261d32450d..830003fe7024 100644 +index 2fb7540ee952..d6bbbb223871 100644 --- a/drivers/hwmon/pmbus/ibm-cffps.c +++ b/drivers/hwmon/pmbus/ibm-cffps.c -@@ -623,7 +623,6 @@ static struct i2c_driver ibm_cffps_driver = { +@@ -617,7 +617,6 @@ static struct i2c_driver ibm_cffps_driver = { .of_match_table = ibm_cffps_of_match, }, .probe_new = ibm_cffps_probe, @@ -342,7 +342,7 @@ index 4b2239a6afd3..329dc851fc59 100644 }; diff --git a/drivers/hwmon/pmbus/mp2975.c b/drivers/hwmon/pmbus/mp2975.c -index a41fe06e0ad4..74060bc477cf 100644 +index 1c3e2a9453b1..60fbdb371332 100644 --- a/drivers/hwmon/pmbus/mp2975.c +++ b/drivers/hwmon/pmbus/mp2975.c @@ -758,7 +758,6 @@ static struct i2c_driver mp2975_driver = { diff --git a/patch/0015-mlxsw-core-Remove-critical-trip-points-from-the.patch b/patch/0015-mlxsw-core-Remove-critical-trip-points-from-thermal-.patch similarity index 96% rename from patch/0015-mlxsw-core-Remove-critical-trip-points-from-the.patch rename to patch/0015-mlxsw-core-Remove-critical-trip-points-from-thermal-.patch index 7c0a35232233..600339762762 100644 --- a/patch/0015-mlxsw-core-Remove-critical-trip-points-from-the.patch +++ b/patch/0015-mlxsw-core-Remove-critical-trip-points-from-thermal-.patch @@ -1,7 +1,8 @@ +From 2bea2ba313dd45240a0295de02762b2a2af2a18d Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Tue, 6 Apr 2021 15:27:33 +0300 -Subject: 0015 mlxsw: core: Remove critical trip points from - thermal zones +Subject: [PATCH backport 5.10 015/182] mlxsw: core: Remove critical trip + points from thermal zones Disable software thermal protection by removing critical trip points from all thermal zones. @@ -119,5 +120,5 @@ index ecd1856bef5e..5b37449d4b66 100644 tz->trips[trip].temp = temp; -- -2.17.1 +2.20.1 diff --git a/patch/0016-net-don-t-include-ethtool.h-from-netdevice.h.patch b/patch/0016-net-don-t-include-ethtool.h-from-netdevice.h.patch index d7d47f849030..e025e2025852 100644 --- a/patch/0016-net-don-t-include-ethtool.h-from-netdevice.h.patch +++ b/patch/0016-net-don-t-include-ethtool.h-from-netdevice.h.patch @@ -1,6 +1,8 @@ +From e8c1cb7fb9d5ab0cfcf496efa208dae75d25a789 Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Fri, 20 Nov 2020 14:50:52 -0800 -Subject: 0016 net: don't include ethtool.h from netdevice.h +Subject: [PATCH backport 5.10 016/182] net: don't include ethtool.h from + netdevice.h linux/netdevice.h is included in very many places, touching any of its dependecies causes large incremental builds. @@ -99,7 +101,7 @@ index fd5c9cbe45b1..56d34be5e797 100644 #include #include diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c -index 3f759fae81fe..76d6cee81981 100644 +index a879200eaab0..5503eb028902 100644 --- a/drivers/net/can/usb/gs_usb.c +++ b/drivers/net/can/usb/gs_usb.c @@ -9,6 +9,7 @@ @@ -123,7 +125,7 @@ index 3b2cd28f962d..6cdd9efe8df3 100644 #include "ena_netdev.h" diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h -index 926cca9a0c83..1a7148041e3d 100644 +index 6da3efa289a3..b7f7d6f66633 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h @@ -10,6 +10,8 @@ @@ -136,7 +138,7 @@ index 926cca9a0c83..1a7148041e3d 100644 #include "aq_rss.h" #include "aq_hw.h" diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h -index 92f9f7f5240b..91d45a83b67a 100644 +index 34affd1de91d..b74884e6b8c6 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -20,6 +20,7 @@ @@ -148,7 +150,7 @@ index 92f9f7f5240b..91d45a83b67a 100644 #include #include diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c -index 23b80aa171dd..a217316228f4 100644 +index 819f9df9425c..883905db21a3 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c @@ -8,6 +8,7 @@ @@ -208,7 +210,7 @@ index cd8f9a481d73..d546993bda09 100644 #include "t4vf_common.h" diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c -index 7b44769bd87c..2fb197fd3daf 100644 +index c53a04313944..458e79b8d625 100644 --- a/drivers/net/ethernet/google/gve/gve_ethtool.c +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c @@ -4,6 +4,7 @@ @@ -318,7 +320,7 @@ index 28bfe1ea9d94..131b2a53d261 100644 #include #include diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c -index e95c09dc2c30..81b22520ba78 100644 +index cb12d0171517..209ebe3f2569 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -1,6 +1,7 @@ @@ -354,7 +356,7 @@ index 2adcf24848a4..ab1e0fcccabb 100644 #include #include "rmnet_config.h" diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c -index 5ddb2dbb8572..e2e58493e115 100644 +index 081939cb420b..c339cf5339da 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -7,6 +7,7 @@ @@ -366,7 +368,7 @@ index 5ddb2dbb8572..e2e58493e115 100644 #include #include diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c -index 261e6e55a907..d17bbc75f5e7 100644 +index f2020be43cfe..2548a40dc5d2 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -10,6 +10,7 @@ @@ -413,7 +415,7 @@ index afb119f38325..5e19a6839dea 100644 #include #include diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c -index 615f3776b4be..6d308183c25f 100644 +index 7117d559a32e..af1977e6c307 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @@ -4,6 +4,7 @@ @@ -497,7 +499,7 @@ index ace4a6d28562..ad55cd738847 100644 static struct { diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index 861f2480c457..71fea53dacc9 100644 +index ef75567efd27..c70027ea28a2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -34,7 +34,6 @@ @@ -565,7 +567,7 @@ index ac6ffa561884..48c4503c16de 100644 #include #include diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c -index a31334b92be7..2a3ade22d34b 100644 +index eaa030e2ad55..d8816ae47015 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -46,6 +46,7 @@ @@ -589,7 +591,7 @@ index 2eaac2ff380f..459cc240eda9 100644 #include #include diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c -index 806babdd838d..9d4d9e8ecfdd 100644 +index 7f33b31c7b8b..360e24afd9b1 100644 --- a/net/sched/sch_taprio.c +++ b/net/sched/sch_taprio.c @@ -6,6 +6,7 @@ @@ -601,7 +603,7 @@ index 806babdd838d..9d4d9e8ecfdd 100644 #include #include diff --git a/net/socket.c b/net/socket.c -index d52c265ad449..6415983cf5b6 100644 +index 8657112a687a..eceffde4e0f1 100644 --- a/net/socket.c +++ b/net/socket.c @@ -52,6 +52,7 @@ @@ -613,5 +615,5 @@ index d52c265ad449..6415983cf5b6 100644 #include #include -- -2.17.1 +2.20.1 diff --git a/patch/0017-mlxsw-reg-Extend-MTMP-register-with-new-thresho.patch b/patch/0017-mlxsw-reg-Extend-MTMP-register-with-new-threshold-fi.patch similarity index 97% rename from patch/0017-mlxsw-reg-Extend-MTMP-register-with-new-thresho.patch rename to patch/0017-mlxsw-reg-Extend-MTMP-register-with-new-threshold-fi.patch index 33d976b7165f..7aefcf08f7b8 100644 --- a/patch/0017-mlxsw-reg-Extend-MTMP-register-with-new-thresho.patch +++ b/patch/0017-mlxsw-reg-Extend-MTMP-register-with-new-threshold-fi.patch @@ -1,7 +1,8 @@ +From 91f0e76459d7a0e3156e7427d6ad347d345e2909 Mon Sep 17 00:00:00 2001 From: Mykola Kostenok Date: Tue, 8 Jun 2021 15:44:11 +0300 -Subject: 0017 mlxsw: reg: Extend MTMP register with new - threshold field +Subject: [PATCH backport 5.10 017/182] mlxsw: reg: Extend MTMP register with + new threshold field Extend Management Temperature (MTMP) register with new field specifying the maximum temperature threshold. @@ -143,5 +144,5 @@ index c670bf3464c2..dfcde953174c 100644 mlxsw_reg_mtmp_sensor_name_memcpy_from(payload, sensor_name); } -- -2.17.1 +2.20.1 diff --git a/patch/0018-mlxsw-thermal-Add-function-for-reading-module-t.patch b/patch/0018-mlxsw-thermal-Add-function-for-reading-module-temper.patch similarity index 94% rename from patch/0018-mlxsw-thermal-Add-function-for-reading-module-t.patch rename to patch/0018-mlxsw-thermal-Add-function-for-reading-module-temper.patch index ca19465aa553..859469331612 100644 --- a/patch/0018-mlxsw-thermal-Add-function-for-reading-module-t.patch +++ b/patch/0018-mlxsw-thermal-Add-function-for-reading-module-temper.patch @@ -1,7 +1,8 @@ +From 890ffa911705403d5f56ec57bf92f74b65758c87 Mon Sep 17 00:00:00 2001 From: Mykola Kostenok Date: Tue, 8 Jun 2021 15:44:13 +0300 -Subject: 0018 mlxsw: thermal: Add function for reading module - temperature and thresholds +Subject: [PATCH backport 5.10 018/182] mlxsw: thermal: Add function for + reading module temperature and thresholds Provide new function mlxsw_thermal_module_temp_and_thresholds_get() for reading temperature and temperature thresholds by a single operation. @@ -90,5 +91,5 @@ index a1025177c6ae..abbe02546164 100644 if (!temp) -- -2.17.1 +2.20.1 diff --git a/patch/0019-mlxsw-thermal-Read-module-temperature-threshold.patch b/patch/0019-mlxsw-thermal-Read-module-temperature-thresholds-usi.patch similarity index 96% rename from patch/0019-mlxsw-thermal-Read-module-temperature-threshold.patch rename to patch/0019-mlxsw-thermal-Read-module-temperature-thresholds-usi.patch index 72cf6d31c167..1c9c57a16609 100644 --- a/patch/0019-mlxsw-thermal-Read-module-temperature-threshold.patch +++ b/patch/0019-mlxsw-thermal-Read-module-temperature-thresholds-usi.patch @@ -1,7 +1,8 @@ +From 5e6f570de0f814bd843fdc5b36251538bdf7405f Mon Sep 17 00:00:00 2001 From: Mykola Kostenok Date: Tue, 8 Jun 2021 15:44:14 +0300 -Subject: 0019 mlxsw: thermal: Read module temperature thresholds - using MTMP register +Subject: [PATCH backport 5.10 019/182] mlxsw: thermal: Read module temperature + thresholds using MTMP register mlxsw_thermal_module_trips_update() is used to update the trip points of the module's thermal zone. Currently, this is done by querying the @@ -127,5 +128,5 @@ index abbe02546164..1f9ae663e133 100644 static void mlxsw_thermal_module_fini(struct mlxsw_thermal_module *module_tz) -- -2.17.1 +2.20.1 diff --git a/patch/0020-mlxsw-thermal-Fix-null-dereference-of-NULL-temp.patch b/patch/0020-mlxsw-thermal-Fix-null-dereference-of-NULL-temperatu.patch similarity index 91% rename from patch/0020-mlxsw-thermal-Fix-null-dereference-of-NULL-temp.patch rename to patch/0020-mlxsw-thermal-Fix-null-dereference-of-NULL-temperatu.patch index 383489edb17b..c6037026520d 100644 --- a/patch/0020-mlxsw-thermal-Fix-null-dereference-of-NULL-temp.patch +++ b/patch/0020-mlxsw-thermal-Fix-null-dereference-of-NULL-temperatu.patch @@ -1,7 +1,8 @@ +From d64eceef0d6b71a60ba6d5981463c639c89b2cce Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 9 Jun 2021 18:56:57 +0100 -Subject: 0020 mlxsw: thermal: Fix null dereference of NULL - temperature parameter +Subject: [PATCH backport 5.10 020/182] mlxsw: thermal: Fix null dereference of + NULL temperature parameter The call to mlxsw_thermal_module_temp_and_thresholds_get passes a NULL pointer for the temperature and this can be dereferenced in this function @@ -40,5 +41,5 @@ index 1f9ae663e133..b29824448aa8 100644 /* Update trip point according to the module data. */ return mlxsw_thermal_module_trips_update(dev, core, module_tz, -- -2.17.1 +2.20.1 diff --git a/patch/0021-mlxsw-reg-Add-bank-number-to-MCIA-register.patch b/patch/0021-mlxsw-reg-Add-bank-number-to-MCIA-register.patch index b7e4b71597be..a7791538347c 100644 --- a/patch/0021-mlxsw-reg-Add-bank-number-to-MCIA-register.patch +++ b/patch/0021-mlxsw-reg-Add-bank-number-to-MCIA-register.patch @@ -1,6 +1,8 @@ +From 4fb08df650df57f76a7bbe71a6e9e6e9e0b447e9 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Mon, 21 Jun 2021 10:50:39 +0300 -Subject: 0021 mlxsw: reg: Add bank number to MCIA register +Subject: [PATCH backport 5.10 021/182] mlxsw: reg: Add bank number to MCIA + register Add bank number to MCIA (Management Cable Info Access) register in order to allow access to banked pages on EEPROMs using CMIS (Common Management @@ -31,5 +33,5 @@ index dfcde953174c..d9b5cfb939f0 100644 * Number of bytes to read/write (up to 48 bytes). * Access: RW -- -2.17.1 +2.20.1 diff --git a/patch/0022-mlxsw-reg-Document-possible-MCIA-status-values.patch b/patch/0022-mlxsw-reg-Document-possible-MCIA-status-values.patch index 4a7c91a3b8e4..2aae853fab3c 100644 --- a/patch/0022-mlxsw-reg-Document-possible-MCIA-status-values.patch +++ b/patch/0022-mlxsw-reg-Document-possible-MCIA-status-values.patch @@ -1,6 +1,8 @@ +From 40d91f6687efb9d0f12e1b5a00e0260032255047 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Mon, 21 Jun 2021 10:50:40 +0300 -Subject: 0022 mlxsw: reg: Document possible MCIA status values +Subject: [PATCH backport 5.10 022/182] mlxsw: reg: Document possible MCIA + status values Will be used to emit meaningful messages to user space via extack in a subsequent patch. @@ -38,5 +40,5 @@ index d9b5cfb939f0..04f0c96c8068 100644 * Module status. * Access: RO -- -2.17.1 +2.20.1 diff --git a/patch/0023-ethtool-Allow-network-drivers-to-dump-arbitrary.patch b/patch/0023-ethtool-Allow-network-drivers-to-dump-arbitrary-EEPR.patch similarity index 99% rename from patch/0023-ethtool-Allow-network-drivers-to-dump-arbitrary.patch rename to patch/0023-ethtool-Allow-network-drivers-to-dump-arbitrary-EEPR.patch index 8d867ad6899c..c83c0a0439b6 100644 --- a/patch/0023-ethtool-Allow-network-drivers-to-dump-arbitrary.patch +++ b/patch/0023-ethtool-Allow-network-drivers-to-dump-arbitrary-EEPR.patch @@ -1,7 +1,8 @@ +From fb781e6c43371a263caf5dd3ab4d43f5dc7eeb76 Mon Sep 17 00:00:00 2001 From: Vladyslav Tarasiuk Date: Fri, 9 Apr 2021 11:06:34 +0300 -Subject: 0023 ethtool: Allow network drivers to dump arbitrary - EEPROM data +Subject: [PATCH backport 5.10 023/182] ethtool: Allow network drivers to dump + arbitrary EEPROM data Define get_module_eeprom_by_page() ethtool callback and implement netlink infrastructure. @@ -510,5 +511,5 @@ index 979dee6bb88c..4a07fc93c5cc 100644 int ethnl_set_linkinfo(struct sk_buff *skb, struct genl_info *info); int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info); -- -2.17.1 +2.20.1 diff --git a/patch/0024-net-ethtool-Export-helpers-for-getting-EEPROM-i.patch b/patch/0024-net-ethtool-Export-helpers-for-getting-EEPROM-info.patch similarity index 94% rename from patch/0024-net-ethtool-Export-helpers-for-getting-EEPROM-i.patch rename to patch/0024-net-ethtool-Export-helpers-for-getting-EEPROM-info.patch index 4f7230f48ed2..8bf61f94c6b9 100644 --- a/patch/0024-net-ethtool-Export-helpers-for-getting-EEPROM-i.patch +++ b/patch/0024-net-ethtool-Export-helpers-for-getting-EEPROM-info.patch @@ -1,7 +1,8 @@ +From a7f17fca2ddb48f6f4505a17a68e8014ffe52af2 Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Fri, 9 Apr 2021 11:06:38 +0300 -Subject: 0024 net: ethtool: Export helpers for getting EEPROM - info +Subject: [PATCH backport 5.10 024/182] net: ethtool: Export helpers for + getting EEPROM info There are two ways to retrieve information from SFP EEPROMs. Many devices make use of the common code, and assign the sfp_bus pointer in @@ -83,5 +84,5 @@ index 80d2a00d3097..3aee0a25e443 100644 } -- -2.17.1 +2.20.1 diff --git a/patch/0025-ethtool-Add-fallback-to-get_module_eeprom-from-.patch b/patch/0025-ethtool-Add-fallback-to-get_module_eeprom-from-netli.patch similarity index 93% rename from patch/0025-ethtool-Add-fallback-to-get_module_eeprom-from-.patch rename to patch/0025-ethtool-Add-fallback-to-get_module_eeprom-from-netli.patch index 6ddf835c2433..4a360a70ad7b 100644 --- a/patch/0025-ethtool-Add-fallback-to-get_module_eeprom-from-.patch +++ b/patch/0025-ethtool-Add-fallback-to-get_module_eeprom-from-netli.patch @@ -1,7 +1,8 @@ +From cc57dbcfd101433cdb7238aa6640d83faacaa9f0 Mon Sep 17 00:00:00 2001 From: Vladyslav Tarasiuk Date: Fri, 9 Apr 2021 11:06:39 +0300 -Subject: 0025 ethtool: Add fallback to get_module_eeprom from - netlink command +Subject: [PATCH backport 5.10 025/182] ethtool: Add fallback to + get_module_eeprom from netlink command In case netlink get_module_eeprom_by_page() callback is not implemented by the driver, try to call old get_module_info() and get_module_eeprom() @@ -96,5 +97,5 @@ index 8536dd905da5..1a49c133d401 100644 page_data.offset = request->offset; page_data.length = request->length; -- -2.17.1 +2.20.1 diff --git a/patch/0026-mlxsw-core-Add-support-for-module-EEPROM-read-b.patch b/patch/0026-mlxsw-core-Add-support-for-module-EEPROM-read-by-pag.patch similarity index 97% rename from patch/0026-mlxsw-core-Add-support-for-module-EEPROM-read-b.patch rename to patch/0026-mlxsw-core-Add-support-for-module-EEPROM-read-by-pag.patch index e61dbc27ee70..0c74eda54296 100644 --- a/patch/0026-mlxsw-core-Add-support-for-module-EEPROM-read-b.patch +++ b/patch/0026-mlxsw-core-Add-support-for-module-EEPROM-read-by-pag.patch @@ -1,7 +1,8 @@ +From 37a0a27a7d38597e4b60b4ff483a20a2cdfeaac6 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Mon, 21 Jun 2021 10:50:41 +0300 -Subject: 0026 mlxsw: core: Add support for module EEPROM read by - page +Subject: [PATCH backport 5.10 026/182] mlxsw: core: Add support for module + EEPROM read by page Add support for ethtool_ops::get_module_eeprom_by_page() which allows user space to read transceiver module EEPROM based on passed parameters. @@ -228,5 +229,5 @@ index 68333ecf6151..369b9d0dc5d4 100644 struct mlxsw_sp1_port_link_mode { -- -2.17.1 +2.20.1 diff --git a/patch/0027-ethtool-Decrease-size-of-module-EEPROM-get-poli.patch b/patch/0027-ethtool-Decrease-size-of-module-EEPROM-get-policy-ar.patch similarity index 87% rename from patch/0027-ethtool-Decrease-size-of-module-EEPROM-get-poli.patch rename to patch/0027-ethtool-Decrease-size-of-module-EEPROM-get-policy-ar.patch index d42905f3ce60..51e2b23f5820 100644 --- a/patch/0027-ethtool-Decrease-size-of-module-EEPROM-get-poli.patch +++ b/patch/0027-ethtool-Decrease-size-of-module-EEPROM-get-policy-ar.patch @@ -1,7 +1,8 @@ +From 9de352f9a4b7575e8934eb000b1cf388520020e5 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Tue, 22 Jun 2021 09:50:48 +0300 -Subject: 0027 ethtool: Decrease size of module EEPROM get policy - array +Subject: [PATCH backport 5.10 027/182] ethtool: Decrease size of module EEPROM + get policy array The 'ETHTOOL_A_MODULE_EEPROM_DATA' attribute is not part of the get request. @@ -26,5 +27,5 @@ index 4a07fc93c5cc..28dbd582c860 100644 int ethnl_set_linkinfo(struct sk_buff *skb, struct genl_info *info); int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info); -- -2.17.1 +2.20.1 diff --git a/patch/0028-ethtool-Use-kernel-data-types-for-internal-EEPR.patch b/patch/0028-ethtool-Use-kernel-data-types-for-internal-EEPROM-st.patch similarity index 83% rename from patch/0028-ethtool-Use-kernel-data-types-for-internal-EEPR.patch rename to patch/0028-ethtool-Use-kernel-data-types-for-internal-EEPROM-st.patch index fda463efec26..39c905997a11 100644 --- a/patch/0028-ethtool-Use-kernel-data-types-for-internal-EEPR.patch +++ b/patch/0028-ethtool-Use-kernel-data-types-for-internal-EEPROM-st.patch @@ -1,7 +1,8 @@ +From e6b7a06472dd05d7eb4d8daec023534223e6772f Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Tue, 22 Jun 2021 09:50:50 +0300 -Subject: 0028 ethtool: Use kernel data types for internal EEPROM - struct +Subject: [PATCH backport 5.10 028/182] ethtool: Use kernel data types for + internal EEPROM struct The struct is not visible to user space and therefore should not use the user visible data types. @@ -38,5 +39,5 @@ index 4d199de36e02..dbabd804b2cb 100644 /** -- -2.17.1 +2.20.1 diff --git a/patch/0029-ethtool-Validate-module-EEPROM-length-as-part-o.patch b/patch/0029-ethtool-Validate-module-EEPROM-length-as-part-of-pol.patch similarity index 91% rename from patch/0029-ethtool-Validate-module-EEPROM-length-as-part-o.patch rename to patch/0029-ethtool-Validate-module-EEPROM-length-as-part-of-pol.patch index f34cd7953b52..a383cc9c4013 100644 --- a/patch/0029-ethtool-Validate-module-EEPROM-length-as-part-o.patch +++ b/patch/0029-ethtool-Validate-module-EEPROM-length-as-part-of-pol.patch @@ -1,7 +1,8 @@ +From fcd35def3bc31428ecc63e8c5f2e8c3c7b61ba9f Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Tue, 22 Jun 2021 09:50:51 +0300 -Subject: 0029 ethtool: Validate module EEPROM length as part of - policy +Subject: [PATCH backport 5.10 029/182] ethtool: Validate module EEPROM length + as part of policy Validate the number of bytes to read from the module EEPROM as part of the netlink policy and remove the corresponding check from the code. @@ -44,5 +45,5 @@ index 1a49c133d401..a08fc04bcfd2 100644 [ETHTOOL_A_MODULE_EEPROM_BANK] = { .type = NLA_U8 }, [ETHTOOL_A_MODULE_EEPROM_I2C_ADDRESS] = -- -2.17.1 +2.20.1 diff --git a/patch/0030-ethtool-Validate-module-EEPROM-offset-as-part-o.patch b/patch/0030-ethtool-Validate-module-EEPROM-offset-as-part-of-pol.patch similarity index 91% rename from patch/0030-ethtool-Validate-module-EEPROM-offset-as-part-o.patch rename to patch/0030-ethtool-Validate-module-EEPROM-offset-as-part-of-pol.patch index 444f6b98becc..20c0ded341bc 100644 --- a/patch/0030-ethtool-Validate-module-EEPROM-offset-as-part-o.patch +++ b/patch/0030-ethtool-Validate-module-EEPROM-offset-as-part-of-pol.patch @@ -1,7 +1,8 @@ +From 51dcef46e453de30ef187afd4e7086d3af2ea432 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Tue, 22 Jun 2021 09:50:52 +0300 -Subject: 0030 ethtool: Validate module EEPROM offset as part of - policy +Subject: [PATCH backport 5.10 030/182] ethtool: Validate module EEPROM offset + as part of policy Validate the offset to read from module EEPROM as part of the netlink policy and remove the corresponding check from the code. @@ -45,5 +46,5 @@ index a08fc04bcfd2..937c08902c71 100644 NLA_POLICY_RANGE(NLA_U32, 1, ETH_MODULE_EEPROM_PAGE_LEN), [ETHTOOL_A_MODULE_EEPROM_PAGE] = { .type = NLA_U8 }, -- -2.17.1 +2.20.1 diff --git a/patch/0031-mlxsw-core_env-Read-module-temperature-threshol.patch b/patch/0031-mlxsw-core_env-Read-module-temperature-thresholds-us.patch similarity index 93% rename from patch/0031-mlxsw-core_env-Read-module-temperature-threshol.patch rename to patch/0031-mlxsw-core_env-Read-module-temperature-thresholds-us.patch index 520efd6a9e5e..693e3a0be258 100644 --- a/patch/0031-mlxsw-core_env-Read-module-temperature-threshol.patch +++ b/patch/0031-mlxsw-core_env-Read-module-temperature-thresholds-us.patch @@ -1,7 +1,8 @@ +From b99eea2d9ce7ba73de38b82a7ed2057a777d4893 Mon Sep 17 00:00:00 2001 From: Mykola Kostenok Date: Tue, 8 Jun 2021 15:44:12 +0300 -Subject: 0031 mlxsw: core_env: Read module temperature - thresholds using MTMP register +Subject: [PATCH backport 5.10 031/182] mlxsw: core_env: Read module + temperature thresholds using MTMP register Currently, module temperature thresholds are obtained from Management Cable Info Access (MCIA) register by specifying the thresholds offsets @@ -69,5 +70,5 @@ index db85923547b0..4a0dbdb6730b 100644 * (MSB at lower byte address). * Bytes: -- -2.17.1 +2.20.1 diff --git a/patch/0032-mlxsw-core_env-Avoid-unnecessary-memcpy-s.patch b/patch/0032-mlxsw-core_env-Avoid-unnecessary-memcpy-s.patch index 44f21c884d5b..8e4ab4ac2c9d 100644 --- a/patch/0032-mlxsw-core_env-Avoid-unnecessary-memcpy-s.patch +++ b/patch/0032-mlxsw-core_env-Avoid-unnecessary-memcpy-s.patch @@ -1,6 +1,8 @@ +From 3aed771d128c6c2789da04ec0d09f11688d17855 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Thu, 24 Jun 2021 22:47:24 +0300 -Subject: 0032 mlxsw: core_env: Avoid unnecessary memcpy()s +Subject: [PATCH backport 5.10 032/182] mlxsw: core_env: Avoid unnecessary + memcpy()s Simply get a pointer to the data in the register payload instead of copying it to a temporary buffer. @@ -98,5 +100,5 @@ index 4a0dbdb6730b..3713c45cfa1e 100644 bytes_read += size; } -- -2.17.1 +2.20.1 diff --git a/patch/0035-hwmon-pmbus-Increase-maximum-number-of-phases-p.patch b/patch/0035-hwmon-pmbus-Increase-maximum-number-of-phases-per-pa.patch similarity index 76% rename from patch/0035-hwmon-pmbus-Increase-maximum-number-of-phases-p.patch rename to patch/0035-hwmon-pmbus-Increase-maximum-number-of-phases-per-pa.patch index a6852dbf4b76..8c567981f9ff 100644 --- a/patch/0035-hwmon-pmbus-Increase-maximum-number-of-phases-p.patch +++ b/patch/0035-hwmon-pmbus-Increase-maximum-number-of-phases-per-pa.patch @@ -1,7 +1,8 @@ +From 9a37a1e841f05b5a2f35728c6531411335c8db00 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Tue, 11 May 2021 08:56:17 +0300 -Subject: 0035 hwmon: (pmbus) Increase maximum number of phases - per page +Subject: [PATCH backport 5.10 035/182] hwmon: (pmbus) Increase maximum number + of phases per page Increase maximum number of phases from 8 to 10 to support multi-phase devices allowing up to 10 phases. @@ -14,10 +15,10 @@ Signed-off-by: Guenter Roeck 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h -index 4c30ec89f5bf..fd43873011a4 100644 +index c88ac5fd91f0..cb6dbe29c0bf 100644 --- a/drivers/hwmon/pmbus/pmbus.h +++ b/drivers/hwmon/pmbus/pmbus.h -@@ -375,7 +375,7 @@ enum pmbus_sensor_classes { +@@ -376,7 +376,7 @@ enum pmbus_sensor_classes { }; #define PMBUS_PAGES 32 /* Per PMBus specification */ @@ -27,5 +28,5 @@ index 4c30ec89f5bf..fd43873011a4 100644 /* Functionality bit mask */ #define PMBUS_HAVE_VIN BIT(0) -- -2.17.1 +2.20.1 diff --git a/patch/0036-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2.patch b/patch/0036-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2888-c.patch similarity index 100% rename from patch/0036-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2.patch rename to patch/0036-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2888-c.patch diff --git a/patch/0037-dt-bindings-Add-MP2888-voltage-regulator-device.patch b/patch/0037-dt-bindings-Add-MP2888-voltage-regulator-device.patch index 071816a039f1..e29b37ab6ccf 100644 --- a/patch/0037-dt-bindings-Add-MP2888-voltage-regulator-device.patch +++ b/patch/0037-dt-bindings-Add-MP2888-voltage-regulator-device.patch @@ -1,6 +1,8 @@ +From f5c7f2a6c2443f8991fef683ad7bd8b2cddf5415 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Tue, 11 May 2021 08:56:19 +0300 -Subject: 0037 dt-bindings: Add MP2888 voltage regulator device +Subject: [PATCH backport 5.10 037/182] dt-bindings: Add MP2888 voltage + regulator device Monolithic Power Systems, Inc. (MPS) dual-loop, digital, multi-phase controller. @@ -27,5 +29,5 @@ index ab623ba930d5..52bc54b2d723 100644 - mps,mp2975 # G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface -- -2.17.1 +2.20.1 diff --git a/patch/0038-ethtool-wire-in-generic-SFP-module-access.patch b/patch/0038-ethtool-wire-in-generic-SFP-module-access.patch index c4e982085046..21d2a7accc5e 100644 --- a/patch/0038-ethtool-wire-in-generic-SFP-module-access.patch +++ b/patch/0038-ethtool-wire-in-generic-SFP-module-access.patch @@ -1,6 +1,8 @@ +From 0d7b7f6e65905dbfcda016e81987587cd19bc3a4 Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Fri, 9 Apr 2021 11:06:41 +0300 -Subject: 0038 ethtool: wire in generic SFP module access +Subject: [PATCH backport 5.10 038/182] ethtool: wire in generic SFP module + access If the device has a sfp bus attached, call its sfp_get_module_eeprom_by_page() function, otherwise use the ethtool op @@ -77,5 +79,5 @@ index 937c08902c71..d0a5484ec423 100644 } -- -2.17.1 +2.20.1 diff --git a/patch/0039-ethtool-Fix-NULL-pointer-dereference-during-mod.patch b/patch/0039-ethtool-Fix-NULL-pointer-dereference-during-module-E.patch similarity index 89% rename from patch/0039-ethtool-Fix-NULL-pointer-dereference-during-mod.patch rename to patch/0039-ethtool-Fix-NULL-pointer-dereference-during-module-E.patch index fff08a23a58a..915fa7178ca4 100644 --- a/patch/0039-ethtool-Fix-NULL-pointer-dereference-during-mod.patch +++ b/patch/0039-ethtool-Fix-NULL-pointer-dereference-during-module-E.patch @@ -1,7 +1,8 @@ +From 0802cc637330e62a5db45bb3cfaa4d92f1df9a14 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Sun, 6 Jun 2021 17:24:22 +0300 -Subject: 0039 ethtool: Fix NULL pointer dereference during - module EEPROM dump +Subject: [PATCH backport 5.10 039/182] ethtool: Fix NULL pointer dereference + during module EEPROM dump When get_module_eeprom_by_page() is not implemented by the driver, NULL pointer dereference can occur [1]. @@ -49,5 +50,5 @@ index d0a5484ec423..7e6b37a54add 100644 return -EOPNOTSUPP; -- -2.17.1 +2.20.1 diff --git a/patch/0040-phy-sfp-add-netlink-SFP-support-to-generic-SFP-.patch b/patch/0040-phy-sfp-add-netlink-SFP-support-to-generic-SFP-code.patch similarity index 91% rename from patch/0040-phy-sfp-add-netlink-SFP-support-to-generic-SFP-.patch rename to patch/0040-phy-sfp-add-netlink-SFP-support-to-generic-SFP-code.patch index 4eb809412530..edb898e854a4 100644 --- a/patch/0040-phy-sfp-add-netlink-SFP-support-to-generic-SFP-.patch +++ b/patch/0040-phy-sfp-add-netlink-SFP-support-to-generic-SFP-code.patch @@ -1,7 +1,8 @@ +From 8d067ab81436b720438e85423718bdb590092a2a Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Fri, 9 Apr 2021 11:06:40 +0300 -Subject: 0040 phy: sfp: add netlink SFP support to generic SFP - code +Subject: [PATCH backport 5.10 040/182] phy: sfp: add netlink SFP support to + generic SFP code The new netlink API for reading SFP data requires a new op to be implemented. The idea of the new netlink SFP code is that userspace is @@ -25,10 +26,10 @@ Signed-off-by: David S. Miller 4 files changed, 58 insertions(+) diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c -index a05d8372669c..30119f175781 100644 +index 850915a37f4c..d973110c2868 100644 --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c -@@ -538,6 +538,26 @@ int sfp_get_module_eeprom(struct sfp_bus *bus, struct ethtool_eeprom *ee, +@@ -544,6 +544,26 @@ int sfp_get_module_eeprom(struct sfp_bus *bus, struct ethtool_eeprom *ee, } EXPORT_SYMBOL_GPL(sfp_get_module_eeprom); @@ -56,10 +57,10 @@ index a05d8372669c..30119f175781 100644 * sfp_upstream_start() - Inform the SFP that the network device is up * @bus: a pointer to the &struct sfp_bus structure for the sfp module diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c -index efffa65f8214..817c74d476e5 100644 +index dcbe278086dc..cc171c0087db 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c -@@ -2295,6 +2295,30 @@ static int sfp_module_eeprom(struct sfp *sfp, struct ethtool_eeprom *ee, +@@ -2302,6 +2302,30 @@ static int sfp_module_eeprom(struct sfp *sfp, struct ethtool_eeprom *ee, return 0; } @@ -90,7 +91,7 @@ index efffa65f8214..817c74d476e5 100644 static const struct sfp_socket_ops sfp_module_ops = { .attach = sfp_attach, .detach = sfp_detach, -@@ -2302,6 +2326,7 @@ static const struct sfp_socket_ops sfp_module_ops = { +@@ -2309,6 +2333,7 @@ static const struct sfp_socket_ops sfp_module_ops = { .stop = sfp_stop, .module_info = sfp_module_info, .module_eeprom = sfp_module_eeprom, @@ -141,5 +142,5 @@ index 38893e4dd0f0..302094b855fb 100644 { } -- -2.17.1 +2.20.1 diff --git a/patch/0042-ethtool-support-FEC-settings-over-netlink.patch b/patch/0042-ethtool-support-FEC-settings-over-netlink.patch index 9ca71c81e267..9f068e85cc75 100644 --- a/patch/0042-ethtool-support-FEC-settings-over-netlink.patch +++ b/patch/0042-ethtool-support-FEC-settings-over-netlink.patch @@ -1,6 +1,8 @@ +From f2b51f5d52f45a147feb6a5a8d05695849d19d46 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Thu, 8 Jul 2021 06:46:53 +0000 -Subject: 0042 ethtool: support FEC settings over netlink +Subject: [PATCH backport 5.10 042/182] ethtool: support FEC settings over + netlink Backport from upstream commit 1e5d1f69d9fb8ea0679f9e85915e8e7fdacfbe7a Added in order to align UAPI interface for 'ethtool' (need for @@ -58,5 +60,5 @@ index 7dda2cee919b..8ac5c7e64314 100644 /* add new constants above here */ -- -2.17.1 +2.20.1 diff --git a/patch/0045-i2c-mlxcpld-Fix-criteria-for-frequency-setting.patch b/patch/0045-i2c-mlxcpld-Fix-criteria-for-frequency-setting.patch index abedc2e6ef89..07d2df567e8a 100644 --- a/patch/0045-i2c-mlxcpld-Fix-criteria-for-frequency-setting.patch +++ b/patch/0045-i2c-mlxcpld-Fix-criteria-for-frequency-setting.patch @@ -1,6 +1,8 @@ +From a0ea663d696f2d67fc5ac8f33ab26b60b932f5cd Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Sat, 10 Jul 2021 07:24:22 +0000 -Subject: 0045 i2c: mlxcpld: Fix criteria for frequency setting +Subject: [PATCH backport 5.10 045/182] i2c: mlxcpld: Fix criteria for + frequency setting Value for getting frequency capability wrongly has been taken from register offset instead of register value. @@ -25,5 +27,5 @@ index 4e0b7c2882ce..6d41c3db8a2b 100644 freq = MLXCPLD_I2C_FREQ_1000KHZ_SET; break; -- -2.17.1 +2.20.1 diff --git a/patch/0046-i2c-mlxcpld-Reduce-polling-time-for-performance.patch b/patch/0046-i2c-mlxcpld-Reduce-polling-time-for-performance-impr.patch similarity index 84% rename from patch/0046-i2c-mlxcpld-Reduce-polling-time-for-performance.patch rename to patch/0046-i2c-mlxcpld-Reduce-polling-time-for-performance-impr.patch index 337c780e8820..88bce22b4918 100644 --- a/patch/0046-i2c-mlxcpld-Reduce-polling-time-for-performance.patch +++ b/patch/0046-i2c-mlxcpld-Reduce-polling-time-for-performance-impr.patch @@ -1,7 +1,8 @@ +From fdcccb92ef348e32a9e3693f8a2e3df9dfa48ccf Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Tue, 6 Jul 2021 09:37:04 +0000 -Subject: 0046 i2c: mlxcpld: Reduce polling time for performance - improvement +Subject: [PATCH backport 5.10 046/182] i2c: mlxcpld: Reduce polling time for + performance improvement Decrease polling time 'MLXCPLD_I2C_POLL_TIME' from 400 usec to 200 usec. It improves performance of I2C transactions. @@ -28,5 +29,5 @@ index 6d41c3db8a2b..8e110d792147 100644 /* LPC I2C registers */ #define MLXCPLD_LPCI2C_CPBLTY_REG 0x0 -- -2.17.1 +2.20.1 diff --git a/patch/0047-i2c-mlxcpld-Allow-flexible-polling-time-setting.patch b/patch/0047-i2c-mlxcpld-Allow-flexible-polling-time-setting-for-.patch similarity index 93% rename from patch/0047-i2c-mlxcpld-Allow-flexible-polling-time-setting.patch rename to patch/0047-i2c-mlxcpld-Allow-flexible-polling-time-setting-for-.patch index 255ed2813d97..57f526861cf8 100644 --- a/patch/0047-i2c-mlxcpld-Allow-flexible-polling-time-setting.patch +++ b/patch/0047-i2c-mlxcpld-Allow-flexible-polling-time-setting-for-.patch @@ -1,7 +1,8 @@ +From a0fb4893521ea063db085162385c1eac83cafb07 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Tue, 6 Jul 2021 18:23:46 +0000 -Subject: 0047 i2c: mlxcpld: Allow flexible polling time setting - for I2C transactions +Subject: [PATCH backport 5.10 047/182] i2c: mlxcpld: Allow flexible polling + time setting for I2C transactions Allow polling time setting according to I2C frequency supported across the system. For base frequency 400 KHz and 1 MHz set polling time is set @@ -78,5 +79,5 @@ index 8e110d792147..56aa424fd71d 100644 /* Set I2C bus frequency if platform data provides this info. */ pdata = dev_get_platdata(&pdev->dev); -- -2.17.1 +2.20.1 diff --git a/patch/0052-hwmon-mlxreg-fan-Return-non-zero-value-when-fan.patch b/patch/0052-hwmon-mlxreg-fan-Return-non-zero-value-when-fan.patch deleted file mode 100644 index 8bbdd4a26ae0..000000000000 --- a/patch/0052-hwmon-mlxreg-fan-Return-non-zero-value-when-fan.patch +++ /dev/null @@ -1,88 +0,0 @@ -From: Vadim Pasternak -Date: Thu, 8 Jul 2021 09:44:28 +0000 -Subject: 0052 hwmon: (mlxreg-fan) Return non-zero value when fan - current state is enforced from sysfs - -Fan speed minimum can be enforced from sysfs. For example, setting -current fan speed to 20 is used to enforce fan speed to be at 100% -speed, 19 - to be not below 90% speed, etcetera. This feature provides -ability to limit fan speed according to some system wise -considerations, like absence of some replaceable units or high system -ambient temperature. - -Request for changing fan minimum speed is configuration request and can -be set only through 'sysfs' write procedure. In this situation value of -argument 'state' is above nominal fan speed maximum. - -Return non-zero code in this case to avoid -thermal_cooling_device_stats_update() call, because in this case -statistics update violates thermal statistics table range. -The issues is observed in case kernel is configured with option -CONFIG_THERMAL_STATISTICS. - -Here is the trace from KASAN: -[ 159.506659] BUG: KASAN: slab-out-of-bounds in thermal_cooling_device_stats_update+0x7d/0xb0 -[ 159.516016] Read of size 4 at addr ffff888116163840 by task hw-management.s/7444 -[ 159.545625] Call Trace: -[ 159.548366] dump_stack+0x92/0xc1 -[ 159.552084] ? thermal_cooling_device_stats_update+0x7d/0xb0 -[ 159.635869] thermal_zone_device_update+0x345/0x780 -[ 159.688711] thermal_zone_device_set_mode+0x7d/0xc0 -[ 159.694174] mlxsw_thermal_modules_init+0x48f/0x590 [mlxsw_core] -[ 159.700972] ? mlxsw_thermal_set_cur_state+0x5a0/0x5a0 [mlxsw_core] -[ 159.731827] mlxsw_thermal_init+0x763/0x880 [mlxsw_core] -[ 160.070233] RIP: 0033:0x7fd995909970 -[ 160.074239] Code: 73 01 c3 48 8b 0d 28 d5 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 99 2d 2c 00 00 75 10 b8 01 00 00 00 0f 05 <48> 3d 01 f0 ff .. -[ 160.095242] RSP: 002b:00007fff54f5d938 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 -[ 160.103722] RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 00007fd995909970 -[ 160.111710] RDX: 0000000000000013 RSI: 0000000001906008 RDI: 0000000000000001 -[ 160.119699] RBP: 0000000001906008 R08: 00007fd995bc9760 R09: 00007fd996210700 -[ 160.127687] R10: 0000000000000073 R11: 0000000000000246 R12: 0000000000000013 -[ 160.135673] R13: 0000000000000001 R14: 00007fd995bc8600 R15: 0000000000000013 -[ 160.143671] -[ 160.145338] Allocated by task 2924: -[ 160.149242] kasan_save_stack+0x19/0x40 -[ 160.153541] __kasan_kmalloc+0x7f/0xa0 -[ 160.157743] __kmalloc+0x1a2/0x2b0 -[ 160.161552] thermal_cooling_device_setup_sysfs+0xf9/0x1a0 -[ 160.167687] __thermal_cooling_device_register+0x1b5/0x500 -[ 160.173833] devm_thermal_of_cooling_device_register+0x60/0xa0 -[ 160.180356] mlxreg_fan_probe+0x474/0x5e0 [mlxreg_fan] -[ 160.248140] -[ 160.249807] The buggy address belongs to the object at ffff888116163400 -[ 160.249807] which belongs to the cache kmalloc-1k of size 1024 -[ 160.263814] The buggy address is located 64 bytes to the right of -[ 160.263814] 1024-byte region [ffff888116163400, ffff888116163800) -[ 160.277536] The buggy address belongs to the page: -[ 160.282898] page:0000000012275840 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888116167000 pfn:0x116160 -[ 160.294872] head:0000000012275840 order:3 compound_mapcount:0 compound_pincount:0 -[ 160.303251] flags: 0x200000000010200(slab|head|node=0|zone=2) -[ 160.309694] raw: 0200000000010200 ffffea00046f7208 ffffea0004928208 ffff88810004dbc0 -[ 160.318367] raw: ffff888116167000 00000000000a0006 00000001ffffffff 0000000000000000 -[ 160.327033] page dumped because: kasan: bad access detected -[ 160.333270] -[ 160.334937] Memory state around the buggy address: -[ 160.356469] >ffff888116163800: fc .. - -Fixes: 65afb4c8e7e4: (hwmon: (mlxreg-fan) Add support for Mellanox FAN driver) -Signed-off-by: Vadim Pasternak ---- - drivers/hwmon/mlxreg-fan.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c -index 89fe7b9fe26b..93fb991a5f4e 100644 ---- a/drivers/hwmon/mlxreg-fan.c -+++ b/drivers/hwmon/mlxreg-fan.c -@@ -334,7 +334,7 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, - * For configuration non-zero value is to be returned to avoid thermal - * statistics update. - */ -- config = 1; -+ config = 0; /*1*/; - state -= MLXREG_FAN_MAX_STATE; - for (i = 0; i < state; i++) - fan->cooling_levels[i] = state; --- -2.17.1 - diff --git a/patch/0053-mlxsw-core-Avoid-creation-virtual-hwmon-objects.patch b/patch/0053-mlxsw-core-Avoid-creation-virtual-hwmon-objects-by-t.patch similarity index 93% rename from patch/0053-mlxsw-core-Avoid-creation-virtual-hwmon-objects.patch rename to patch/0053-mlxsw-core-Avoid-creation-virtual-hwmon-objects-by-t.patch index 057c4a140c39..f5d69776de8d 100644 --- a/patch/0053-mlxsw-core-Avoid-creation-virtual-hwmon-objects.patch +++ b/patch/0053-mlxsw-core-Avoid-creation-virtual-hwmon-objects-by-t.patch @@ -1,7 +1,8 @@ +From 25d36748f03a4c652abd29e909bbe5a30ea67ecf Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Wed, 4 Nov 2020 20:07:15 +0200 -Subject: 0053 mlxsw: core: Avoid creation virtual hwmon objects - by thermal module +Subject: [PATCH backport 5.10 053/182] mlxsw: core: Avoid creation virtual + hwmon objects by thermal module Extend initialization of each thermal zone with 'thermal_zone_params', set field 'no_hwmon' in this structure to 'true'. @@ -70,5 +71,5 @@ index b29824448aa8..e1a760519097 100644 if (IS_ERR(thermal->tzdev)) { err = PTR_ERR(thermal->tzdev); -- -2.17.1 +2.20.1 diff --git a/patch/0054-mlxsw-minimal-Simplify-method-of-modules-number.patch b/patch/0054-mlxsw-minimal-Simplify-method-of-modules-number-dete.patch similarity index 96% rename from patch/0054-mlxsw-minimal-Simplify-method-of-modules-number.patch rename to patch/0054-mlxsw-minimal-Simplify-method-of-modules-number-dete.patch index eed28ead0794..bf1bf2ed3360 100644 --- a/patch/0054-mlxsw-minimal-Simplify-method-of-modules-number.patch +++ b/patch/0054-mlxsw-minimal-Simplify-method-of-modules-number-dete.patch @@ -1,7 +1,8 @@ +From 675042fec21be3fbd12388b239676608759f0497 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 19 Jul 2021 17:07:02 +0000 -Subject: 0054 mlxsw: minimal: Simplify method of modules number - detection +Subject: [PATCH backport 5.10 054/182] mlxsw: minimal: Simplify method of + modules number detection Remove unnecessary access to PMLP register, used to find the number of module supported by the system. Obtain this information through MGPIR @@ -178,5 +179,5 @@ index af4c9b44d9cf..a8c67b763c8b 100644 kfree(mlxsw_m->module_to_port); kfree(mlxsw_m->ports); -- -2.17.1 +2.20.1 diff --git a/patch/0055-platform_data-mlxreg-Add-new-type-to-support-mo.patch b/patch/0055-platform_data-mlxreg-Add-new-type-to-support-modular.patch similarity index 97% rename from patch/0055-platform_data-mlxreg-Add-new-type-to-support-mo.patch rename to patch/0055-platform_data-mlxreg-Add-new-type-to-support-modular.patch index 0ad18d902cf3..aa54be4bad36 100644 --- a/patch/0055-platform_data-mlxreg-Add-new-type-to-support-mo.patch +++ b/patch/0055-platform_data-mlxreg-Add-new-type-to-support-modular.patch @@ -1,7 +1,8 @@ +From 8f9032570ba6f1b6ddb6cca99ae7712d9e41ea0d Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 12 Jul 2021 14:55:49 +0000 -Subject: 0055 platform_data/mlxreg: Add new type to support - modular systems +Subject: [PATCH backport 5.10 055/182] platform_data/mlxreg: Add new type to + support modular systems Add new types for the Nvidia modular systems MSN4800 which could be equipped with the different types of replaceable line cards. @@ -164,5 +165,5 @@ index 101333fe2b8d..49f0e15a10dd 100644 u32 reg; u32 mask; -- -2.17.1 +2.20.1 diff --git a/patch/0056-platform-x86-mlx-platform-Add-initial-support-f.patch b/patch/0056-platform-x86-mlx-platform-Add-initial-support-for-ne.patch similarity index 99% rename from patch/0056-platform-x86-mlx-platform-Add-initial-support-f.patch rename to patch/0056-platform-x86-mlx-platform-Add-initial-support-for-ne.patch index 0864b9d6fe18..4cadcdb7b5a4 100644 --- a/patch/0056-platform-x86-mlx-platform-Add-initial-support-f.patch +++ b/patch/0056-platform-x86-mlx-platform-Add-initial-support-for-ne.patch @@ -1,8 +1,8 @@ -From 1fe47720483933d41d480ae51c3487a2f34e6e1a Mon Sep 17 00:00:00 2001 +From e30148789fa7c9554bfbac59e737d92301d09059 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 12 Jul 2021 16:39:11 +0000 -Subject: [PATCH backport for v5.10 56/97] platform/x86: mlx-platform: Add - initial support for new modular system +Subject: [PATCH backport 5.10 056/182] platform/x86: mlx-platform: Add initial + support for new modular system Add initial chassis management support for Nvidia modular Ethernet switch systems MSN4800, providing a high performance switching solution diff --git a/patch/0057-platform-mellanox-mlxreg-hotplug-Extend-logic-f.patch b/patch/0057-platform-mellanox-mlxreg-hotplug-Extend-logic-for-ho.patch similarity index 98% rename from patch/0057-platform-mellanox-mlxreg-hotplug-Extend-logic-f.patch rename to patch/0057-platform-mellanox-mlxreg-hotplug-Extend-logic-for-ho.patch index 134331bb78b8..72ea497a3a54 100644 --- a/patch/0057-platform-mellanox-mlxreg-hotplug-Extend-logic-f.patch +++ b/patch/0057-platform-mellanox-mlxreg-hotplug-Extend-logic-for-ho.patch @@ -1,7 +1,8 @@ +From 4a9542f7b6208956b87c310942fa47b1afc45494 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 12 Jul 2021 16:50:27 +0000 -Subject: 0057 platform/mellanox: mlxreg-hotplug: Extend logic - for hotplug devices operations +Subject: [PATCH backport 5.10 057/182] platform/mellanox: mlxreg-hotplug: + Extend logic for hotplug devices operations Extend the structure 'mlxreg_hotplug_device" with platform device field to allow transition of the register map and system interrupt line number @@ -296,5 +297,5 @@ index 49f0e15a10dd..3122d550dc00 100644 bool attached; u8 regnum; -- -2.17.1 +2.20.1 diff --git a/patch/0058-platform-x86-mlx-platform-Configure-notifier-ca.patch b/patch/0058-platform-x86-mlx-platform-Configure-notifier-callbac.patch similarity index 99% rename from patch/0058-platform-x86-mlx-platform-Configure-notifier-ca.patch rename to patch/0058-platform-x86-mlx-platform-Configure-notifier-callbac.patch index 843f0ec766ca..71bb3473513b 100644 --- a/patch/0058-platform-x86-mlx-platform-Configure-notifier-ca.patch +++ b/patch/0058-platform-x86-mlx-platform-Configure-notifier-callbac.patch @@ -1,7 +1,8 @@ +From 810957c2eed0f5e5f239a332d0367dfa02ec03f6 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 12 Jul 2021 17:25:30 +0000 -Subject: 0058 platform/x86: mlx-platform: Configure notifier - callbacks for modular system +Subject: [PATCH backport 5.10 058/182] platform/x86: mlx-platform: Configure + notifier callbacks for modular system Add event notifier callbacks for modular system line cards. These callbacks are to be passed to "mlxreg-hotplug" driver by line card @@ -502,5 +503,5 @@ index 6d14eb3dab50..8e1e298cf18b 100644 }, }; -- -2.17.1 +2.20.1 diff --git a/patch/0059-platform-mellanox-mlxreg-io-Extend-number-of-hw.patch b/patch/0059-platform-mellanox-mlxreg-io-Extend-number-of-hwmon-a.patch similarity index 82% rename from patch/0059-platform-mellanox-mlxreg-io-Extend-number-of-hw.patch rename to patch/0059-platform-mellanox-mlxreg-io-Extend-number-of-hwmon-a.patch index 2a9046263781..2050b790d88b 100644 --- a/patch/0059-platform-mellanox-mlxreg-io-Extend-number-of-hw.patch +++ b/patch/0059-platform-mellanox-mlxreg-io-Extend-number-of-hwmon-a.patch @@ -1,7 +1,8 @@ +From 1832955f5b8d4f7dc9e20d4e860564d798f6d24c Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Thu, 25 Mar 2021 20:12:07 +0200 -Subject: 0059 platform/mellanox: mlxreg-io: Extend number of - hwmon attributes +Subject: [PATCH backport 5.10 059/182] platform/mellanox: mlxreg-io: Extend + number of hwmon attributes Extend maximum number of the attributes, exposed to 'sysfs'. It is requires in order to support modular systems, which @@ -27,5 +28,5 @@ index a916cd89cbbe..2c2686d5c2fc 100644 /** * struct mlxreg_io_priv_data - driver's private data: -- -2.17.1 +2.20.1 diff --git a/patch/0060-platform_data-mlxreg-Add-new-field-for-secured-.patch b/patch/0060-platform_data-mlxreg-Add-new-field-for-secured-acces.patch similarity index 85% rename from patch/0060-platform_data-mlxreg-Add-new-field-for-secured-.patch rename to patch/0060-platform_data-mlxreg-Add-new-field-for-secured-acces.patch index a369ace07f69..53ed462f7de1 100644 --- a/patch/0060-platform_data-mlxreg-Add-new-field-for-secured-.patch +++ b/patch/0060-platform_data-mlxreg-Add-new-field-for-secured-acces.patch @@ -1,7 +1,8 @@ +From d48bd08b57cf84861e741ef8e5a2c4d3d142401c Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 12 Jul 2021 21:39:51 +0000 -Subject: 0060 platform_data/mlxreg: Add new field for secured - access +Subject: [PATCH backport 5.10 060/182] platform_data/mlxreg: Add new field for + secured access Extend structure 'mlxreg_core_data' with the field "secured". The purpose of this field is to restrict access to some attributes, if @@ -31,5 +32,5 @@ index 3122d550dc00..40185f9d7c14 100644 /** -- -2.17.1 +2.20.1 diff --git a/patch/0061-platform-mellanox-mlxreg-lc-Add-initial-support.patch b/patch/0061-platform-mellanox-mlxreg-lc-Add-initial-support-for-.patch similarity index 98% rename from patch/0061-platform-mellanox-mlxreg-lc-Add-initial-support.patch rename to patch/0061-platform-mellanox-mlxreg-lc-Add-initial-support-for-.patch index 38c64830f3f0..183716160b66 100644 --- a/patch/0061-platform-mellanox-mlxreg-lc-Add-initial-support.patch +++ b/patch/0061-platform-mellanox-mlxreg-lc-Add-initial-support-for-.patch @@ -1,7 +1,8 @@ +From e8d9090e50da28c82c3bbb7ff2db58aebd1c16ff Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 12 Jul 2021 21:40:46 +0000 -Subject: 0061 platform/mellanox: mlxreg-lc: Add initial support - for Nvidia line card devices +Subject: [PATCH backport 5.10 061/182] platform/mellanox: mlxreg-lc: Add + initial support for Nvidia line card devices Provide support for the Nvidia MSN4800-XX line cards for MSN4800 Ethernet modular switch system, providing a high performance switching @@ -83,7 +84,7 @@ index 499623ccf2fe..e47b6b064881 100644 +obj-$(CONFIG_MLXREG_LC) += mlxreg-lc.o diff --git a/drivers/platform/mellanox/mlxreg-lc.c b/drivers/platform/mellanox/mlxreg-lc.c new file mode 100644 -index 000000000000..c2ccb38df693 +index 000000000000..2ddad96b154a --- /dev/null +++ b/drivers/platform/mellanox/mlxreg-lc.c @@ -0,0 +1,915 @@ @@ -566,7 +567,7 @@ index 000000000000..c2ccb38df693 + else + regval &= ~BIT(mlxreg_lc->data->slot - 1); + -+ err = 0; /*regmap_write(mlxreg_lc->par_regmap, mlxreg_lc->data->reg_pwr, regval);*/ ++ err = regmap_write(mlxreg_lc->par_regmap, mlxreg_lc->data->reg_pwr, regval); + + mutex_unlock(&mlxreg_lc->lock); + @@ -598,7 +599,7 @@ index 000000000000..c2ccb38df693 + else + regval &= ~BIT(mlxreg_lc->data->slot - 1); + -+ err = 0; /*regmap_write(mlxreg_lc->par_regmap, mlxreg_lc->data->reg_ena, regval);*/ ++ err = regmap_write(mlxreg_lc->par_regmap, mlxreg_lc->data->reg_ena, regval); + +regmap_read_fail: + mutex_unlock(&mlxreg_lc->lock); @@ -1003,5 +1004,5 @@ index 000000000000..c2ccb38df693 +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_ALIAS("platform:mlxreg-lc"); -- -2.17.1 +2.20.1 diff --git a/patch/0062-Documentation-ABI-Add-new-attributes-for-mlxreg.patch b/patch/0062-Documentation-ABI-Add-new-attributes-for-mlxreg-io-s.patch similarity index 97% rename from patch/0062-Documentation-ABI-Add-new-attributes-for-mlxreg.patch rename to patch/0062-Documentation-ABI-Add-new-attributes-for-mlxreg-io-s.patch index efe4bf0c5cf9..e611b499b9d3 100644 --- a/patch/0062-Documentation-ABI-Add-new-attributes-for-mlxreg.patch +++ b/patch/0062-Documentation-ABI-Add-new-attributes-for-mlxreg-io-s.patch @@ -1,7 +1,8 @@ +From a47f1f27b1d6393a5a47d5de211ba36e5905b8c7 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Thu, 25 Mar 2021 20:12:05 +0200 -Subject: 0062 Documentation/ABI: Add new attributes for - mlxreg-io sysfs interfaces +Subject: [PATCH backport 5.10 062/182] Documentation/ABI: Add new attributes + for mlxreg-io sysfs interfaces Add documentation for the new attributes: - "bios_active_image"; "bios_auth_fail"; "bios_upgrade_fail"; @@ -168,5 +169,5 @@ index fd9a8045bb0c..65d87f43e618 100644 + + The file is read/write. -- -2.17.1 +2.20.1 diff --git a/patch/0063-Documentation-ABI-Add-new-line-card-attributes-.patch b/patch/0063-Documentation-ABI-Add-new-line-card-attributes-for-m.patch similarity index 96% rename from patch/0063-Documentation-ABI-Add-new-line-card-attributes-.patch rename to patch/0063-Documentation-ABI-Add-new-line-card-attributes-for-m.patch index 1ca58f0cef47..902687365ce2 100644 --- a/patch/0063-Documentation-ABI-Add-new-line-card-attributes-.patch +++ b/patch/0063-Documentation-ABI-Add-new-line-card-attributes-for-m.patch @@ -1,7 +1,8 @@ +From 999214e1026baf68ff05a734a92e4cbb4cd8a073 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Thu, 25 Mar 2021 20:12:11 +0200 -Subject: 0063 Documentation/ABI: Add new line card attributes - for mlxreg-io sysfs interfaces +Subject: [PATCH backport 5.10 063/182] Documentation/ABI: Add new line card + attributes for mlxreg-io sysfs interfaces Add documentation for the new attributes for line cards: - CPLDs versioning. @@ -127,5 +128,5 @@ index 65d87f43e618..e2f938499473 100644 + + The files are read only. -- -2.17.1 +2.20.1 diff --git a/patch/0064-hwmon-mlxreg-fan-Extend-the-maximum-number-of-t.patch b/patch/0064-hwmon-mlxreg-fan-Extend-the-maximum-number-of-tachom.patch similarity index 70% rename from patch/0064-hwmon-mlxreg-fan-Extend-the-maximum-number-of-t.patch rename to patch/0064-hwmon-mlxreg-fan-Extend-the-maximum-number-of-tachom.patch index ac50e534a751..77d977c670cd 100644 --- a/patch/0064-hwmon-mlxreg-fan-Extend-the-maximum-number-of-t.patch +++ b/patch/0064-hwmon-mlxreg-fan-Extend-the-maximum-number-of-tachom.patch @@ -1,7 +1,8 @@ +From 0e6b16e3aefc494a1e0a4b1a2c731f8a2fb6ec33 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 12 Jul 2021 22:04:25 +0000 -Subject: 0064 hwmon: (mlxreg-fan) Extend the maximum number of - tachometers +Subject: [PATCH backport 5.10 064/182] hwmon: (mlxreg-fan) Extend the maximum + number of tachometers Extend support of maximum tachometers from 12 to 14 in order to support new systems, equipped with more fans. @@ -12,7 +13,7 @@ Signed-off-by: Vadim Pasternak 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c -index 93fb991a5f4e..35c283405df6 100644 +index 89fe7b9fe26b..0f5b109817a7 100644 --- a/drivers/hwmon/mlxreg-fan.c +++ b/drivers/hwmon/mlxreg-fan.c @@ -12,7 +12,7 @@ @@ -24,15 +25,15 @@ index 93fb991a5f4e..35c283405df6 100644 #define MLXREG_FAN_MAX_STATE 10 #define MLXREG_FAN_MIN_DUTY 51 /* 20% */ #define MLXREG_FAN_MAX_DUTY 255 /* 100% */ -@@ -255,6 +255,8 @@ mlxreg_fan_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr, - - static const struct hwmon_channel_info *mlxreg_fan_hwmon_info[] = { - HWMON_CHANNEL_INFO(fan, -+ HWMON_F_INPUT | HWMON_F_FAULT, -+ HWMON_F_INPUT | HWMON_F_FAULT, +@@ -266,6 +266,8 @@ static const struct hwmon_channel_info *mlxreg_fan_hwmon_info[] = { HWMON_F_INPUT | HWMON_F_FAULT, HWMON_F_INPUT | HWMON_F_FAULT, HWMON_F_INPUT | HWMON_F_FAULT, ++ HWMON_F_INPUT | HWMON_F_FAULT, ++ HWMON_F_INPUT | HWMON_F_FAULT, + HWMON_F_INPUT | HWMON_F_FAULT), + HWMON_CHANNEL_INFO(pwm, + HWMON_PWM_INPUT), -- -2.17.1 +2.20.1 diff --git a/patch/0065-platform-x86-mlx-platform-Extend-FAN-and-LED-co.patch b/patch/0065-platform-x86-mlx-platform-Extend-FAN-and-LED-config-.patch similarity index 95% rename from patch/0065-platform-x86-mlx-platform-Extend-FAN-and-LED-co.patch rename to patch/0065-platform-x86-mlx-platform-Extend-FAN-and-LED-config-.patch index cb7b943fe10a..fd317717397f 100644 --- a/patch/0065-platform-x86-mlx-platform-Extend-FAN-and-LED-co.patch +++ b/patch/0065-platform-x86-mlx-platform-Extend-FAN-and-LED-config-.patch @@ -1,7 +1,8 @@ +From 907562d549fefb326456b5c8c9f4e881d6379431 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 12 Jul 2021 22:20:35 +0000 -Subject: 0065 platform/x86: mlx-platform: Extend FAN and LED - config to support new MQM97xx systems +Subject: [PATCH backport 5.10 065/182] platform/x86: mlx-platform: Extend FAN + and LED config to support new MQM97xx systems Add support for new system types "MQM97xx", which is based on Mellanox Quantum-2 ASIC. It provides up to 64x400GB/s (IB) full bidirectional @@ -126,5 +127,5 @@ index 8e1e298cf18b..681b49fe4176 100644 case MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET: case MLXPLAT_CPLD_LPC_REG_FAN_CAP2_OFFSET: -- -2.17.1 +2.20.1 diff --git a/patch/0066-platform-x86-mlx-platform-Add-new-attributes-fo.patch b/patch/0066-platform-x86-mlx-platform-Add-new-attributes-for-Cof.patch similarity index 91% rename from patch/0066-platform-x86-mlx-platform-Add-new-attributes-fo.patch rename to patch/0066-platform-x86-mlx-platform-Add-new-attributes-for-Cof.patch index f868b8ca420b..a9568da4d5f0 100644 --- a/patch/0066-platform-x86-mlx-platform-Add-new-attributes-fo.patch +++ b/patch/0066-platform-x86-mlx-platform-Add-new-attributes-for-Cof.patch @@ -1,7 +1,8 @@ +From 74e69c1a32afbd2496dc0597de2610e4488d7810 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Tue, 13 Jul 2021 15:20:13 +0000 -Subject: 0066 platform/x86: mlx-platform: Add new attributes for - CoffeeLake COMEx based systems +Subject: [PATCH backport 5.10 066/182] platform/x86: mlx-platform: Add new + attributes for CoffeeLake COMEx based systems Add new attributes for systems equipped with CoffeeLake COMEx module to represent various BIOS statuses: "bios_active_image", "bios_auth_fail", @@ -59,5 +60,5 @@ index 681b49fe4176..950d90e6412a 100644 .label = "voltreg_update_status", .reg = MLXPLAT_CPLD_LPC_REG_GP0_RO_OFFSET, -- -2.17.1 +2.20.1 diff --git a/patch/0067-platform-mellanox-Add-dedicated-match-for-system-typ.patch b/patch/0067-platform-mellanox-Add-dedicated-match-for-system-typ.patch new file mode 100644 index 000000000000..97f0bbd1c912 --- /dev/null +++ b/patch/0067-platform-mellanox-Add-dedicated-match-for-system-typ.patch @@ -0,0 +1,450 @@ +From 8e3d1dbfd9cf686f9282d9b36f4ccc5ef3949ef5 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Sun, 7 Feb 2021 22:59:53 +0200 +Subject: [PATCH backport 5.10 067/182] platform/mellanox: Add dedicated match + for system type QMB8700 (downstream) + +Use dedicated match function for QMB8700 system in order to work around +wrong CPLD register map. + +Note this is downstream kernel patch, no intention to upstream this +code. + +Additional notes: +System QMB8700 is not used by Sonic and not used by our up-stream +customers. +It has some hardware bug in CPLD and this was the reason to add +dedicated patch to WA this bug. + +The problem that after this patch many other patches have been added +to 'mlx-platform' driver and removing this patch will create conflicts +of applying later patches. +Thus, this patch is held to avoid such conflicts. + +In kernel v6.1 this patch is to be placed on top of all other patches +to avoid such sort of conflicts. +However in v5.10 it is very hard now to rebase all the patches for +moving this one to the top. + +Signed-off-by: Oleksandr Shamray +Reviewed-by: Vadim Pasternak +--- + drivers/platform/x86/mlx-platform.c | 353 ++++++++++++++++++++++++++++ + 1 file changed, 353 insertions(+) + +diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c +index 950d90e6412a..614b9f5c673f 100644 +--- a/drivers/platform/x86/mlx-platform.c ++++ b/drivers/platform/x86/mlx-platform.c +@@ -201,6 +201,7 @@ + #define MLXPLAT_CPLD_FAN_MASK GENMASK(3, 0) + #define MLXPLAT_CPLD_ASIC_MASK GENMASK(1, 0) + #define MLXPLAT_CPLD_FAN_NG_MASK GENMASK(6, 0) ++#define MLXPLAT_CPLD_FAN_QMB8700_MASK GENMASK(5, 0) + #define MLXPLAT_CPLD_LED_LO_NIBBLE_MASK GENMASK(7, 4) + #define MLXPLAT_CPLD_LED_HI_NIBBLE_MASK GENMASK(3, 0) + #define MLXPLAT_CPLD_VOLTREG_UPD_MASK GENMASK(5, 4) +@@ -949,6 +950,57 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_fan_items_data[] = { + }, + }; + ++static struct mlxreg_core_data mlxplat_mlxcpld_qmb8700_fan_items_data[] = { ++ { ++ .label = "fan1", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(0), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan2", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(1), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(1), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan3", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(2), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(2), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan4", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(3), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(3), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan5", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(4), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(4), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "fan6", ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = BIT(5), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(5), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++}; ++ + static struct mlxreg_core_item mlxplat_mlxcpld_default_ng_items[] = { + { + .data = mlxplat_mlxcpld_default_ng_psu_items_data, +@@ -988,6 +1040,45 @@ static struct mlxreg_core_item mlxplat_mlxcpld_default_ng_items[] = { + }, + }; + ++static struct mlxreg_core_item mlxplat_mlxcpld_qmb8700_items[] = { ++ { ++ .data = mlxplat_mlxcpld_default_ng_psu_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = MLXPLAT_CPLD_PSU_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_default_ng_psu_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_default_ng_pwr_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = MLXPLAT_CPLD_PWR_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_default_ng_pwr_items_data), ++ .inversed = 0, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_qmb8700_fan_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = MLXPLAT_CPLD_FAN_QMB8700_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_qmb8700_fan_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_default_asic_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_ASIC_HEALTH_OFFSET, ++ .mask = MLXPLAT_CPLD_ASIC_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_default_asic_items_data), ++ .inversed = 0, ++ .health = true, ++ }, ++}; ++ + static + struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_ng_data = { + .items = mlxplat_mlxcpld_default_ng_items, +@@ -998,6 +1089,16 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_ng_data = { + .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW, + }; + ++static ++struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_qmb8700_data = { ++ .items = mlxplat_mlxcpld_qmb8700_items, ++ .counter = ARRAY_SIZE(mlxplat_mlxcpld_qmb8700_items), ++ .cell = MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET, ++ .mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF | MLXPLAT_CPLD_AGGR_MASK_COMEX, ++ .cell_low = MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET, ++ .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW, ++}; ++ + /* Platform hotplug extended system family data */ + static struct mlxreg_core_data mlxplat_mlxcpld_ext_psu_items_data[] = { + { +@@ -2430,6 +2531,124 @@ static struct mlxreg_core_platform_data mlxplat_modular_led_data = { + .counter = ARRAY_SIZE(mlxplat_mlxcpld_modular_led_data), + }; + ++/* Platform led data for QMB8700 system */ ++static struct mlxreg_core_data mlxplat_mlxcpld_qmb8700_led_data[] = { ++ { ++ .label = "status:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ }, ++ { ++ .label = "status:orange", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK ++ }, ++ { ++ .label = "psu:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ }, ++ { ++ .label = "psu:orange", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED1_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ }, ++ { ++ .label = "fan1:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(0), ++ }, ++ { ++ .label = "fan1:orange", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(0), ++ }, ++ { ++ .label = "fan2:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(1), ++ }, ++ { ++ .label = "fan2:orange", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(1), ++ }, ++ { ++ .label = "fan3:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(2), ++ }, ++ { ++ .label = "fan3:orange", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(2), ++ }, ++ { ++ .label = "fan4:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(3), ++ }, ++ { ++ .label = "fan4:orange", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(3), ++ }, ++ { ++ .label = "fan5:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(4), ++ }, ++ { ++ .label = "fan5:orange", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(4), ++ }, ++ { ++ .label = "fan6:green", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(5), ++ }, ++ { ++ .label = "fan6:orange", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED4_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_HI_NIBBLE_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, ++ .bit = BIT(5), ++ }, ++ { ++ .label = "uid:blue", ++ .reg = MLXPLAT_CPLD_LPC_REG_LED5_OFFSET, ++ .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, ++ }, ++}; ++ ++static struct mlxreg_core_platform_data mlxplat_qmb8700_led_data = { ++ .data = mlxplat_mlxcpld_qmb8700_led_data, ++ .counter = ARRAY_SIZE(mlxplat_mlxcpld_qmb8700_led_data), ++}; ++ + /* Platform register access default */ + static struct mlxreg_core_data mlxplat_mlxcpld_default_regs_io_data[] = { + { +@@ -3592,6 +3811,107 @@ static struct mlxreg_core_platform_data mlxplat_default_fan_data = { + .capability = MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET, + }; + ++/* Platform FAN default */ ++static struct mlxreg_core_data mlxplat_mlxcpld_qmb8700_fan_data[] = { ++ { ++ .label = "pwm1", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET, ++ }, ++ { ++ .label = "tacho1", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO1_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .bit = BIT(0), ++ }, ++ { ++ .label = "tacho2", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO2_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .bit = BIT(1), ++ }, ++ { ++ .label = "tacho3", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO3_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .bit = BIT(2), ++ }, ++ { ++ .label = "tacho4", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO4_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .bit = BIT(3), ++ }, ++ { ++ .label = "tacho5", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO5_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .bit = BIT(4), ++ }, ++ { ++ .label = "tacho6", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO6_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .bit = BIT(5), ++ }, ++ { ++ .label = "tacho7", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO7_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .bit = BIT(6), ++ }, ++ { ++ .label = "tacho8", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO8_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP1_OFFSET, ++ .bit = BIT(7), ++ }, ++ { ++ .label = "tacho9", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO9_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP2_OFFSET, ++ .bit = BIT(0), ++ }, ++ { ++ .label = "tacho10", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO10_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP2_OFFSET, ++ .bit = BIT(1), ++ }, ++ { ++ .label = "tacho11", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO11_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP2_OFFSET, ++ .bit = BIT(2), ++ }, ++ { ++ .label = "tacho12", ++ .reg = MLXPLAT_CPLD_LPC_REG_TACHO12_OFFSET, ++ .mask = GENMASK(7, 0), ++ .capability = MLXPLAT_CPLD_LPC_REG_FAN_CAP2_OFFSET, ++ .bit = BIT(3), ++ }, ++ { ++ .label = "conf", ++ .capability = MLXPLAT_CPLD_LPC_REG_TACHO_SPEED_OFFSET, ++ }, ++}; ++ ++static struct mlxreg_core_platform_data mlxplat_qmb8700_fan_data = { ++ .data = mlxplat_mlxcpld_qmb8700_fan_data, ++ .counter = ARRAY_SIZE(mlxplat_mlxcpld_qmb8700_fan_data), ++}; ++ + /* Watchdog type1: hardware implementation version1 + * (MSN2700, MSN2410, MSN2740, MSN2100 and MSN2140 systems). + */ +@@ -4461,6 +4781,32 @@ static int __init mlxplat_dmi_modular_matched(const struct dmi_system_id *dmi) + return 1; + } + ++static int __init mlxplat_dmi_qmb8700_matched(const struct dmi_system_id *dmi) ++{ ++ int i; ++ ++ mlxplat_max_adap_num = MLXPLAT_CPLD_MAX_PHYS_ADAPTER_NUM; ++ mlxplat_mux_num = ARRAY_SIZE(mlxplat_default_mux_data); ++ mlxplat_mux_data = mlxplat_default_mux_data; ++ for (i = 0; i < mlxplat_mux_num; i++) { ++ mlxplat_mux_data[i].values = mlxplat_msn21xx_channels; ++ mlxplat_mux_data[i].n_values = ++ ARRAY_SIZE(mlxplat_msn21xx_channels); ++ } ++ mlxplat_hotplug = &mlxplat_mlxcpld_qmb8700_data; ++ mlxplat_hotplug->deferred_nr = ++ mlxplat_msn21xx_channels[MLXPLAT_CPLD_GRP_CHNL_NUM - 1]; ++ mlxplat_led = &mlxplat_qmb8700_led_data; ++ mlxplat_regs_io = &mlxplat_default_ng_regs_io_data; ++ mlxplat_fan = &mlxplat_qmb8700_fan_data; ++ for (i = 0; i < ARRAY_SIZE(mlxplat_mlxcpld_wd_set_type2); i++) ++ mlxplat_wd_data[i] = &mlxplat_mlxcpld_wd_set_type2[i]; ++ mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; ++ mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng; ++ ++ return 1; ++} ++ + static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + { + .callback = mlxplat_dmi_default_matched, +@@ -4486,6 +4832,13 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + DMI_MATCH(DMI_BOARD_NAME, "VMOD0004"), + }, + }, ++ { ++ .callback = mlxplat_dmi_qmb8700_matched, ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "Mellanox Technologies"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "MQM8700"), ++ }, ++ }, + { + .callback = mlxplat_dmi_qmb7xx_matched, + .matches = { +-- +2.20.1 + diff --git a/patch/0068-mlxsw-core-Initialize-switch-driver-last.patch b/patch/0068-mlxsw-core-Initialize-switch-driver-last.patch index 884c2ca1670d..7384e5da24a1 100644 --- a/patch/0068-mlxsw-core-Initialize-switch-driver-last.patch +++ b/patch/0068-mlxsw-core-Initialize-switch-driver-last.patch @@ -1,6 +1,8 @@ +From 1d25ce2427827b1c61924b0ed8e937118aaa0258 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Sun, 15 Aug 2021 14:09:51 +0300 -Subject: 0068 mlxsw: core: Initialize switch driver last +Subject: [PATCH backport 5.10 068/182] mlxsw: core: Initialize switch driver + last Commit 961cf99a074f ("mlxsw: core: Re-order initialization sequence") changed the initialization sequence so that the switch driver (e.g., @@ -87,5 +89,5 @@ index 1a86535c4968..b52bbd6b2fe4 100644 if (!reload) mlxsw_core_params_unregister(mlxsw_core); -- -2.17.1 +2.20.1 diff --git a/patch/0069-mlxsw-core-Remove-mlxsw_core_is_initialized.patch b/patch/0069-mlxsw-core-Remove-mlxsw_core_is_initialized.patch index 5cb212e45084..a13416e66d6e 100644 --- a/patch/0069-mlxsw-core-Remove-mlxsw_core_is_initialized.patch +++ b/patch/0069-mlxsw-core-Remove-mlxsw_core_is_initialized.patch @@ -1,6 +1,8 @@ +From 4c2b8360a04b6462f180b9b6793d9f511c08a808 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Sun, 15 Aug 2021 14:30:14 +0300 -Subject: 0069 mlxsw: core: Remove mlxsw_core_is_initialized() +Subject: [PATCH backport 5.10 069/182] mlxsw: core: Remove + mlxsw_core_is_initialized() After the previous patch, the switch driver is always initialized last, making this function redundant. @@ -84,5 +86,5 @@ index 3713c45cfa1e..27e721f96b3b 100644 return -EINVAL; -- -2.17.1 +2.20.1 diff --git a/patch/0070-mlxsw-core_env-Defer-handling-of-module-tempera.patch b/patch/0070-mlxsw-core_env-Defer-handling-of-module-temperature-.patch similarity index 93% rename from patch/0070-mlxsw-core_env-Defer-handling-of-module-tempera.patch rename to patch/0070-mlxsw-core_env-Defer-handling-of-module-temperature-.patch index cf8e2e6ff4fe..6483a57ca7a5 100644 --- a/patch/0070-mlxsw-core_env-Defer-handling-of-module-tempera.patch +++ b/patch/0070-mlxsw-core_env-Defer-handling-of-module-temperature-.patch @@ -1,7 +1,8 @@ +From a450d59b7be00520e8a2ab390b2bc1642cea34c8 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Sun, 15 Aug 2021 14:50:26 +0300 -Subject: 0070 mlxsw: core_env: Defer handling of module - temperature warning events +Subject: [PATCH backport 5.10 070/182] mlxsw: core_env: Defer handling of + module temperature warning events Module temperature events are currently handled in softIRQ context, requiring the 'module_info_lock' to be a spin lock. In future patchsets @@ -86,5 +87,5 @@ index 27e721f96b3b..27eba0a0c91c 100644 static int mlxsw_env_temp_warn_event_register(struct mlxsw_core *mlxsw_core) { -- -2.17.1 +2.20.1 diff --git a/patch/0071-mlxsw-core_env-Convert-module_info_lock-to-a-mu.patch b/patch/0071-mlxsw-core_env-Convert-module_info_lock-to-a-mutex.patch similarity index 96% rename from patch/0071-mlxsw-core_env-Convert-module_info_lock-to-a-mu.patch rename to patch/0071-mlxsw-core_env-Convert-module_info_lock-to-a-mutex.patch index b7fe1eedaa9a..1dfeb00b44f1 100644 --- a/patch/0071-mlxsw-core_env-Convert-module_info_lock-to-a-mu.patch +++ b/patch/0071-mlxsw-core_env-Convert-module_info_lock-to-a-mutex.patch @@ -1,7 +1,8 @@ +From 0de1374694bd39c9d3e0a185c5da34506fd4aab9 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Sun, 15 Aug 2021 15:08:18 +0300 -Subject: 0071 mlxsw: core_env: Convert 'module_info_lock' to a - mutex +Subject: [PATCH backport 5.10 071/182] mlxsw: core_env: Convert + 'module_info_lock' to a mutex After the previous patch, the lock is always taken in process context so it can be converted to a mutex. It is needed for future changes where we @@ -118,5 +119,5 @@ index 27eba0a0c91c..543f401cb5c6 100644 kfree(env); } -- -2.17.1 +2.20.1 diff --git a/patch/0072-mlxsw-Track-per-module-port-status.patch b/patch/0072-mlxsw-Track-per-module-port-status.patch index c761b501ac8f..efc1f9891e28 100644 --- a/patch/0072-mlxsw-Track-per-module-port-status.patch +++ b/patch/0072-mlxsw-Track-per-module-port-status.patch @@ -1,6 +1,7 @@ +From da6632aa3ca0d019a091e3fcb772c9eacf4127e9 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Thu, 2 Sep 2021 06:40:22 +0000 -Subject: 0072 mlxsw: Track per-module port status +Subject: [PATCH backport 5.10 072/182] mlxsw: Track per-module port status In the common port module core, track the number of logical ports that are mapped to the port module and the number of logical ports using it @@ -149,5 +150,5 @@ index a8c67b763c8b..e75b702aeb36 100644 }; -- -2.17.1 +2.20.1 diff --git a/patch/0073-mlxsw-reg-Add-fields-to-PMAOS-register.patch b/patch/0073-mlxsw-reg-Add-fields-to-PMAOS-register.patch index a611dba24718..2102a1903abf 100644 --- a/patch/0073-mlxsw-reg-Add-fields-to-PMAOS-register.patch +++ b/patch/0073-mlxsw-reg-Add-fields-to-PMAOS-register.patch @@ -1,6 +1,8 @@ +From 1af02ef69c43c4ed19fee10181957fae8b3b3bd2 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Thu, 29 Jul 2021 15:15:23 +0300 -Subject: 0073 mlxsw: reg: Add fields to PMAOS register +Subject: [PATCH backport 5.10 073/182] mlxsw: reg: Add fields to PMAOS + register The Ports Module Administrative and Operational Status (PMAOS) register configures and retrieves the per-module status. Extend it with fields @@ -59,5 +61,5 @@ index 04f0c96c8068..dd72443c295f 100644 * Admin state update enable. * If this bit is set, admin state will be updated based on admin_state field. -- -2.17.1 +2.20.1 diff --git a/patch/0074-mlxsw-Make-PMAOS-pack-function-more-generic.patch b/patch/0074-mlxsw-Make-PMAOS-pack-function-more-generic.patch index 8cedecfbd0f0..b0763ff2b2d3 100644 --- a/patch/0074-mlxsw-Make-PMAOS-pack-function-more-generic.patch +++ b/patch/0074-mlxsw-Make-PMAOS-pack-function-more-generic.patch @@ -1,6 +1,8 @@ +From a09c5705bfca34abe259f3ed4d7ae262700c44f3 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Mon, 2 Aug 2021 10:12:31 +0300 -Subject: 0074 mlxsw: Make PMAOS pack function more generic +Subject: [PATCH backport 5.10 074/182] mlxsw: Make PMAOS pack function more + generic The PMAOS register has enable bits (e.g., PMAOS.ee) that allow changing only a subset of the fields, which is exactly what subsequent patches @@ -53,5 +55,5 @@ index dd72443c295f..0e18806b5834 100644 /* PPLR - Port Physical Loopback Register -- -2.17.1 +2.20.1 diff --git a/patch/0075-mlxsw-Add-support-for-transceiver-modules-reset.patch b/patch/0075-mlxsw-Add-support-for-transceiver-modules-reset.patch index ec2fbbccf1ad..1aaf833914d4 100644 --- a/patch/0075-mlxsw-Add-support-for-transceiver-modules-reset.patch +++ b/patch/0075-mlxsw-Add-support-for-transceiver-modules-reset.patch @@ -1,6 +1,8 @@ +From 8d47608fe8545714121b1e9067c2431eefdb13fe Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Sun, 15 Aug 2021 18:12:37 +0300 -Subject: 0075 mlxsw: Add support for transceiver modules reset +Subject: [PATCH backport 5.10 075/182] mlxsw: Add support for transceiver + modules reset Implement support for ethtool_ops::reset in order to reset transceiver modules. The module backing the netdev is reset when the 'ETH_RESET_PHY' @@ -187,5 +189,5 @@ index e75b702aeb36..d8659ff68ffe 100644 static int -- -2.17.1 +2.20.1 diff --git a/patch/0076-ethtool-Add-ability-to-control-transceiver-modu.patch b/patch/0076-ethtool-Add-ability-to-control-transceiver-modules-p.patch similarity index 99% rename from patch/0076-ethtool-Add-ability-to-control-transceiver-modu.patch rename to patch/0076-ethtool-Add-ability-to-control-transceiver-modules-p.patch index eaccac4ca544..37b649899f7e 100644 --- a/patch/0076-ethtool-Add-ability-to-control-transceiver-modu.patch +++ b/patch/0076-ethtool-Add-ability-to-control-transceiver-modules-p.patch @@ -1,7 +1,8 @@ +From a0de9809b2d039b36f39dab066777233ce2844db Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Wed, 21 Jul 2021 17:05:31 +0300 -Subject: 0076 ethtool: Add ability to control transceiver - modules' power mode +Subject: [PATCH backport 5.10 076/182] ethtool: Add ability to control + transceiver modules' power mode Add a pair of new ethtool messages, 'ETHTOOL_MSG_MODULE_SET' and 'ETHTOOL_MSG_MODULE_GET', that can be used to control transceiver @@ -797,5 +798,5 @@ index 28dbd582c860..6c4a5b39d807 100644 #endif /* _NET_ETHTOOL_NETLINK_H */ -- -2.17.1 +2.20.1 diff --git a/patch/0077-mlxsw-reg-Add-Port-Module-Memory-Map-Properties.patch b/patch/0077-mlxsw-reg-Add-Port-Module-Memory-Map-Properties-regi.patch similarity index 93% rename from patch/0077-mlxsw-reg-Add-Port-Module-Memory-Map-Properties.patch rename to patch/0077-mlxsw-reg-Add-Port-Module-Memory-Map-Properties-regi.patch index 4f47191da279..75c965524f8d 100644 --- a/patch/0077-mlxsw-reg-Add-Port-Module-Memory-Map-Properties.patch +++ b/patch/0077-mlxsw-reg-Add-Port-Module-Memory-Map-Properties-regi.patch @@ -1,7 +1,8 @@ +From 8fdacd80f26d3ad6de5b1279981f17752e33c915 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Thu, 29 Jul 2021 15:58:12 +0300 -Subject: 0077 mlxsw: reg: Add Port Module Memory Map Properties - register +Subject: [PATCH backport 5.10 077/182] mlxsw: reg: Add Port Module Memory Map + Properties register Add the Port Module Memory Map Properties register. It will be used to set the power mode of a module in subsequent patches. @@ -80,5 +81,5 @@ index 0e18806b5834..0cc2fdaa459e 100644 MLXSW_REG(hpkt), MLXSW_REG(rgcr), -- -2.17.1 +2.20.1 diff --git a/patch/0078-mlxsw-reg-Add-Management-Cable-IO-and-Notificat.patch b/patch/0078-mlxsw-reg-Add-Management-Cable-IO-and-Notifications-.patch similarity index 93% rename from patch/0078-mlxsw-reg-Add-Management-Cable-IO-and-Notificat.patch rename to patch/0078-mlxsw-reg-Add-Management-Cable-IO-and-Notifications-.patch index a83c2420f163..1846df10d19f 100644 --- a/patch/0078-mlxsw-reg-Add-Management-Cable-IO-and-Notificat.patch +++ b/patch/0078-mlxsw-reg-Add-Management-Cable-IO-and-Notifications-.patch @@ -1,6 +1,7 @@ +From 19ba46cee9e3610173c050667eefa3ef6609f4fc Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Fri, 30 Jul 2021 17:46:31 +0300 -Subject: 0078 mlxsw: reg: Add Management Cable IO and +Subject: [PATCH backport 5.10 078/182] mlxsw: reg: Add Management Cable IO and Notifications register Add the Management Cable IO and Notifications register. It will be used @@ -65,5 +66,5 @@ index 0cc2fdaa459e..7f9b902049db 100644 MLXSW_REG(mtutc), MLXSW_REG(mpsc), -- -2.17.1 +2.20.1 diff --git a/patch/0079-mlxsw-Add-ability-to-control-transceiver-module.patch b/patch/0079-mlxsw-Add-ability-to-control-transceiver-modules-pow.patch similarity index 98% rename from patch/0079-mlxsw-Add-ability-to-control-transceiver-module.patch rename to patch/0079-mlxsw-Add-ability-to-control-transceiver-modules-pow.patch index b321ecfcd8af..96af1a6dd0c1 100644 --- a/patch/0079-mlxsw-Add-ability-to-control-transceiver-module.patch +++ b/patch/0079-mlxsw-Add-ability-to-control-transceiver-modules-pow.patch @@ -1,7 +1,8 @@ +From 7c7e9508c2bdc91c3c1cbc345b0ce816388690e6 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Mon, 16 Aug 2021 16:58:34 +0300 -Subject: 0079 mlxsw: Add ability to control transceiver modules' - power mode +Subject: [PATCH backport 5.10 079/182] mlxsw: Add ability to control + transceiver modules' power mode Implement support for ethtool_ops::.get_module_power_mode and ethtool_ops::set_module_power_mode. @@ -373,5 +374,5 @@ index d8659ff68ffe..3d07c2dcf08d 100644 static int -- -2.17.1 +2.20.1 diff --git a/patch/0080-ethtool-Add-transceiver-module-extended-states.patch b/patch/0080-ethtool-Add-transceiver-module-extended-states.patch index 7c90b505c6fd..7a128c4b9dcd 100644 --- a/patch/0080-ethtool-Add-transceiver-module-extended-states.patch +++ b/patch/0080-ethtool-Add-transceiver-module-extended-states.patch @@ -1,6 +1,8 @@ +From 3c154bac56bbf44419a17a431e931706550082a2 Mon Sep 17 00:00:00 2001 From: Ido Schimmel Date: Wed, 18 Aug 2021 10:13:47 +0300 -Subject: 0080 ethtool: Add transceiver module extended states +Subject: [PATCH backport 5.10 080/182] ethtool: Add transceiver module + extended states Add an extended state and two extended sub-states to describe link issues related to transceiver modules. @@ -86,5 +88,5 @@ index d49bad6446f9..970f1446eaf7 100644 /** -- -2.17.1 +2.20.1 diff --git a/patch/0081-platform-x86-mlx-platform-Add-support-for-multi.patch b/patch/0081-platform-x86-mlx-platform-Add-support-for-multiply-c.patch similarity index 77% rename from patch/0081-platform-x86-mlx-platform-Add-support-for-multi.patch rename to patch/0081-platform-x86-mlx-platform-Add-support-for-multiply-c.patch index 089608a4b421..8f4162310b76 100644 --- a/patch/0081-platform-x86-mlx-platform-Add-support-for-multi.patch +++ b/patch/0081-platform-x86-mlx-platform-Add-support-for-multiply-c.patch @@ -1,7 +1,8 @@ +From 7de97d7e381e768ea11ad1f3520261d5e77c1ab4 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Thu, 19 Aug 2021 14:23:39 +0000 -Subject: 0081 platform/x86: mlx-platform: Add support for - multiply cooling devices +Subject: [PATCH backport 5.10 081/182] platform/x86: mlx-platform: Add support + for multiply cooling devices Add new registers to support systems with multiply cooling devices. Modular systems support up-to four cooling devices. This capability @@ -14,10 +15,10 @@ Reviewed-by: Michael 1 file changed, 12 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index 950d90e6412a..3d017e889ce5 100644 +index 614b9f5c673f..5c91410a649b 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c -@@ -3469,6 +3469,18 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_fan_data[] = { +@@ -3688,6 +3688,18 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_fan_data[] = { .label = "pwm1", .reg = MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET, }, @@ -37,5 +38,5 @@ index 950d90e6412a..3d017e889ce5 100644 .label = "tacho1", .reg = MLXPLAT_CPLD_LPC_REG_TACHO1_OFFSET, -- -2.17.1 +2.20.1 diff --git a/patch/0082-mlxsw-core-Extend-external-cooling-device-whitelist-.patch b/patch/0082-mlxsw-core-Extend-external-cooling-device-whitelist-.patch index 861590abad3f..0c752860c622 100644 --- a/patch/0082-mlxsw-core-Extend-external-cooling-device-whitelist-.patch +++ b/patch/0082-mlxsw-core-Extend-external-cooling-device-whitelist-.patch @@ -1,8 +1,8 @@ -From 7ea34bd6ec1453e21f9f1d9442ea662a92423f32 Mon Sep 17 00:00:00 2001 +From 7fbd7c25c4010e8e5fbbc0d8741cff9c69bcea05 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Thu, 7 Oct 2021 19:30:05 +0000 -Subject: [PATCH backport 5.10/Alligator 1/9] mlxsw: core: Extend external - cooling device whitelist for thermal zone binding +Subject: [PATCH backport 5.10 082/182] mlxsw: core: Extend external cooling + device whitelist for thermal zone binding Allow thermal zone binding to an external cooling device of type "emc2305". @@ -17,10 +17,10 @@ Signed-off-by: Vadim Pasternak 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -index f9c9ebf68..cc4cddbdb 100644 +index e1a760519097..91abc7a3f7ea 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -38,6 +38,7 @@ +@@ -30,6 +30,7 @@ /* External cooling devices, allowed for binding to mlxsw thermal zones. */ static char * const mlxsw_thermal_external_allowed_cdev[] = { "mlxreg_fan", diff --git a/patch/0083-platform_data-mlxreg-Add-field-for-notification-call.patch b/patch/0083-platform_data-mlxreg-Add-field-for-notification-call.patch index e4db5b24000d..14f636f17ecc 100644 --- a/patch/0083-platform_data-mlxreg-Add-field-for-notification-call.patch +++ b/patch/0083-platform_data-mlxreg-Add-field-for-notification-call.patch @@ -1,7 +1,8 @@ -From abcebcd39fe094b68826cc04f2eca835606697f9 Mon Sep 17 00:00:00 2001 +From 2290cad212a30a34b3007c6cba5fa615d4c50a0e Mon Sep 17 00:00:00 2001 From: Michael Shych Date: Sat, 30 Apr 2022 14:58:07 +0300 -Subject: [PATCH] platform_data/mlxreg: Add field for notification callback +Subject: [PATCH backport 5.10 083/182] platform_data/mlxreg: Add field for + notification callback Add notification callback to inform caller that platform driver probing has been completed. It allows to caller to perform some initialization @@ -12,12 +13,14 @@ Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220430115809.54565-2-michaelsh@nvidia.com Signed-off-by: Hans de Goede --- + include/linux/platform_data/mlxreg.h | 4 ++++ + 1 file changed, 4 insertions(+) diff --git a/include/linux/platform_data/mlxreg.h b/include/linux/platform_data/mlxreg.h index 40185f9d7c14..a6bd74e29b6b 100644 --- a/include/linux/platform_data/mlxreg.h +++ b/include/linux/platform_data/mlxreg.h -@@ -216,6 +216,8 @@ +@@ -216,6 +216,8 @@ struct mlxreg_core_platform_data { * @mask_low: low aggregation interrupt common mask; * @deferred_nr: I2C adapter number must be exist prior probing execution; * @shift_nr: I2C adapter numbers must be incremented by this value; @@ -26,7 +29,7 @@ index 40185f9d7c14..a6bd74e29b6b 100644 */ struct mlxreg_core_hotplug_platform_data { struct mlxreg_core_item *items; -@@ -228,6 +230,8 @@ +@@ -228,6 +230,8 @@ struct mlxreg_core_hotplug_platform_data { u32 mask_low; int deferred_nr; int shift_nr; @@ -35,3 +38,6 @@ index 40185f9d7c14..a6bd74e29b6b 100644 }; #endif /* __LINUX_PLATFORM_DATA_MLXREG_H */ +-- +2.20.1 + diff --git a/patch/0084-i2c-mlxcpld-Add-callback-to-notify-probing-completio.patch b/patch/0084-i2c-mlxcpld-Add-callback-to-notify-probing-completio.patch index 5cb7086041cf..d21bda998928 100644 --- a/patch/0084-i2c-mlxcpld-Add-callback-to-notify-probing-completio.patch +++ b/patch/0084-i2c-mlxcpld-Add-callback-to-notify-probing-completio.patch @@ -1,8 +1,8 @@ -From 81abceea27623640f0d69d1526cb6d11d964025d Mon Sep 17 00:00:00 2001 +From eea982a68f01f3e5e63e88d147f581b5c751dc81 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Thu, 7 Oct 2021 19:04:25 +0000 -Subject: [PATCH backport 5.10/Alligator 3/9] i2c: mlxcpld: Add callback to - notify probing completion +Subject: [PATCH backport 5.10 084/182] i2c: mlxcpld: Add callback to notify + probing completion Add notification to inform caller that driver probing has been completed. It allows to user, invoked platform device registration for @@ -15,7 +15,7 @@ Signed-off-by: Vadim Pasternak 1 file changed, 4 insertions(+) diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c -index 56aa424fd..fb451d42a 100644 +index 56aa424fd71d..363ea9fd66c4 100644 --- a/drivers/i2c/busses/i2c-mlxcpld.c +++ b/drivers/i2c/busses/i2c-mlxcpld.c @@ -560,6 +560,10 @@ static int mlxcpld_i2c_probe(struct platform_device *pdev) diff --git a/patch/0085-hwmon-powr1220-Upgrade-driver-to-support-hwmon-info-.patch b/patch/0085-hwmon-powr1220-Upgrade-driver-to-support-hwmon-info-.patch index 2e72be61aeb2..499379a2896a 100644 --- a/patch/0085-hwmon-powr1220-Upgrade-driver-to-support-hwmon-info-.patch +++ b/patch/0085-hwmon-powr1220-Upgrade-driver-to-support-hwmon-info-.patch @@ -1,8 +1,8 @@ -From 915d4664b7158d8d0f44da810186742c69300f02 Mon Sep 17 00:00:00 2001 +From 8a3f701439798d55a93bba1f56d2a2aab4921293 Mon Sep 17 00:00:00 2001 From: Michael Shych Date: Tue, 18 Jan 2022 09:56:10 +0200 -Subject: [PATCH] hwmon: (powr1220) Upgrade driver to support hwmon info - infrastructure +Subject: [PATCH backport 5.10 085/182] hwmon: (powr1220) Upgrade driver to + support hwmon info infrastructure Reduce code by using devm_hwmon_device_register_with_groups() API by devm_hwmon_device_register_with_info() API. @@ -14,14 +14,14 @@ Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220118075611.10665-3-michaelsh@nvidia.com Signed-off-by: Guenter Roeck --- - drivers/hwmon/powr1220.c | 207 +++++++++++++++++++++-------------------------- - 1 file changed, 92 insertions(+), 115 deletions(-) + drivers/hwmon/powr1220.c | 213 +++++++++++++++++---------------------- + 1 file changed, 95 insertions(+), 118 deletions(-) diff --git a/drivers/hwmon/powr1220.c b/drivers/hwmon/powr1220.c -index 542e4a7b0234..0fa1a136eec8 100644 +index 9e086338dcba..0fa1a136eec8 100644 --- a/drivers/hwmon/powr1220.c +++ b/drivers/hwmon/powr1220.c -@@ -111,7 +111,7 @@ +@@ -111,7 +111,7 @@ static int powr1220_read_adc(struct device *dev, int ch_num) mutex_lock(&data->update_lock); if (time_after(jiffies, data->adc_last_updated[ch_num] + HZ) || @@ -30,7 +30,7 @@ index 542e4a7b0234..0fa1a136eec8 100644 /* * figure out if we need to use the attenuator for * high inputs or inputs that we don't yet have a measurement -@@ -119,12 +119,12 @@ +@@ -119,12 +119,12 @@ static int powr1220_read_adc(struct device *dev, int ch_num) * max reading. */ if (data->adc_maxes[ch_num] > ADC_MAX_LOW_MEASUREMENT_MV || @@ -45,7 +45,7 @@ index 542e4a7b0234..0fa1a136eec8 100644 if (result) goto exit; -@@ -167,135 +167,109 @@ +@@ -167,135 +167,109 @@ static int powr1220_read_adc(struct device *dev, int ch_num) return result; } @@ -119,8 +119,7 @@ index 542e4a7b0234..0fa1a136eec8 100644 - struct sensor_device_attribute *attr = to_sensor_dev_attr(dev_attr); + struct powr1220_data *data = dev_get_drvdata(dev); + int ret; - -- return sprintf(buf, "%s\n", input_names[attr->index]); ++ + switch (type) { + case hwmon_in: + switch (attr) { @@ -139,6 +138,10 @@ index 542e4a7b0234..0fa1a136eec8 100644 + break; + default: + return -EOPNOTSUPP; ++} + +- return sprintf(buf, "%s\n", input_names[attr->index]); ++ return 0; } -static SENSOR_DEVICE_ATTR_RO(in0_input, powr1220_voltage, VMON1); @@ -231,9 +234,6 @@ index 542e4a7b0234..0fa1a136eec8 100644 - &sensor_dev_attr_in11_label.dev_attr.attr, - &sensor_dev_attr_in12_label.dev_attr.attr, - &sensor_dev_attr_in13_label.dev_attr.attr, -+ return 0; -+} -+ +static const struct hwmon_channel_info *powr1220_info[] = { + HWMON_CHANNEL_INFO(in, + HWMON_I_INPUT | HWMON_I_HIGHEST | HWMON_I_LABEL, @@ -268,7 +268,7 @@ index 542e4a7b0234..0fa1a136eec8 100644 static int powr1220_probe(struct i2c_client *client) { -@@ -312,8 +286,11 @@ +@@ -312,8 +286,11 @@ static int powr1220_probe(struct i2c_client *client) mutex_init(&data->update_lock); data->client = client; @@ -282,3 +282,6 @@ index 542e4a7b0234..0fa1a136eec8 100644 return PTR_ERR_OR_ZERO(hwmon_dev); } +-- +2.20.1 + diff --git a/patch/0086-hwmon-powr1220-Add-support-for-Lattice-s-POWR1014-po.patch b/patch/0086-hwmon-powr1220-Add-support-for-Lattice-s-POWR1014-po.patch index 39ccdcc41dec..949fcae0dd22 100644 --- a/patch/0086-hwmon-powr1220-Add-support-for-Lattice-s-POWR1014-po.patch +++ b/patch/0086-hwmon-powr1220-Add-support-for-Lattice-s-POWR1014-po.patch @@ -1,8 +1,8 @@ -From 9f93aa1005fa1b960f10e0ee3ed8c4e697526053 Mon Sep 17 00:00:00 2001 +From 6e39043862ce94cedaeabbb501feab34f7060ef5 Mon Sep 17 00:00:00 2001 From: Michael Shych Date: Tue, 18 Jan 2022 09:56:11 +0200 -Subject: [PATCH] hwmon: (powr1220) Add support for Lattice's POWR1014 power - manager IC +Subject: [PATCH backport 5.10 086/182] hwmon: (powr1220) Add support for + Lattice's POWR1014 power manager IC This patch adds support for Lattice's POWR1014 power manager IC. Read access to all the ADCs on the chip are supported through @@ -17,6 +17,8 @@ Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220118075611.10665-4-michaelsh@nvidia.com Signed-off-by: Guenter Roeck --- + drivers/hwmon/powr1220.c | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/powr1220.c b/drivers/hwmon/powr1220.c index 0fa1a136eec8..f77dc6db31ac 100644 @@ -31,7 +33,7 @@ index 0fa1a136eec8..f77dc6db31ac 100644 enum powr1220_regs { VMON_STATUS0, VMON_STATUS1, -@@ -74,6 +76,7 @@ +@@ -74,6 +76,7 @@ enum powr1220_adc_values { struct powr1220_data { struct i2c_client *client; struct mutex update_lock; @@ -39,7 +41,7 @@ index 0fa1a136eec8..f77dc6db31ac 100644 bool adc_valid[MAX_POWR1220_ADC_VALUES]; /* the next value is in jiffies */ unsigned long adc_last_updated[MAX_POWR1220_ADC_VALUES]; -@@ -171,6 +174,11 @@ +@@ -171,6 +174,11 @@ static umode_t powr1220_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr, int channel) { @@ -51,7 +53,7 @@ index 0fa1a136eec8..f77dc6db31ac 100644 switch (type) { case hwmon_in: switch (attr) { -@@ -271,6 +279,8 @@ +@@ -271,6 +279,8 @@ static const struct hwmon_chip_info powr1220_chip_info = { .info = powr1220_info, }; @@ -60,7 +62,7 @@ index 0fa1a136eec8..f77dc6db31ac 100644 static int powr1220_probe(struct i2c_client *client) { struct powr1220_data *data; -@@ -283,6 +293,15 @@ +@@ -283,6 +293,15 @@ static int powr1220_probe(struct i2c_client *client) if (!data) return -ENOMEM; @@ -76,7 +78,7 @@ index 0fa1a136eec8..f77dc6db31ac 100644 mutex_init(&data->update_lock); data->client = client; -@@ -296,7 +315,8 @@ +@@ -296,7 +315,8 @@ static int powr1220_probe(struct i2c_client *client) } static const struct i2c_device_id powr1220_ids[] = { @@ -86,3 +88,6 @@ index 0fa1a136eec8..f77dc6db31ac 100644 { } }; +-- +2.20.1 + diff --git a/patch/0087-hwmon-Add-support-for-EMC2305-RPM-based-PWM-Fan-Spee.patch b/patch/0087-hwmon-Add-support-for-EMC2305-RPM-based-PWM-Fan-Spee.patch index 608c96620e00..ddcf2b4d91c7 100644 --- a/patch/0087-hwmon-Add-support-for-EMC2305-RPM-based-PWM-Fan-Spee.patch +++ b/patch/0087-hwmon-Add-support-for-EMC2305-RPM-based-PWM-Fan-Spee.patch @@ -1,7 +1,7 @@ -From 9665518f7ec26d85930b57343b68da8f7524119e Mon Sep 17 00:00:00 2001 +From d439a8e75600c9919c8f1380c18a5141d271412a Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Sat, 9 Oct 2021 08:49:14 +0000 -Subject: [PATCH backport 5.10/Alligator 6/9] hwmon: Add support for EMC2305 +Subject: [PATCH backport 5.10 087/182] hwmon: Add support for EMC2305 RPM-based PWM Fan Speed Controller Introduce EMC2305 RPM-based PWM Fan Speed Controller @@ -22,12 +22,12 @@ Signed-off-by: Michael Shych --- drivers/hwmon/Kconfig | 12 + drivers/hwmon/Makefile | 1 + - drivers/hwmon/emc2305.c | 518 ++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 531 insertions(+) + drivers/hwmon/emc2305.c | 522 ++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 535 insertions(+) create mode 100644 drivers/hwmon/emc2305.c diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig -index a850e4f0e..6512c0c5b 100644 +index f741c7492ee4..93d0313aa210 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -1601,6 +1601,18 @@ config SENSORS_EMC2103 @@ -50,7 +50,7 @@ index a850e4f0e..6512c0c5b 100644 tristate "SMSC EMC6W201" depends on I2C diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile -index 9db2903b6..644a7e6ee 100644 +index 9db2903b61e5..644a7e6eeae6 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile @@ -66,6 +66,7 @@ obj-$(CONFIG_SENSORS_DS620) += ds620.o @@ -63,10 +63,10 @@ index 9db2903b6..644a7e6ee 100644 obj-$(CONFIG_SENSORS_F71882FG) += f71882fg.o diff --git a/drivers/hwmon/emc2305.c b/drivers/hwmon/emc2305.c new file mode 100644 -index 000000000..3f98bdcd2 +index 000000000000..04bc9f658d85 --- /dev/null +++ b/drivers/hwmon/emc2305.c -@@ -0,0 +1,523 @@ +@@ -0,0 +1,522 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Hardware monitoring driver for EMC2305 fan controller @@ -589,7 +589,6 @@ index 000000000..3f98bdcd2 +MODULE_AUTHOR("Claud Chang "); +MODULE_DESCRIPTION("SMSC EMC2305 fan controller driver"); +MODULE_LICENSE("GPL"); -+ --- +-- 2.20.1 diff --git a/patch/0088-dt-bindings-Add-description-for-EMC2305-for-RPM-base.patch b/patch/0088-dt-bindings-Add-description-for-EMC2305-for-RPM-base.patch deleted file mode 100644 index 372408fe2449..000000000000 --- a/patch/0088-dt-bindings-Add-description-for-EMC2305-for-RPM-base.patch +++ /dev/null @@ -1,69 +0,0 @@ -From f725a91ddff83408baefcb2ac7e81aeb478079f9 Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Sat, 16 Oct 2021 10:52:13 +0000 -Subject: [PATCH backport 5.10/Alligator 7/9] dt-bindings: Add description for - EMC2305 for RPM-based PWM Fan Speed Controller - -Michrochip EMC2305 RPM-based PWM Fan Speed Controller. - -Signed-off-by: Michael Shych ---- - .../devicetree/bindings/hwmon/emc2305.yaml | 46 +++++++++++++++++++ - 1 file changed, 46 insertions(+) - create mode 100644 Documentation/devicetree/bindings/hwmon/emc2305.yaml - -diff --git a/Documentation/devicetree/bindings/hwmon/emc2305.yaml b/Documentation/devicetree/bindings/hwmon/emc2305.yaml -new file mode 100644 -index 000000000..8a46c02a3 ---- /dev/null -+++ b/Documentation/devicetree/bindings/hwmon/emc2305.yaml -@@ -0,0 +1,46 @@ -+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) -+%YAML 1.2 -+--- -+ -+$id: http://devicetree.org/schemas/hwmon/emc2305.yaml# -+$schema: http://devicetree.org/meta-schemas/core.yaml# -+ -+title: RPM-based PWM Fan Speed Controller EMC2305 -+ -+maintainers: -+ - Claud Chang -+ -+properties: -+ compatible: -+ enum: -+ - emc2305 -+ -+ emc2305,min-pwm: -+ description: -+ Min pwm of emc2305 -+ maxItems: 1 -+ emc2305,max-pwm: -+ description: -+ Max pwm of emc2305 -+ maxItems: 1 -+ emc2305,cooling-levels: -+ description: -+ Quantity of cooling level state. -+ maxItems: 1 -+ -+required: -+ - compatible -+ - emc2305,min-pwm -+ - emc2305,max-pwm -+ - emc2305,cooling-levels -+ -+additionalProperties: false -+ -+examples: -+ - | -+ fan@1 { -+ compatible = "smsc,emc2305"; -+ emc2305,min-pwm = <0>; -+ emc2305,max-pwm = <255>; -+ emc2305,cooling-levels = <10>; -+ } --- -2.20.1 - diff --git a/patch/0089-platform-mellanox-Add-support-for-new-SN2201-system.patch b/patch/0089-platform-mellanox-Add-support-for-new-SN2201-system.patch index 4b354ae37320..389047ea78e2 100644 --- a/patch/0089-platform-mellanox-Add-support-for-new-SN2201-system.patch +++ b/patch/0089-platform-mellanox-Add-support-for-new-SN2201-system.patch @@ -1,7 +1,8 @@ -From 662f24826f954d49d56211822bcd7b3109287961 Mon Sep 17 00:00:00 2001 +From dac063a274f4553f3ea0cf17a37dece1d9ea1207 Mon Sep 17 00:00:00 2001 From: Michael Shych Date: Sat, 30 Apr 2022 14:58:08 +0300 -Subject: [PATCH] platform/mellanox: Add support for new SN2201 system +Subject: [PATCH backport 5.10 089/182] platform/mellanox: Add support for new + SN2201 system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -38,11 +39,17 @@ Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220430115809.54565-3-michaelsh@nvidia.com Signed-off-by: Hans de Goede --- + drivers/platform/mellanox/Kconfig | 17 + + drivers/platform/mellanox/Makefile | 1 + + drivers/platform/mellanox/nvsw-sn2201.c | 1261 +++++++++++++++++++++++ + 3 files changed, 1279 insertions(+) + create mode 100644 drivers/platform/mellanox/nvsw-sn2201.c + diff --git a/drivers/platform/mellanox/Kconfig b/drivers/platform/mellanox/Kconfig -index d4c5c170bca0..72df4b8f4dd8 100644 +index 8f6c89f0b4ff..75e2bee17606 100644 --- a/drivers/platform/mellanox/Kconfig +++ b/drivers/platform/mellanox/Kconfig -@@ -68,4 +68,21 @@ +@@ -68,4 +68,21 @@ config MLXBF_BOOTCTL to the userspace tools, to be used in conjunction with the eMMC device driver to do necessary initial swap of the boot partition. @@ -65,17 +72,17 @@ index d4c5c170bca0..72df4b8f4dd8 100644 + endif # MELLANOX_PLATFORM diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile -index a4868366ff18..04703c0416b1 100644 +index e47b6b064881..6af37ee88861 100644 --- a/drivers/platform/mellanox/Makefile +++ b/drivers/platform/mellanox/Makefile -@@ -8,3 +8,4 @@ +@@ -8,3 +8,4 @@ obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o obj-$(CONFIG_MLXREG_IO) += mlxreg-io.o obj-$(CONFIG_MLXREG_LC) += mlxreg-lc.o +obj-$(CONFIG_NVSW_SN2201) += nvsw-sn2201.o diff --git a/drivers/platform/mellanox/nvsw-sn2201.c b/drivers/platform/mellanox/nvsw-sn2201.c new file mode 100644 -index 000000000000..0bcdc7c75007 +index 000000000000..51da240ce4f9 --- /dev/null +++ b/drivers/platform/mellanox/nvsw-sn2201.c @@ -0,0 +1,1261 @@ @@ -1340,3 +1347,6 @@ index 000000000000..0bcdc7c75007 +MODULE_DESCRIPTION("Nvidia sn2201 platform driver"); +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_ALIAS("platform:nvsw-sn2201"); +-- +2.20.1 + diff --git a/patch/0090-Documentation-ABI-Add-new-attributes-for-mlxreg-io-s.patch b/patch/0090-Documentation-ABI-Add-new-attributes-for-mlxreg-io-s.patch index 14b729ea9c5d..4e5fdc7582ae 100644 --- a/patch/0090-Documentation-ABI-Add-new-attributes-for-mlxreg-io-s.patch +++ b/patch/0090-Documentation-ABI-Add-new-attributes-for-mlxreg-io-s.patch @@ -1,8 +1,8 @@ -From b1a9c69792caaac0813c9dc7806fb8654212e56c Mon Sep 17 00:00:00 2001 +From d563b6d291495af320cbbd5733933bc09855080c Mon Sep 17 00:00:00 2001 From: Michael Shych Date: Sat, 30 Apr 2022 14:58:09 +0300 -Subject: [PATCH] Documentation/ABI: Add new attributes for mlxreg-io sysfs - interfaces +Subject: [PATCH backport 5.10 090/182] Documentation/ABI: Add new attributes + for mlxreg-io sysfs interfaces Add documentation for the new attributes: - "phy_reset" - Reset PHY. @@ -14,14 +14,14 @@ Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220430115809.54565-4-michaelsh@nvidia.com Signed-off-by: Hans de Goede --- - Documentation/ABI/stable/sysfs-driver-mlxreg-io | 36 +++++++++++++++++++++++++ + .../ABI/stable/sysfs-driver-mlxreg-io | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Documentation/ABI/stable/sysfs-driver-mlxreg-io b/Documentation/ABI/stable/sysfs-driver-mlxreg-io -index 12c3f895cd2f..b312242d4f40 100644 +index e2f938499473..0913a8daf767 100644 --- a/Documentation/ABI/stable/sysfs-driver-mlxreg-io +++ b/Documentation/ABI/stable/sysfs-driver-mlxreg-io -@@ -451,3 +451,39 @@ +@@ -451,3 +451,39 @@ Description: These files provide the maximum powered required for line card feeding and line card configuration Id. The files are read only. @@ -61,3 +61,6 @@ index 12c3f895cd2f..b312242d4f40 100644 + 0 - Power good, 1 - Not power good. + + The files are read only. +-- +2.20.1 + diff --git a/patch/0091-platform-x86-mlx-platform-Add-support-for-new-s.patch b/patch/0091-platform-x86-mlx-platform-Add-support-for-new-system.patch similarity index 90% rename from patch/0091-platform-x86-mlx-platform-Add-support-for-new-s.patch rename to patch/0091-platform-x86-mlx-platform-Add-support-for-new-system.patch index 4bdd1707f8cf..043f348c524e 100644 --- a/patch/0091-platform-x86-mlx-platform-Add-support-for-new-s.patch +++ b/patch/0091-platform-x86-mlx-platform-Add-support-for-new-system.patch @@ -1,7 +1,8 @@ +From ececae8bc325e3b01f36fd694e45a4cbbad334e4 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Sat, 23 Oct 2021 12:40:22 +0300 -Subject: 0091 platform/x86: mlx-platform: Add support for new - system SGN2410 +Subject: [PATCH backport 5.10 091/182] platform/x86: mlx-platform: Add support + for new system SGN2410 Add support for new system type, which is a water-cooling flavor of the VMOD001 system class, equipped with 48xSFP28 and 8xQSFP28 @@ -20,10 +21,10 @@ Signed-off-by: Hans de Goede 1 file changed, 113 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index 3d017e889ce5..447044fdcb77 100644 +index 5c91410a649b..fac4b6dcfdc7 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c -@@ -533,6 +533,21 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_pwr_items_data[] = { +@@ -534,6 +534,21 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_pwr_items_data[] = { }, }; @@ -45,7 +46,7 @@ index 3d017e889ce5..447044fdcb77 100644 static struct mlxreg_core_data mlxplat_mlxcpld_default_fan_items_data[] = { { .label = "fan1", -@@ -661,6 +676,46 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_data = { +@@ -662,6 +677,46 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_data = { .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW, }; @@ -92,7 +93,7 @@ index 3d017e889ce5..447044fdcb77 100644 static struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_comex_data = { .items = mlxplat_mlxcpld_comex_items, -@@ -2018,6 +2073,35 @@ static struct mlxreg_core_platform_data mlxplat_default_led_data = { +@@ -2119,6 +2174,35 @@ static struct mlxreg_core_platform_data mlxplat_default_led_data = { .counter = ARRAY_SIZE(mlxplat_mlxcpld_default_led_data), }; @@ -128,7 +129,7 @@ index 3d017e889ce5..447044fdcb77 100644 /* Platform led MSN21xx system family data */ static struct mlxreg_core_data mlxplat_mlxcpld_msn21xx_led_data[] = { { -@@ -4311,6 +4395,28 @@ static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) +@@ -4631,6 +4715,28 @@ static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) return 1; } @@ -157,7 +158,7 @@ index 3d017e889ce5..447044fdcb77 100644 static int __init mlxplat_dmi_msn21xx_matched(const struct dmi_system_id *dmi) { int i; -@@ -4474,6 +4580,13 @@ static int __init mlxplat_dmi_modular_matched(const struct dmi_system_id *dmi) +@@ -4820,6 +4926,13 @@ static int __init mlxplat_dmi_qmb8700_matched(const struct dmi_system_id *dmi) } static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { @@ -172,5 +173,5 @@ index 3d017e889ce5..447044fdcb77 100644 .callback = mlxplat_dmi_default_matched, .matches = { -- -2.17.1 +2.20.1 diff --git a/patch/0092-platform-mellanox-mlxreg-lc-fix-error-code-in-m.patch b/patch/0092-platform-mellanox-mlxreg-lc-fix-error-code-in-mlxreg.patch similarity index 87% rename from patch/0092-platform-mellanox-mlxreg-lc-fix-error-code-in-m.patch rename to patch/0092-platform-mellanox-mlxreg-lc-fix-error-code-in-mlxreg.patch index ab6ef6203a94..963dae598b6f 100644 --- a/patch/0092-platform-mellanox-mlxreg-lc-fix-error-code-in-m.patch +++ b/patch/0092-platform-mellanox-mlxreg-lc-fix-error-code-in-mlxreg.patch @@ -1,7 +1,8 @@ +From 925c0bdeb184d3ec04cc6dd46f9e9b0c2f27ac7c Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 10 Nov 2021 10:43:46 +0300 -Subject: 0092 platform/mellanox: mlxreg-lc: fix error code in - mlxreg_lc_create_static_devices() +Subject: [PATCH backport 5.10 092/182] platform/mellanox: mlxreg-lc: fix error + code in mlxreg_lc_create_static_devices() This code should be using PTR_ERR() instead of IS_ERR(). And because it's using the wrong "dev->client" pointer, the IS_ERR() check will be @@ -18,7 +19,7 @@ Signed-off-by: Hans de Goede 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/platform/mellanox/mlxreg-lc.c b/drivers/platform/mellanox/mlxreg-lc.c -index c2ccb38df693..244676a12d74 100644 +index 2ddad96b154a..75c28179dd07 100644 --- a/drivers/platform/mellanox/mlxreg-lc.c +++ b/drivers/platform/mellanox/mlxreg-lc.c @@ -420,7 +420,7 @@ mlxreg_lc_create_static_devices(struct mlxreg_lc *mlxreg_lc, struct mlxreg_hotpl @@ -48,5 +49,5 @@ index c2ccb38df693..244676a12d74 100644 static void -- -2.17.1 +2.20.1 diff --git a/patch/0093-hwmon-mlxreg-fan-Extend-driver-to-support-multi.patch b/patch/0093-hwmon-mlxreg-fan-Extend-driver-to-support-multiply-P.patch similarity index 96% rename from patch/0093-hwmon-mlxreg-fan-Extend-driver-to-support-multi.patch rename to patch/0093-hwmon-mlxreg-fan-Extend-driver-to-support-multiply-P.patch index 57d29b04b36f..611af1d0c939 100644 --- a/patch/0093-hwmon-mlxreg-fan-Extend-driver-to-support-multi.patch +++ b/patch/0093-hwmon-mlxreg-fan-Extend-driver-to-support-multiply-P.patch @@ -1,7 +1,8 @@ +From fc25f37b0269b04b9853c2d62a80e0542f47506d Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Thu, 16 Sep 2021 22:47:18 +0300 -Subject: 0093 hwmon: (mlxreg-fan) Extend driver to support - multiply PWM +Subject: [PATCH backport 5.10 093/182] hwmon: (mlxreg-fan) Extend driver to + support multiply PWM Add additional PWM attributes in order to support the systems, which can be equipped with up-to four PWM controllers. System capability of @@ -16,7 +17,7 @@ Signed-off-by: Guenter Roeck 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c -index 35c283405df6..efc16ee09153 100644 +index 0f5b109817a7..1a146cc4b0fd 100644 --- a/drivers/hwmon/mlxreg-fan.c +++ b/drivers/hwmon/mlxreg-fan.c @@ -13,6 +13,8 @@ @@ -179,5 +180,5 @@ index 35c283405df6..efc16ee09153 100644 if (configured) { dev_err(fan->dev, "duplicate conf entry: %s\n", -- -2.17.1 +2.20.1 diff --git a/patch/0094-hwmon-mlxreg-fan-Extend-driver-to-support-multi.patch b/patch/0094-hwmon-mlxreg-fan-Extend-driver-to-support-multiply-c.patch similarity index 95% rename from patch/0094-hwmon-mlxreg-fan-Extend-driver-to-support-multi.patch rename to patch/0094-hwmon-mlxreg-fan-Extend-driver-to-support-multiply-c.patch index 88e9e12125dd..2b5c5b6cf8d5 100644 --- a/patch/0094-hwmon-mlxreg-fan-Extend-driver-to-support-multi.patch +++ b/patch/0094-hwmon-mlxreg-fan-Extend-driver-to-support-multiply-c.patch @@ -1,7 +1,8 @@ +From 6518f8a96184e989d93b17700ac110da30ec8b53 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Fri, 17 Sep 2021 00:31:28 +0300 -Subject: 0094 hwmon: (mlxreg-fan) Extend driver to support - multiply cooling devices +Subject: [PATCH backport 5.10 094/182] hwmon: (mlxreg-fan) Extend driver to + support multiply cooling devices Add support for additional cooling devices in order to support the systems, which can be equipped with up-to four PWM controllers. @@ -13,7 +14,7 @@ Signed-off-by: Guenter Roeck 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c -index efc16ee09153..b7d9b38e1175 100644 +index 1a146cc4b0fd..35228ed112d7 100644 --- a/drivers/hwmon/mlxreg-fan.c +++ b/drivers/hwmon/mlxreg-fan.c @@ -63,6 +63,8 @@ @@ -88,7 +89,7 @@ index efc16ee09153..b7d9b38e1175 100644 int i, config = 0; u32 regval; @@ -348,11 +354,11 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, - config = 0; /*1*/; + config = 1; state -= MLXREG_FAN_MAX_STATE; for (i = 0; i < state; i++) - fan->cooling_levels[i] = state; @@ -172,5 +173,5 @@ index efc16ee09153..b7d9b38e1175 100644 static struct platform_driver mlxreg_fan_driver = { -- -2.17.1 +2.20.1 diff --git a/patch/0095-hwmon-mlxreg-fan-Fix-out-of-bounds-read-on-arra.patch b/patch/0095-hwmon-mlxreg-fan-Fix-out-of-bounds-read-on-array-fan.patch similarity index 84% rename from patch/0095-hwmon-mlxreg-fan-Fix-out-of-bounds-read-on-arra.patch rename to patch/0095-hwmon-mlxreg-fan-Fix-out-of-bounds-read-on-array-fan.patch index 1974b6ffc510..a1e16a23f4f2 100644 --- a/patch/0095-hwmon-mlxreg-fan-Fix-out-of-bounds-read-on-arra.patch +++ b/patch/0095-hwmon-mlxreg-fan-Fix-out-of-bounds-read-on-array-fan.patch @@ -1,7 +1,8 @@ +From 3e3dcc8a418d6901578e20b081bbf75f2c7a7316 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Mon, 20 Sep 2021 19:09:21 +0100 -Subject: 0095 hwmon: (mlxreg-fan) Fix out of bounds read on - array fan->pwm +Subject: [PATCH backport 5.10 095/182] hwmon: (mlxreg-fan) Fix out of bounds + read on array fan->pwm Array fan->pwm[] is MLXREG_FAN_MAX_PWM elements in size, however the for-loop has a off-by-one error causing index i to be out of range @@ -19,7 +20,7 @@ Signed-off-by: Guenter Roeck 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c -index b7d9b38e1175..21190020172a 100644 +index 35228ed112d7..feab9ec6a6ca 100644 --- a/drivers/hwmon/mlxreg-fan.c +++ b/drivers/hwmon/mlxreg-fan.c @@ -554,7 +554,7 @@ static int mlxreg_fan_cooling_config(struct device *dev, struct mlxreg_fan *fan) @@ -32,5 +33,5 @@ index b7d9b38e1175..21190020172a 100644 if (!pwm->connected) -- -2.17.1 +2.20.1 diff --git a/patch/0096-hwmon-mlxreg-fan-Modify-PWM-connectivity-valida.patch b/patch/0096-hwmon-mlxreg-fan-Modify-PWM-connectivity-validation.patch similarity index 85% rename from patch/0096-hwmon-mlxreg-fan-Modify-PWM-connectivity-valida.patch rename to patch/0096-hwmon-mlxreg-fan-Modify-PWM-connectivity-validation.patch index 967b2f11cc5e..1cc2fe948df3 100644 --- a/patch/0096-hwmon-mlxreg-fan-Modify-PWM-connectivity-valida.patch +++ b/patch/0096-hwmon-mlxreg-fan-Modify-PWM-connectivity-validation.patch @@ -1,7 +1,8 @@ +From 66cfe84c9fd69ec5f98e1ff2888898ea24d4f7ae Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Sun, 26 Sep 2021 08:35:40 +0300 -Subject: 0096 hwmon: (mlxreg-fan) Modify PWM connectivity - validation +Subject: [PATCH backport 5.10 096/182] hwmon: (mlxreg-fan) Modify PWM + connectivity validation Validate PWM connectivity only for additional PWM - "pwm1" is connected on all systems, while "pwm2" - "pwm4" are optional. Validate @@ -17,7 +18,7 @@ Signed-off-by: Guenter Roeck 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c -index 21190020172a..780ae56a59ef 100644 +index feab9ec6a6ca..8e5cd6991929 100644 --- a/drivers/hwmon/mlxreg-fan.c +++ b/drivers/hwmon/mlxreg-fan.c @@ -488,9 +488,14 @@ static int mlxreg_fan_config(struct mlxreg_fan *fan, @@ -39,5 +40,5 @@ index 21190020172a..780ae56a59ef 100644 fan->pwm[pwm_num].reg = data->reg; fan->pwm[pwm_num].connected = true; -- -2.17.1 +2.20.1 diff --git a/patch/0097-1-mlxsw-Use-u16-for-local_port-field.patch b/patch/0097-1-mlxsw-Use-u16-for-local_port-field.patch new file mode 100644 index 000000000000..02a6b38197ca --- /dev/null +++ b/patch/0097-1-mlxsw-Use-u16-for-local_port-field.patch @@ -0,0 +1,784 @@ +From 0639995c2017338c563db36f631e94d19ae45c74 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 15 Aug 2023 07:52:25 +0000 +Subject: mlxsw: Use u16 for local_port field instead of u8 + +Upstream commit c934757d90000a9d3779d2b436a70e3d060ef693 + +Currently, local_port field is saved as u8, which means that maximum 256 +ports can be used. + +As preparation for Spectrum-4, which will support more than 256 ports, +local_port field should be extended. + +Save local_port as u16 to allow use of additional ports. + +Signed-off-by: Amit Cohen +Reviewed-by: Petr Machata +Signed-off-by: Ido Schimmel +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/mellanox/mlxsw/core.c | 32 ++++---- + drivers/net/ethernet/mellanox/mlxsw/core.h | 34 ++++----- + drivers/net/ethernet/mellanox/mlxsw/minimal.c | 6 +- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 106 +++++++++++++------------- + 4 files changed, 89 insertions(+), 89 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c +index 7938bad70e37..631c19222fc4 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c +@@ -47,7 +47,7 @@ static struct workqueue_struct *mlxsw_owq; + struct mlxsw_core_port { + struct devlink_port devlink_port; + void *port_driver_priv; +- u8 local_port; ++ u16 local_port; + }; + + void *mlxsw_core_port_driver_priv(struct mlxsw_core_port *mlxsw_core_port) +@@ -669,7 +669,7 @@ static void mlxsw_emad_process_response(struct mlxsw_core *mlxsw_core, + } + + /* called with rcu read lock held */ +-static void mlxsw_emad_rx_listener_func(struct sk_buff *skb, u8 local_port, ++static void mlxsw_emad_rx_listener_func(struct sk_buff *skb, u16 local_port, + void *priv) + { + struct mlxsw_core *mlxsw_core = priv; +@@ -2094,7 +2094,7 @@ int mlxsw_core_skb_transmit(struct mlxsw_core *mlxsw_core, struct sk_buff *skb, + EXPORT_SYMBOL(mlxsw_core_skb_transmit); + + void mlxsw_core_ptp_transmitted(struct mlxsw_core *mlxsw_core, +- struct sk_buff *skb, u8 local_port) ++ struct sk_buff *skb, u16 local_port) + { + if (mlxsw_core->driver->ptp_transmitted) + mlxsw_core->driver->ptp_transmitted(mlxsw_core, skb, +@@ -2172,7 +2172,7 @@ mlxsw_core_rx_listener_state_set(struct mlxsw_core *mlxsw_core, + rxl_item->enabled = enabled; + } + +-static void mlxsw_core_event_listener_func(struct sk_buff *skb, u8 local_port, ++static void mlxsw_core_event_listener_func(struct sk_buff *skb, u16 local_port, + void *priv) + { + struct mlxsw_event_listener_item *event_listener_item = priv; +@@ -2599,7 +2599,7 @@ void mlxsw_core_skb_receive(struct mlxsw_core *mlxsw_core, struct sk_buff *skb, + { + struct mlxsw_rx_listener_item *rxl_item; + const struct mlxsw_rx_listener *rxl; +- u8 local_port; ++ u16 local_port; + bool found = false; + + if (rx_info->is_lag) { +@@ -2657,7 +2657,7 @@ static int mlxsw_core_lag_mapping_index(struct mlxsw_core *mlxsw_core, + } + + void mlxsw_core_lag_mapping_set(struct mlxsw_core *mlxsw_core, +- u16 lag_id, u8 port_index, u8 local_port) ++ u16 lag_id, u8 port_index, u16 local_port) + { + int index = mlxsw_core_lag_mapping_index(mlxsw_core, + lag_id, port_index); +@@ -2677,7 +2677,7 @@ u8 mlxsw_core_lag_mapping_get(struct mlxsw_core *mlxsw_core, + EXPORT_SYMBOL(mlxsw_core_lag_mapping_get); + + void mlxsw_core_lag_mapping_clear(struct mlxsw_core *mlxsw_core, +- u16 lag_id, u8 local_port) ++ u16 lag_id, u16 local_port) + { + int i; + +@@ -2705,7 +2705,7 @@ u64 mlxsw_core_res_get(struct mlxsw_core *mlxsw_core, + } + EXPORT_SYMBOL(mlxsw_core_res_get); + +-static int __mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, ++static int __mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u16 local_port, + enum devlink_port_flavour flavour, + u32 port_number, bool split, + u32 split_port_subnumber, +@@ -2736,7 +2736,7 @@ static int __mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, + return err; + } + +-static void __mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u8 local_port) ++static void __mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u16 local_port) + { + struct mlxsw_core_port *mlxsw_core_port = + &mlxsw_core->ports[local_port]; +@@ -2746,7 +2746,7 @@ static void __mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u8 local_port) + memset(mlxsw_core_port, 0, sizeof(*mlxsw_core_port)); + } + +-int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, ++int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u16 local_port, + u32 port_number, bool split, + u32 split_port_subnumber, + bool splittable, u32 lanes, +@@ -2761,7 +2761,7 @@ int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, + } + EXPORT_SYMBOL(mlxsw_core_port_init); + +-void mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u8 local_port) ++void mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u16 local_port) + { + __mlxsw_core_port_fini(mlxsw_core, local_port); + } +@@ -2794,7 +2794,7 @@ void mlxsw_core_cpu_port_fini(struct mlxsw_core *mlxsw_core) + } + EXPORT_SYMBOL(mlxsw_core_cpu_port_fini); + +-void mlxsw_core_port_eth_set(struct mlxsw_core *mlxsw_core, u8 local_port, ++void mlxsw_core_port_eth_set(struct mlxsw_core *mlxsw_core, u16 local_port, + void *port_driver_priv, struct net_device *dev) + { + struct mlxsw_core_port *mlxsw_core_port = +@@ -2806,7 +2806,7 @@ void mlxsw_core_port_eth_set(struct mlxsw_core *mlxsw_core, u8 local_port, + } + EXPORT_SYMBOL(mlxsw_core_port_eth_set); + +-void mlxsw_core_port_ib_set(struct mlxsw_core *mlxsw_core, u8 local_port, ++void mlxsw_core_port_ib_set(struct mlxsw_core *mlxsw_core, u16 local_port, + void *port_driver_priv) + { + struct mlxsw_core_port *mlxsw_core_port = +@@ -2818,7 +2818,7 @@ void mlxsw_core_port_ib_set(struct mlxsw_core *mlxsw_core, u8 local_port, + } + EXPORT_SYMBOL(mlxsw_core_port_ib_set); + +-void mlxsw_core_port_clear(struct mlxsw_core *mlxsw_core, u8 local_port, ++void mlxsw_core_port_clear(struct mlxsw_core *mlxsw_core, u16 local_port, + void *port_driver_priv) + { + struct mlxsw_core_port *mlxsw_core_port = +@@ -2831,7 +2831,7 @@ void mlxsw_core_port_clear(struct mlxsw_core *mlxsw_core, u8 local_port, + EXPORT_SYMBOL(mlxsw_core_port_clear); + + enum devlink_port_type mlxsw_core_port_type_get(struct mlxsw_core *mlxsw_core, +- u8 local_port) ++ u16 local_port) + { + struct mlxsw_core_port *mlxsw_core_port = + &mlxsw_core->ports[local_port]; +@@ -2844,7 +2844,7 @@ EXPORT_SYMBOL(mlxsw_core_port_type_get); + + struct devlink_port * + mlxsw_core_port_devlink_port_get(struct mlxsw_core *mlxsw_core, +- u8 local_port) ++ u16 local_port) + { + struct mlxsw_core_port *mlxsw_core_port = + &mlxsw_core->ports[local_port]; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h +index 56efb8e48022..1fc783174292 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.h +@@ -49,7 +49,7 @@ int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, + void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, bool reload); + + struct mlxsw_tx_info { +- u8 local_port; ++ u16 local_port; + bool is_emad; + }; + +@@ -58,11 +58,11 @@ bool mlxsw_core_skb_transmit_busy(struct mlxsw_core *mlxsw_core, + int mlxsw_core_skb_transmit(struct mlxsw_core *mlxsw_core, struct sk_buff *skb, + const struct mlxsw_tx_info *tx_info); + void mlxsw_core_ptp_transmitted(struct mlxsw_core *mlxsw_core, +- struct sk_buff *skb, u8 local_port); ++ struct sk_buff *skb, u16 local_port); + + struct mlxsw_rx_listener { +- void (*func)(struct sk_buff *skb, u8 local_port, void *priv); +- u8 local_port; ++ void (*func)(struct sk_buff *skb, u16 local_port, void *priv); ++ u16 local_port; + u8 mirror_reason; + u16 trap_id; + }; +@@ -194,35 +194,35 @@ void mlxsw_core_skb_receive(struct mlxsw_core *mlxsw_core, struct sk_buff *skb, + struct mlxsw_rx_info *rx_info); + + void mlxsw_core_lag_mapping_set(struct mlxsw_core *mlxsw_core, +- u16 lag_id, u8 port_index, u8 local_port); ++ u16 lag_id, u8 port_index, u16 local_port); + u8 mlxsw_core_lag_mapping_get(struct mlxsw_core *mlxsw_core, + u16 lag_id, u8 port_index); + void mlxsw_core_lag_mapping_clear(struct mlxsw_core *mlxsw_core, +- u16 lag_id, u8 local_port); ++ u16 lag_id, u16 local_port); + + void *mlxsw_core_port_driver_priv(struct mlxsw_core_port *mlxsw_core_port); +-int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port, ++int mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u16 local_port, + u32 port_number, bool split, u32 split_port_subnumber, + bool splittable, u32 lanes, + const unsigned char *switch_id, + unsigned char switch_id_len); +-void mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u8 local_port); ++void mlxsw_core_port_fini(struct mlxsw_core *mlxsw_core, u16 local_port); + int mlxsw_core_cpu_port_init(struct mlxsw_core *mlxsw_core, + void *port_driver_priv, + const unsigned char *switch_id, + unsigned char switch_id_len); + void mlxsw_core_cpu_port_fini(struct mlxsw_core *mlxsw_core); +-void mlxsw_core_port_eth_set(struct mlxsw_core *mlxsw_core, u8 local_port, ++void mlxsw_core_port_eth_set(struct mlxsw_core *mlxsw_core, u16 local_port, + void *port_driver_priv, struct net_device *dev); +-void mlxsw_core_port_ib_set(struct mlxsw_core *mlxsw_core, u8 local_port, ++void mlxsw_core_port_ib_set(struct mlxsw_core *mlxsw_core, u16 local_port, + void *port_driver_priv); +-void mlxsw_core_port_clear(struct mlxsw_core *mlxsw_core, u8 local_port, ++void mlxsw_core_port_clear(struct mlxsw_core *mlxsw_core, u16 local_port, + void *port_driver_priv); + enum devlink_port_type mlxsw_core_port_type_get(struct mlxsw_core *mlxsw_core, +- u8 local_port); ++ u16 local_port); + struct devlink_port * + mlxsw_core_port_devlink_port_get(struct mlxsw_core *mlxsw_core, +- u8 local_port); ++ u16 local_port); + struct mlxsw_env *mlxsw_core_env(const struct mlxsw_core *mlxsw_core); + int mlxsw_core_module_max_width(struct mlxsw_core *mlxsw_core, u8 module); + +@@ -290,11 +290,11 @@ struct mlxsw_driver { + struct netlink_ext_ack *extack); + void (*fini)(struct mlxsw_core *mlxsw_core); + int (*basic_trap_groups_set)(struct mlxsw_core *mlxsw_core); +- int (*port_type_set)(struct mlxsw_core *mlxsw_core, u8 local_port, ++ int (*port_type_set)(struct mlxsw_core *mlxsw_core, u16 local_port, + enum devlink_port_type new_type); +- int (*port_split)(struct mlxsw_core *mlxsw_core, u8 local_port, ++ int (*port_split)(struct mlxsw_core *mlxsw_core, u16 local_port, + unsigned int count, struct netlink_ext_ack *extack); +- int (*port_unsplit)(struct mlxsw_core *mlxsw_core, u8 local_port, ++ int (*port_unsplit)(struct mlxsw_core *mlxsw_core, u16 local_port, + struct netlink_ext_ack *extack); + int (*sb_pool_get)(struct mlxsw_core *mlxsw_core, + unsigned int sb_index, u16 pool_index, +@@ -368,7 +368,7 @@ struct mlxsw_driver { + * is responsible for freeing the passed-in SKB. + */ + void (*ptp_transmitted)(struct mlxsw_core *mlxsw_core, +- struct sk_buff *skb, u8 local_port); ++ struct sk_buff *skb, u16 local_port); + + u8 txhdr_len; + const struct mlxsw_config_profile *profile; +diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +index 3d07c2dcf08d..1ddd11320b99 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c +@@ -38,7 +38,7 @@ struct mlxsw_m { + struct mlxsw_m_port { + struct net_device *dev; + struct mlxsw_m *mlxsw_m; +- u8 local_port; ++ u16 local_port; + u8 module; + }; + +@@ -201,7 +201,7 @@ mlxsw_m_port_dev_addr_get(struct mlxsw_m_port *mlxsw_m_port) + } + + static int +-mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 local_port, u8 module) ++mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u16 local_port, u8 module) + { + struct mlxsw_m_port *mlxsw_m_port; + struct net_device *dev; +@@ -264,7 +264,7 @@ mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 local_port, u8 module) + return err; + } + +-static void mlxsw_m_port_remove(struct mlxsw_m *mlxsw_m, u8 local_port) ++static void mlxsw_m_port_remove(struct mlxsw_m *mlxsw_m, u16 local_port) + { + struct mlxsw_m_port *mlxsw_m_port = mlxsw_m->ports[local_port]; + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h +index a9119451d999..2ec9ec6078e2 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h ++++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h +@@ -161,7 +161,7 @@ MLXSW_ITEM32(reg, sspr, sub_port, 0x00, 8, 8); + */ + MLXSW_ITEM32(reg, sspr, system_port, 0x04, 0, 16); + +-static inline void mlxsw_reg_sspr_pack(char *payload, u8 local_port) ++static inline void mlxsw_reg_sspr_pack(char *payload, u16 local_port) + { + MLXSW_REG_ZERO(sspr, payload); + mlxsw_reg_sspr_m_set(payload, 1); +@@ -407,7 +407,7 @@ static inline void mlxsw_reg_sfd_uc_pack(char *payload, int rec_index, + enum mlxsw_reg_sfd_rec_policy policy, + const char *mac, u16 fid_vid, + enum mlxsw_reg_sfd_rec_action action, +- u8 local_port) ++ u16 local_port) + { + mlxsw_reg_sfd_rec_pack(payload, rec_index, + MLXSW_REG_SFD_REC_TYPE_UNICAST, mac, action); +@@ -419,7 +419,7 @@ static inline void mlxsw_reg_sfd_uc_pack(char *payload, int rec_index, + + static inline void mlxsw_reg_sfd_uc_unpack(char *payload, int rec_index, + char *mac, u16 *p_fid_vid, +- u8 *p_local_port) ++ u16 *p_local_port) + { + mlxsw_reg_sfd_rec_mac_memcpy_from(payload, rec_index, mac); + *p_fid_vid = mlxsw_reg_sfd_uc_fid_vid_get(payload, rec_index); +@@ -685,7 +685,7 @@ MLXSW_ITEM32_INDEXED(reg, sfn, mac_system_port, MLXSW_REG_SFN_BASE_LEN, 0, 16, + + static inline void mlxsw_reg_sfn_mac_unpack(char *payload, int rec_index, + char *mac, u16 *p_vid, +- u8 *p_local_port) ++ u16 *p_local_port) + { + mlxsw_reg_sfn_rec_mac_memcpy_from(payload, rec_index, mac); + *p_vid = mlxsw_reg_sfn_mac_fid_get(payload, rec_index); +@@ -800,7 +800,7 @@ enum mlxsw_reg_spms_state { + */ + MLXSW_ITEM_BIT_ARRAY(reg, spms, state, 0x04, 0x400, 2); + +-static inline void mlxsw_reg_spms_pack(char *payload, u8 local_port) ++static inline void mlxsw_reg_spms_pack(char *payload, u16 local_port) + { + MLXSW_REG_ZERO(spms, payload); + mlxsw_reg_spms_local_port_set(payload, local_port); +@@ -840,7 +840,7 @@ MLXSW_ITEM32(reg, spvid, sub_port, 0x00, 8, 8); + */ + MLXSW_ITEM32(reg, spvid, pvid, 0x04, 0, 12); + +-static inline void mlxsw_reg_spvid_pack(char *payload, u8 local_port, u16 pvid) ++static inline void mlxsw_reg_spvid_pack(char *payload, u16 local_port, u16 pvid) + { + MLXSW_REG_ZERO(spvid, payload); + mlxsw_reg_spvid_local_port_set(payload, local_port); +@@ -929,7 +929,7 @@ MLXSW_ITEM32_INDEXED(reg, spvm, rec_vid, + MLXSW_REG_SPVM_BASE_LEN, 0, 12, + MLXSW_REG_SPVM_REC_LEN, 0, false); + +-static inline void mlxsw_reg_spvm_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_spvm_pack(char *payload, u16 local_port, + u16 vid_begin, u16 vid_end, + bool is_member, bool untagged) + { +@@ -991,7 +991,7 @@ MLXSW_ITEM32(reg, spaft, allow_prio_tagged, 0x04, 30, 1); + */ + MLXSW_ITEM32(reg, spaft, allow_tagged, 0x04, 29, 1); + +-static inline void mlxsw_reg_spaft_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_spaft_pack(char *payload, u16 local_port, + bool allow_untagged) + { + MLXSW_REG_ZERO(spaft, payload); +@@ -1317,7 +1317,7 @@ MLXSW_ITEM32(reg, sldr, num_ports, 0x04, 24, 8); + MLXSW_ITEM32_INDEXED(reg, sldr, system_port, 0x08, 0, 16, 4, 0, false); + + static inline void mlxsw_reg_sldr_lag_add_port_pack(char *payload, u8 lag_id, +- u8 local_port) ++ u16 local_port) + { + MLXSW_REG_ZERO(sldr, payload); + mlxsw_reg_sldr_op_set(payload, MLXSW_REG_SLDR_OP_LAG_ADD_PORT_LIST); +@@ -1327,7 +1327,7 @@ static inline void mlxsw_reg_sldr_lag_add_port_pack(char *payload, u8 lag_id, + } + + static inline void mlxsw_reg_sldr_lag_remove_port_pack(char *payload, u8 lag_id, +- u8 local_port) ++ u16 local_port) + { + MLXSW_REG_ZERO(sldr, payload); + mlxsw_reg_sldr_op_set(payload, MLXSW_REG_SLDR_OP_LAG_REMOVE_PORT_LIST); +@@ -1501,7 +1501,7 @@ MLXSW_ITEM32(reg, slcor, lag_id, 0x00, 0, 10); + MLXSW_ITEM32(reg, slcor, port_index, 0x04, 0, 10); + + static inline void mlxsw_reg_slcor_pack(char *payload, +- u8 local_port, u16 lag_id, ++ u16 local_port, u16 lag_id, + enum mlxsw_reg_slcor_col col) + { + MLXSW_REG_ZERO(slcor, payload); +@@ -1511,7 +1511,7 @@ static inline void mlxsw_reg_slcor_pack(char *payload, + } + + static inline void mlxsw_reg_slcor_port_add_pack(char *payload, +- u8 local_port, u16 lag_id, ++ u16 local_port, u16 lag_id, + u8 port_index) + { + mlxsw_reg_slcor_pack(payload, local_port, lag_id, +@@ -1520,21 +1520,21 @@ static inline void mlxsw_reg_slcor_port_add_pack(char *payload, + } + + static inline void mlxsw_reg_slcor_port_remove_pack(char *payload, +- u8 local_port, u16 lag_id) ++ u16 local_port, u16 lag_id) + { + mlxsw_reg_slcor_pack(payload, local_port, lag_id, + MLXSW_REG_SLCOR_COL_LAG_REMOVE_PORT); + } + + static inline void mlxsw_reg_slcor_col_enable_pack(char *payload, +- u8 local_port, u16 lag_id) ++ u16 local_port, u16 lag_id) + { + mlxsw_reg_slcor_pack(payload, local_port, lag_id, + MLXSW_REG_SLCOR_COL_LAG_COLLECTOR_ENABLED); + } + + static inline void mlxsw_reg_slcor_col_disable_pack(char *payload, +- u8 local_port, u16 lag_id) ++ u16 local_port, u16 lag_id) + { + mlxsw_reg_slcor_pack(payload, local_port, lag_id, + MLXSW_REG_SLCOR_COL_LAG_COLLECTOR_ENABLED); +@@ -1581,7 +1581,7 @@ enum mlxsw_reg_spmlr_learn_mode { + */ + MLXSW_ITEM32(reg, spmlr, learn_mode, 0x04, 30, 2); + +-static inline void mlxsw_reg_spmlr_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_spmlr_pack(char *payload, u16 local_port, + enum mlxsw_reg_spmlr_learn_mode mode) + { + MLXSW_REG_ZERO(spmlr, payload); +@@ -1666,7 +1666,7 @@ MLXSW_ITEM32(reg, svfa, counter_set_type, 0x08, 24, 8); + */ + MLXSW_ITEM32(reg, svfa, counter_index, 0x08, 0, 24); + +-static inline void mlxsw_reg_svfa_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_svfa_pack(char *payload, u16 local_port, + enum mlxsw_reg_svfa_mt mt, bool valid, + u16 fid, u16 vid) + { +@@ -1705,7 +1705,7 @@ MLXSW_ITEM32(reg, svpe, local_port, 0x00, 16, 8); + */ + MLXSW_ITEM32(reg, svpe, vp_en, 0x00, 8, 1); + +-static inline void mlxsw_reg_svpe_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_svpe_pack(char *payload, u16 local_port, + bool enable) + { + MLXSW_REG_ZERO(svpe, payload); +@@ -1838,7 +1838,7 @@ MLXSW_ITEM32_INDEXED(reg, spvmlr, rec_learn_enable, MLXSW_REG_SPVMLR_BASE_LEN, + MLXSW_ITEM32_INDEXED(reg, spvmlr, rec_vid, MLXSW_REG_SPVMLR_BASE_LEN, 0, 12, + MLXSW_REG_SPVMLR_REC_LEN, 0x00, false); + +-static inline void mlxsw_reg_spvmlr_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_spvmlr_pack(char *payload, u16 local_port, + u16 vid_begin, u16 vid_end, + bool learn_enable) + { +@@ -1907,7 +1907,7 @@ MLXSW_ITEM32_INDEXED(reg, cwtp, profile_max, MLXSW_REG_CWTP_BASE_LEN, + #define MLXSW_REG_CWTP_MAX_PROFILE 2 + #define MLXSW_REG_CWTP_DEFAULT_PROFILE 1 + +-static inline void mlxsw_reg_cwtp_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_cwtp_pack(char *payload, u16 local_port, + u8 traffic_class) + { + int i; +@@ -2025,7 +2025,7 @@ MLXSW_ITEM32(reg, cwtpm, ntcp_r, 64, 0, 2); + + #define MLXSW_REG_CWTPM_RESET_PROFILE 0 + +-static inline void mlxsw_reg_cwtpm_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_cwtpm_pack(char *payload, u16 local_port, + u8 traffic_class, u8 profile, + bool wred, bool ecn) + { +@@ -2116,7 +2116,7 @@ MLXSW_ITEM32(reg, ppbt, acl_info, 0x10, 0, 16); + + static inline void mlxsw_reg_ppbt_pack(char *payload, enum mlxsw_reg_pxbt_e e, + enum mlxsw_reg_pxbt_op op, +- u8 local_port, u16 acl_info) ++ u16 local_port, u16 acl_info) + { + MLXSW_REG_ZERO(ppbt, payload); + mlxsw_reg_ppbt_e_set(payload, e); +@@ -3260,7 +3260,7 @@ enum mlxsw_reg_qpts_trust_state { + */ + MLXSW_ITEM32(reg, qpts, trust_state, 0x04, 0, 3); + +-static inline void mlxsw_reg_qpts_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_qpts_pack(char *payload, u16 local_port, + enum mlxsw_reg_qpts_trust_state ts) + { + MLXSW_REG_ZERO(qpts, payload); +@@ -3476,7 +3476,7 @@ MLXSW_ITEM32(reg, qtct, switch_prio, 0x00, 0, 4); + */ + MLXSW_ITEM32(reg, qtct, tclass, 0x04, 0, 4); + +-static inline void mlxsw_reg_qtct_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_qtct_pack(char *payload, u16 local_port, + u8 switch_prio, u8 tclass) + { + MLXSW_REG_ZERO(qtct, payload); +@@ -3643,7 +3643,7 @@ MLXSW_ITEM32(reg, qeec, max_shaper_bs, 0x1C, 0, 6); + #define MLXSW_REG_QEEC_LOWEST_SHAPER_BS_SP2 11 + #define MLXSW_REG_QEEC_LOWEST_SHAPER_BS_SP3 11 + +-static inline void mlxsw_reg_qeec_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_qeec_pack(char *payload, u16 local_port, + enum mlxsw_reg_qeec_hr hr, u8 index, + u8 next_index) + { +@@ -3654,7 +3654,7 @@ static inline void mlxsw_reg_qeec_pack(char *payload, u8 local_port, + mlxsw_reg_qeec_next_element_index_set(payload, next_index); + } + +-static inline void mlxsw_reg_qeec_ptps_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_qeec_ptps_pack(char *payload, u16 local_port, + bool ptps) + { + MLXSW_REG_ZERO(qeec, payload); +@@ -3692,7 +3692,7 @@ MLXSW_ITEM32(reg, qrwe, dscp, 0x04, 1, 1); + */ + MLXSW_ITEM32(reg, qrwe, pcp, 0x04, 0, 1); + +-static inline void mlxsw_reg_qrwe_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_qrwe_pack(char *payload, u16 local_port, + bool rewrite_pcp, bool rewrite_dscp) + { + MLXSW_REG_ZERO(qrwe, payload); +@@ -3772,7 +3772,7 @@ MLXSW_ITEM32_INDEXED(reg, qpdsm, prio_entry_color2_dscp, + MLXSW_REG_QPDSM_BASE_LEN, 8, 6, + MLXSW_REG_QPDSM_PRIO_ENTRY_REC_LEN, 0x00, false); + +-static inline void mlxsw_reg_qpdsm_pack(char *payload, u8 local_port) ++static inline void mlxsw_reg_qpdsm_pack(char *payload, u16 local_port) + { + MLXSW_REG_ZERO(qpdsm, payload); + mlxsw_reg_qpdsm_local_port_set(payload, local_port); +@@ -3813,7 +3813,7 @@ MLXSW_ITEM32(reg, qpdp, local_port, 0x00, 16, 8); + */ + MLXSW_ITEM32(reg, qpdp, switch_prio, 0x04, 0, 4); + +-static inline void mlxsw_reg_qpdp_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_qpdp_pack(char *payload, u16 local_port, + u8 switch_prio) + { + MLXSW_REG_ZERO(qpdp, payload); +@@ -3859,7 +3859,7 @@ MLXSW_ITEM16_INDEXED(reg, qpdpm, dscp_entry_prio, + MLXSW_REG_QPDPM_BASE_LEN, 0, 4, + MLXSW_REG_QPDPM_DSCP_ENTRY_REC_LEN, 0x00, false); + +-static inline void mlxsw_reg_qpdpm_pack(char *payload, u8 local_port) ++static inline void mlxsw_reg_qpdpm_pack(char *payload, u16 local_port) + { + MLXSW_REG_ZERO(qpdpm, payload); + mlxsw_reg_qpdpm_local_port_set(payload, local_port); +@@ -3901,7 +3901,7 @@ MLXSW_ITEM32(reg, qtctm, local_port, 0x00, 16, 8); + MLXSW_ITEM32(reg, qtctm, mc, 0x04, 0, 1); + + static inline void +-mlxsw_reg_qtctm_pack(char *payload, u8 local_port, bool mc) ++mlxsw_reg_qtctm_pack(char *payload, u16 local_port, bool mc) + { + MLXSW_REG_ZERO(qtctm, payload); + mlxsw_reg_qtctm_local_port_set(payload, local_port); +@@ -4065,7 +4065,7 @@ MLXSW_ITEM32_INDEXED(reg, pmlp, tx_lane, 0x04, 16, 4, 0x04, 0x00, false); + */ + MLXSW_ITEM32_INDEXED(reg, pmlp, rx_lane, 0x04, 24, 4, 0x04, 0x00, false); + +-static inline void mlxsw_reg_pmlp_pack(char *payload, u8 local_port) ++static inline void mlxsw_reg_pmlp_pack(char *payload, u16 local_port) + { + MLXSW_REG_ZERO(pmlp, payload); + mlxsw_reg_pmlp_local_port_set(payload, local_port); +@@ -4112,7 +4112,7 @@ MLXSW_ITEM32(reg, pmtu, admin_mtu, 0x08, 16, 16); + */ + MLXSW_ITEM32(reg, pmtu, oper_mtu, 0x0C, 16, 16); + +-static inline void mlxsw_reg_pmtu_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_pmtu_pack(char *payload, u16 local_port, + u16 new_mtu) + { + MLXSW_REG_ZERO(pmtu, payload); +@@ -4306,7 +4306,7 @@ enum mlxsw_reg_ptys_connector_type { + */ + MLXSW_ITEM32(reg, ptys, connector_type, 0x2C, 0, 4); + +-static inline void mlxsw_reg_ptys_eth_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_ptys_eth_pack(char *payload, u16 local_port, + u32 proto_admin, bool autoneg) + { + MLXSW_REG_ZERO(ptys, payload); +@@ -4316,7 +4316,7 @@ static inline void mlxsw_reg_ptys_eth_pack(char *payload, u8 local_port, + mlxsw_reg_ptys_an_disable_admin_set(payload, !autoneg); + } + +-static inline void mlxsw_reg_ptys_ext_eth_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_ptys_ext_eth_pack(char *payload, u16 local_port, + u32 proto_admin, bool autoneg) + { + MLXSW_REG_ZERO(ptys, payload); +@@ -4358,7 +4358,7 @@ static inline void mlxsw_reg_ptys_ext_eth_unpack(char *payload, + mlxsw_reg_ptys_ext_eth_proto_oper_get(payload); + } + +-static inline void mlxsw_reg_ptys_ib_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_ptys_ib_pack(char *payload, u16 local_port, + u16 proto_admin, u16 link_width) + { + MLXSW_REG_ZERO(ptys, payload); +@@ -4416,7 +4416,7 @@ MLXSW_ITEM32(reg, ppad, local_port, 0x00, 16, 8); + MLXSW_ITEM_BUF(reg, ppad, mac, 0x02, 6); + + static inline void mlxsw_reg_ppad_pack(char *payload, bool single_base_mac, +- u8 local_port) ++ u16 local_port) + { + MLXSW_REG_ZERO(ppad, payload); + mlxsw_reg_ppad_single_base_mac_set(payload, !!single_base_mac); +@@ -4490,7 +4490,7 @@ MLXSW_ITEM32(reg, paos, ee, 0x04, 30, 1); + */ + MLXSW_ITEM32(reg, paos, e, 0x04, 0, 2); + +-static inline void mlxsw_reg_paos_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_paos_pack(char *payload, u16 local_port, + enum mlxsw_port_admin_status status) + { + MLXSW_REG_ZERO(paos, payload); +@@ -4633,7 +4633,7 @@ static inline void mlxsw_reg_pfcc_prio_pack(char *payload, u8 pfc_en) + mlxsw_reg_pfcc_pfcrx_set(payload, pfc_en); + } + +-static inline void mlxsw_reg_pfcc_pack(char *payload, u8 local_port) ++static inline void mlxsw_reg_pfcc_pack(char *payload, u16 local_port) + { + MLXSW_REG_ZERO(pfcc, payload); + mlxsw_reg_pfcc_local_port_set(payload, local_port); +@@ -5132,7 +5132,7 @@ MLXSW_ITEM64(reg, ppcnt, tc_no_buffer_discard_uc, + MLXSW_ITEM64(reg, ppcnt, wred_discard, + MLXSW_REG_PPCNT_COUNTERS_OFFSET + 0x00, 0, 64); + +-static inline void mlxsw_reg_ppcnt_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_ppcnt_pack(char *payload, u16 local_port, + enum mlxsw_reg_ppcnt_grp grp, + u8 prio_tc) + { +@@ -5243,7 +5243,7 @@ MLXSW_ITEM_BIT_ARRAY(reg, pptb, prio_to_buff_msb, 0x0C, 0x04, 4); + + #define MLXSW_REG_PPTB_ALL_PRIO 0xFF + +-static inline void mlxsw_reg_pptb_pack(char *payload, u8 local_port) ++static inline void mlxsw_reg_pptb_pack(char *payload, u16 local_port) + { + MLXSW_REG_ZERO(pptb, payload); + mlxsw_reg_pptb_mm_set(payload, MLXSW_REG_PPTB_MM_UM); +@@ -5340,7 +5340,7 @@ MLXSW_ITEM32_INDEXED(reg, pbmc, buf_xoff_threshold, 0x0C, 16, 16, + MLXSW_ITEM32_INDEXED(reg, pbmc, buf_xon_threshold, 0x0C, 0, 16, + 0x08, 0x04, false); + +-static inline void mlxsw_reg_pbmc_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_pbmc_pack(char *payload, u16 local_port, + u16 xoff_timer_value, u16 xoff_refresh) + { + MLXSW_REG_ZERO(pbmc, payload); +@@ -5398,7 +5398,7 @@ MLXSW_ITEM32(reg, pspa, local_port, 0x00, 16, 8); + */ + MLXSW_ITEM32(reg, pspa, sub_port, 0x00, 8, 8); + +-static inline void mlxsw_reg_pspa_pack(char *payload, u8 swid, u8 local_port) ++static inline void mlxsw_reg_pspa_pack(char *payload, u8 swid, u16 local_port) + { + MLXSW_REG_ZERO(pspa, payload); + mlxsw_reg_pspa_swid_set(payload, swid); +@@ -5513,7 +5513,7 @@ MLXSW_ITEM32(reg, pplr, local_port, 0x00, 16, 8); + */ + MLXSW_ITEM32(reg, pplr, lb_en, 0x04, 0, 8); + +-static inline void mlxsw_reg_pplr_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_pplr_pack(char *payload, u16 local_port, + bool phy_local) + { + MLXSW_REG_ZERO(pplr, payload); +@@ -5609,7 +5609,7 @@ MLXSW_ITEM32(reg, pddr, trblsh_group_opcode, 0x08, 0, 16); + */ + MLXSW_ITEM32(reg, pddr, trblsh_status_opcode, 0x0C, 0, 16); + +-static inline void mlxsw_reg_pddr_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_pddr_pack(char *payload, u16 local_port, + u8 page_select) + { + MLXSW_REG_ZERO(pddr, payload); +@@ -9160,7 +9160,7 @@ MLXSW_ITEM32(reg, mpar, enable, 0x04, 31, 1); + */ + MLXSW_ITEM32(reg, mpar, pa_id, 0x04, 0, 4); + +-static inline void mlxsw_reg_mpar_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_mpar_pack(char *payload, u16 local_port, + enum mlxsw_reg_mpar_i_e i_e, + bool enable, u8 pa_id) + { +@@ -9281,7 +9281,7 @@ MLXSW_ITEM32(reg, mlcr, beacon_duration, 0x04, 0, 16); + */ + MLXSW_ITEM32(reg, mlcr, beacon_remain, 0x08, 0, 16); + +-static inline void mlxsw_reg_mlcr_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_mlcr_pack(char *payload, u16 local_port, + bool active) + { + MLXSW_REG_ZERO(mlcr, payload); +@@ -9671,7 +9671,7 @@ MLXSW_ITEM32(reg, mpsc, e, 0x04, 30, 1); + */ + MLXSW_ITEM32(reg, mpsc, rate, 0x08, 0, 32); + +-static inline void mlxsw_reg_mpsc_pack(char *payload, u8 local_port, bool e, ++static inline void mlxsw_reg_mpsc_pack(char *payload, u16 local_port, bool e, + u32 rate) + { + MLXSW_REG_ZERO(mpsc, payload); +@@ -9904,7 +9904,7 @@ MLXSW_ITEM32(reg, momte, type, 0x04, 0, 8); + */ + MLXSW_ITEM_BIT_ARRAY(reg, momte, tclass_en, 0x08, 0x08, 1); + +-static inline void mlxsw_reg_momte_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_momte_pack(char *payload, u16 local_port, + enum mlxsw_reg_momte_type type) + { + MLXSW_REG_ZERO(momte, payload); +@@ -10574,7 +10574,7 @@ MLXSW_ITEM32(reg, tnqdr, local_port, 0x00, 16, 8); + */ + MLXSW_ITEM32(reg, tnqdr, dscp, 0x04, 0, 6); + +-static inline void mlxsw_reg_tnqdr_pack(char *payload, u8 local_port) ++static inline void mlxsw_reg_tnqdr_pack(char *payload, u16 local_port) + { + MLXSW_REG_ZERO(tnqdr, payload); + mlxsw_reg_tnqdr_local_port_set(payload, local_port); +@@ -10963,7 +10963,7 @@ MLXSW_ITEM32(reg, sbcm, max_buff, 0x1C, 0, 24); + */ + MLXSW_ITEM32(reg, sbcm, pool, 0x24, 0, 4); + +-static inline void mlxsw_reg_sbcm_pack(char *payload, u8 local_port, u8 pg_buff, ++static inline void mlxsw_reg_sbcm_pack(char *payload, u16 local_port, u8 pg_buff, + enum mlxsw_reg_sbxx_dir dir, + u32 min_buff, u32 max_buff, + bool infi_max, u8 pool) +@@ -11049,7 +11049,7 @@ MLXSW_ITEM32(reg, sbpm, min_buff, 0x18, 0, 24); + */ + MLXSW_ITEM32(reg, sbpm, max_buff, 0x1C, 0, 24); + +-static inline void mlxsw_reg_sbpm_pack(char *payload, u8 local_port, u8 pool, ++static inline void mlxsw_reg_sbpm_pack(char *payload, u16 local_port, u8 pool, + enum mlxsw_reg_sbxx_dir dir, bool clr, + u32 min_buff, u32 max_buff) + { +@@ -11244,7 +11244,7 @@ MLXSW_ITEM32(reg, sbib, local_port, 0x00, 16, 8); + */ + MLXSW_ITEM32(reg, sbib, buff_size, 0x08, 0, 24); + +-static inline void mlxsw_reg_sbib_pack(char *payload, u8 local_port, ++static inline void mlxsw_reg_sbib_pack(char *payload, u16 local_port, + u32 buff_size) + { + MLXSW_REG_ZERO(sbib, payload); +-- +2.14.1 + diff --git a/patch/0097-2-mlxsw-i2c-Fix-chunk-size-setting.patch b/patch/0097-2-mlxsw-i2c-Fix-chunk-size-setting.patch new file mode 100644 index 000000000000..d80528ad2e34 --- /dev/null +++ b/patch/0097-2-mlxsw-i2c-Fix-chunk-size-setting.patch @@ -0,0 +1,39 @@ +From ac91378962238d34030bb4035308f88ba173165f Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Tue, 15 Aug 2023 09:22:01 +0000 +Subject: mlxsw: i2c: Fix chunk size setting in output mailbox buffer + +Links: https://github.com/jpirko/linux_mlxsw/commit/e4f63bb2ded0b1c812ef5cea900124b756837071 + http://patchwork.mtl.labs.mlnx/patch/4591830/ + +The driver reads commands output from the output mailbox. If the size +of the output mailbox is not a multiple of the transaction / +block size, then the driver will not issue enough read transactions +to read the entire output, which can result in driver initialization +errors. + +Fix by determining the number of transactions using DIV_ROUND_UP(). + +Fixes: 3029a69 ("mlxsw: i2c: Allow flexible setting of I2C transactions size") +Signed-off-by: Vadim Pasternak +Reviewed-by: Ido Schimmel +--- + drivers/net/ethernet/mellanox/mlxsw/i2c.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c +index b8a5c0cbb6b5..cc99ec3f4e96 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c +@@ -447,7 +447,7 @@ mlxsw_i2c_cmd(struct device *dev, u16 opcode, u32 in_mod, size_t in_mbox_size, + } else { + /* No input mailbox is case of initialization query command. */ + reg_size = MLXSW_I2C_MAX_DATA_SIZE; +- num = reg_size / mlxsw_i2c->block_size; ++ num = DIV_ROUND_UP(reg_size, mlxsw_i2c->block_size); + + if (mutex_lock_interruptible(&mlxsw_i2c->cmd.lock) < 0) { + dev_err(&client->dev, "Could not acquire lock"); +-- +2.14.1 + diff --git a/patch/0097-3-mlxsw-core_hwmon-Adjust-module-label-names.patch b/patch/0097-3-mlxsw-core_hwmon-Adjust-module-label-names.patch new file mode 100644 index 000000000000..7dbb2a24e82a --- /dev/null +++ b/patch/0097-3-mlxsw-core_hwmon-Adjust-module-label-names.patch @@ -0,0 +1,58 @@ +From 33aa62a331425d5828d417eeac7fab697eb45286 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Wed, 16 Aug 2023 11:56:51 +0000 +Subject: mlxsw: core_hwmon: Adjust module label names based on MTCAP sensor + counter +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Link: https://github.com/jpirko/linux_mlxsw/commit/0c604fbc8916ce220b2d30f0f75aa9566b18f496 + +Transceiver module temperature sensors are indexed after ASIC and +platform sensors. The current label printing method does not take this +into account and simply prints the index of the transceiver module +sensor. + +On new systems that have platform sensors this results in incorrect +(shifted) transceiver module labels being printed: + +$ sensors +[...] +front panel 002: +37.0°C (crit = +70.0°C, emerg = +75.0°C) +front panel 003: +47.0°C (crit = +70.0°C, emerg = +75.0°C) +[...] + +Fix by taking the sensor count into account. After the fix: + +$ sensors +[...] +front panel 001: +37.0°C (crit = +70.0°C, emerg = +75.0°C) +front panel 002: +47.0°C (crit = +70.0°C, emerg = +75.0°C) +[...] + +Fixes: a53779de6a0e ("mlxsw: core: Add QSFP module temperature label attribute to hwmon") +Signed-off-by: Vadim Pasternak +Reviewed-by: Ido Schimmel +Signed-off-by: Ciju Rajan K +--- + drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +index d41afdfbd085..464787b10b73 100644 +--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c +@@ -377,7 +377,8 @@ mlxsw_hwmon_module_temp_label_show(struct device *dev, + container_of(attr, struct mlxsw_hwmon_attr, dev_attr); + + return sprintf(buf, "front panel %03u\n", +- mlwsw_hwmon_attr->type_index); ++ mlwsw_hwmon_attr->type_index + 1 - ++ mlwsw_hwmon_attr->hwmon->sensor_count); + } + + static ssize_t +-- +2.14.1 + diff --git a/patch/0097-hwmon-mlxreg-fan-Support-distinctive-names-per-.patch b/patch/0097-hwmon-mlxreg-fan-Support-distinctive-names-per-diffe.patch similarity index 88% rename from patch/0097-hwmon-mlxreg-fan-Support-distinctive-names-per-.patch rename to patch/0097-hwmon-mlxreg-fan-Support-distinctive-names-per-diffe.patch index a5c4ce34ff4c..444cf32987dc 100644 --- a/patch/0097-hwmon-mlxreg-fan-Support-distinctive-names-per-.patch +++ b/patch/0097-hwmon-mlxreg-fan-Support-distinctive-names-per-diffe.patch @@ -1,7 +1,8 @@ +From 9e274525918eab0b820a88cf44238aae5d1a5b75 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Sun, 26 Sep 2021 08:35:41 +0300 -Subject: 0097 hwmon: (mlxreg-fan) Support distinctive names per - different cooling devices +Subject: [PATCH backport 5.10 097/182] hwmon: (mlxreg-fan) Support distinctive + names per different cooling devices Provide different names for cooling devices registration to allow binding each cooling devices to relevant thermal zone. Thus, specific @@ -17,7 +18,7 @@ Signed-off-by: Guenter Roeck 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c -index 780ae56a59ef..acba9d6888d4 100644 +index 8e5cd6991929..4a8becdb0d58 100644 --- a/drivers/hwmon/mlxreg-fan.c +++ b/drivers/hwmon/mlxreg-fan.c @@ -263,6 +263,13 @@ mlxreg_fan_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr, @@ -46,5 +47,5 @@ index 780ae56a59ef..acba9d6888d4 100644 dev_err(dev, "Failed to register cooling device\n"); return PTR_ERR(pwm->cdev); -- -2.17.1 +2.20.1 diff --git a/patch/0098-mlxsw-i2c-Prevent-transaction-execution-for.patch b/patch/0152-mlxsw-i2c-Prevent-transaction-execution-for-spec.patch similarity index 90% rename from patch/0098-mlxsw-i2c-Prevent-transaction-execution-for.patch rename to patch/0152-mlxsw-i2c-Prevent-transaction-execution-for-spec.patch index 4249ad90d867..bdc10f81fd46 100644 --- a/patch/0098-mlxsw-i2c-Prevent-transaction-execution-for.patch +++ b/patch/0152-mlxsw-i2c-Prevent-transaction-execution-for-spec.patch @@ -1,8 +1,10 @@ -From d3e0bf403d527f717a62ea328781256f999d4f95 Mon Sep 17 00:00:00 2001 +From fbc40a45f3688cb6be043a79556fab25bdf776d3 Mon Sep 17 00:00:00 2001 From: Stepan Blyschak Date: Mon, 20 Jun 2022 19:28:04 +0300 -Subject: [PATCH] mlxsw: i2c: Prevent transaction execution for special - chip states +Subject: =?UTF-8?q?From=20d3e0bf403d527f717a62ea328781256f999d4f95=20Mon?= + =?UTF-8?q?=20Sep=2017=2000:00:00=202001=0ASubject:=20[PATCH]=20mlxsw:=20i?= + =?UTF-8?q?2c:=20Prevent=20transaction=20execution=20for=20special=0A=20ch?= + =?UTF-8?q?ip=20states?= Do not run transaction in cases chip is in reset or in-service update states. In such case firmware is not accessible and will reject transaction @@ -16,11 +18,11 @@ Signed-off-by: Vadim Pasternak Signed-off-by: Stepan Blyschak --- drivers/net/ethernet/mellanox/mlxsw/cmd.h | 4 ++++ - drivers/net/ethernet/mellanox/mlxsw/i2c.c | 29 ++++++++++++++++++++--- + drivers/net/ethernet/mellanox/mlxsw/i2c.c | 29 ++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/cmd.h b/drivers/net/ethernet/mellanox/mlxsw/cmd.h -index 91f68fb0b..d8ecb8c8a 100644 +index 91f68fb0b420..d8ecb8c8a269 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/cmd.h +++ b/drivers/net/ethernet/mellanox/mlxsw/cmd.h @@ -149,6 +149,8 @@ enum mlxsw_cmd_status { @@ -42,7 +44,7 @@ index 91f68fb0b..d8ecb8c8a 100644 return "BAD_PKT"; default: diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c -index 939b692ff..3c9d2c7a0 100644 +index ce843ea91464..b8a5c0cbb6b5 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c +++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c @@ -63,6 +63,7 @@ @@ -59,12 +61,12 @@ index 939b692ff..3c9d2c7a0 100644 u16 block_size; + u8 status; }; - + #define MLXSW_I2C_READ_MSG(_client, _addr_buf, _buf, _len) { \ @@ -222,6 +224,19 @@ static int mlxsw_i2c_write_cmd(struct i2c_client *client, return 0; } - + +static bool +mlxsw_i2c_cmd_status_verify(struct device *dev, struct mlxsw_i2c *mlxsw_i2c, + u8 status) @@ -82,9 +84,9 @@ index 939b692ff..3c9d2c7a0 100644 static int mlxsw_i2c_write_init_cmd(struct i2c_client *client, @@ -405,6 +420,10 @@ mlxsw_i2c_cmd(struct device *dev, u16 opcode, u32 in_mod, size_t in_mbox_size, - + WARN_ON(in_mbox_size % sizeof(u32) || out_mbox_size % sizeof(u32)); - + + /* Do not run transaction if chip is in reset or in-service update state. */ + if (mlxsw_i2c->status) + return 0; @@ -93,14 +95,14 @@ index 939b692ff..3c9d2c7a0 100644 reg_size = mlxsw_i2c_get_reg_size(in_mbox); num = reg_size / mlxsw_i2c->block_size; @@ -479,6 +498,8 @@ mlxsw_i2c_cmd(struct device *dev, u16 opcode, u32 in_mod, size_t in_mbox_size, - + cmd_fail: mutex_unlock(&mlxsw_i2c->cmd.lock); + if (mlxsw_i2c_cmd_status_verify(&client->dev, mlxsw_i2c, *status)) + err = 0; return err; } - + @@ -608,14 +629,16 @@ static int mlxsw_i2c_probe(struct i2c_client *client, /* Wait until go bit is cleared. */ err = mlxsw_i2c_wait_go_bit(client, mlxsw_i2c, &status); @@ -110,7 +112,7 @@ index 939b692ff..3c9d2c7a0 100644 + dev_err(&client->dev, "HW semaphore is not released"); goto errout; } - + /* Validate transaction completion status. */ if (status) { - dev_err(&client->dev, "Bad transaction completion status %x\n", @@ -121,6 +123,6 @@ index 939b692ff..3c9d2c7a0 100644 err = -EIO; goto errout; } --- -2.17.1 +-- +2.14.1 diff --git a/patch/0157-platform-x86-mlx-platform-Make-activation-of-some-dr.patch b/patch/0157-platform-x86-mlx-platform-Make-activation-of-some-dr.patch index 0bea5c955d35..287146719caf 100644 --- a/patch/0157-platform-x86-mlx-platform-Make-activation-of-some-dr.patch +++ b/patch/0157-platform-x86-mlx-platform-Make-activation-of-some-dr.patch @@ -1,8 +1,8 @@ -From b384a287a5732f7ea3b6e0b13b1aa6ba0d70c440 Mon Sep 17 00:00:00 2001 +From 3124aea618244c17aee9b523f55c500ca3badf15 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 14 Feb 2022 09:46:16 +0200 -Subject: [PATCH platform-next 1/8] platform/x86: mlx-platform: Make activation - of some drivers conditional +Subject: [PATCH backport 5.10 157/182] platform/x86: mlx-platform: Make + activation of some drivers conditional Current assumption in driver that any system is capable of LED, hotplug or watchdog support. It could be not true for some new coming @@ -16,7 +16,7 @@ Signed-off-by: Vadim Pasternak 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index fac4b6dcf..e0a35412f 100644 +index fac4b6dcfdc7..e0a35412fa77 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -5206,16 +5206,18 @@ static int __init mlxplat_init(void) diff --git a/patch/0158-platform-x86-mlx-platform-Add-cosmetic-changes-for-a.patch b/patch/0158-platform-x86-mlx-platform-Add-cosmetic-changes-for-a.patch index 3696e76d8bb4..589a912282fe 100644 --- a/patch/0158-platform-x86-mlx-platform-Add-cosmetic-changes-for-a.patch +++ b/patch/0158-platform-x86-mlx-platform-Add-cosmetic-changes-for-a.patch @@ -1,8 +1,8 @@ -From cd26dadb7e9c5eedb4e24cd60d4de1cda0e8f889 Mon Sep 17 00:00:00 2001 +From 90e92c0d97686b0592415dba845a57362d78d122 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 14 Feb 2022 10:07:11 +0200 -Subject: [PATCH platform-next 2/8] platform/x86: mlx-platform: Add cosmetic - changes for alignment +Subject: [PATCH backport 5.10 158/182] platform/x86: mlx-platform: Add + cosmetic changes for alignment Align the first argument with open parenthesis for platform_device_register_resndata() calls. @@ -13,7 +13,7 @@ Signed-off-by: Vadim Pasternak 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index e0a35412f..a74fcd9d1 100644 +index e0a35412fa77..a74fcd9d184d 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -5183,22 +5183,20 @@ static int __init mlxplat_init(void) diff --git a/patch/0159-mlx-platform-Add-support-for-systems-equipped-with-t.patch b/patch/0159-mlx-platform-Add-support-for-systems-equipped-with-t.patch index 9f8c00636ad7..96046a821a79 100644 --- a/patch/0159-mlx-platform-Add-support-for-systems-equipped-with-t.patch +++ b/patch/0159-mlx-platform-Add-support-for-systems-equipped-with-t.patch @@ -1,8 +1,8 @@ -From a16c819d0896932ca52006fc0ba1c977bd2ad7f6 Mon Sep 17 00:00:00 2001 +From b04a280dbab5d36d0e3ee87f99ef21906a9238c5 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Wed, 26 Jan 2022 17:16:26 +0200 -Subject: [PATCH platform backport v5.10 03/10] mlx-platform: Add support for - systems equipped with two ASICs +Subject: [PATCH backport 5.10 159/182] mlx-platform: Add support for systems + equipped with two ASICs Motivation is to support new systems equipped with two ASICs. @@ -18,7 +18,7 @@ Reviewed-by: Oleksandr Shamray 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index a74fcd9d1..cbe9eab34 100644 +index a74fcd9d184d..cbe9eab3467f 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -34,6 +34,7 @@ diff --git a/patch/0160-platform-mellanox-Introduce-support-for-COMe-NVSwitc.patch b/patch/0160-platform-mellanox-Introduce-support-for-COMe-managem.patch similarity index 97% rename from patch/0160-platform-mellanox-Introduce-support-for-COMe-NVSwitc.patch rename to patch/0160-platform-mellanox-Introduce-support-for-COMe-managem.patch index d6de42d39cf7..9e7905d538b0 100644 --- a/patch/0160-platform-mellanox-Introduce-support-for-COMe-NVSwitc.patch +++ b/patch/0160-platform-mellanox-Introduce-support-for-COMe-managem.patch @@ -1,8 +1,8 @@ -From 333d4bcd32e3501d9bf3991dd5f2ff82061dab6b Mon Sep 17 00:00:00 2001 +From fd01b3306efc0e7a73e3b339ac4ae80678743b2a Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Wed, 26 Jan 2022 20:34:32 +0200 -Subject: [PATCH backport 5.10 01/17] platform: mellanox: Introduce support for - COMe management module for chassis +Subject: [PATCH backport 5.10 160/182] platform: mellanox: Introduce support + for COMe management module for chassis The system is built for artificial intelligence and accelerated analytics applications. Chassis is offered to cloud service @@ -17,7 +17,7 @@ Reviewed-by: Oleksandr Shamray 1 file changed, 269 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index cbe9eab34..e06fd1725 100644 +index cbe9eab3467f..e06fd1725beb 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -67,6 +67,9 @@ @@ -336,7 +336,7 @@ index cbe9eab34..e06fd1725 100644 + return 1; +} + - static int __init mlxplat_dmi_modular_matched(const struct dmi_system_id *dmi) + static int __init mlxplat_dmi_qmb8700_matched(const struct dmi_system_id *dmi) { int i; @@ -5044,6 +5307,12 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { diff --git a/patch/0161-platform-x86-mlx-platform-Add-support-for-new-system.patch b/patch/0161-platform-x86-mlx-platform-Add-support-for-new-system.patch index 602f752b7383..ddb5b0377197 100644 --- a/patch/0161-platform-x86-mlx-platform-Add-support-for-new-system.patch +++ b/patch/0161-platform-x86-mlx-platform-Add-support-for-new-system.patch @@ -1,7 +1,7 @@ -From 993337e78b0f9b88dba2a37eba37ae69828632e1 Mon Sep 17 00:00:00 2001 +From a38f9cb27bde5616bc71899841db733e305bf6c3 Mon Sep 17 00:00:00 2001 From: Felix Radensky Date: Sun, 24 Oct 2021 16:26:40 +0000 -Subject: [PATCH backport 5.10 02/17] platform/x86: mlx-platform: Add support +Subject: [PATCH backport 5.10 161/182] platform/x86: mlx-platform: Add support for new system XH3000 Add support for new system type XH3000, which is a water cooling @@ -17,7 +17,7 @@ Reviewed-by: Vadim Pasternak 1 file changed, 51 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index e06fd1725..2b1441a87 100644 +index e06fd1725beb..2b1441a8786f 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -2262,6 +2262,25 @@ static struct mlxreg_core_platform_data mlxplat_default_led_wc_data = { @@ -79,7 +79,7 @@ index e06fd1725..2b1441a87 100644 { int i; @@ -5277,6 +5321,13 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { - DMI_MATCH(DMI_PRODUCT_NAME, "MQM87"), + DMI_MATCH(DMI_PRODUCT_NAME, "MQM8700"), }, }, + { diff --git a/patch/0162-platform-mellanox-Add-COME-board-revision-register.patch b/patch/0162-platform-mellanox-Add-COME-board-revision-register.patch index 1efadbe9939c..bdc01da8ac20 100644 --- a/patch/0162-platform-mellanox-Add-COME-board-revision-register.patch +++ b/patch/0162-platform-mellanox-Add-COME-board-revision-register.patch @@ -1,7 +1,7 @@ -From 01cec35c2103e425d9f66f35f9cb91db7e9d9267 Mon Sep 17 00:00:00 2001 +From 267f4ad4ee5f52ecb3a7d3631d9f5a08a3adecef Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Wed, 6 Jul 2022 17:26:41 +0300 -Subject: [PATCH backport 5.10 03/17] platform: mellanox: Add COME board +Subject: [PATCH backport 5.10 162/182] platform: mellanox: Add COME board revision register Add to CPLD COME board configuration register for getting a board @@ -15,7 +15,7 @@ Signed-off-by: Vadim Pasternak 1 file changed, 21 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index 2b1441a87..1d0c13c65 100644 +index 2b1441a8786f..1d0c13c653b3 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -150,6 +150,7 @@ diff --git a/patch/0163-platform-mellanox-Introduce-support-for-rack-manager.patch b/patch/0163-platform-mellanox-Introduce-support-for-rack-manager.patch new file mode 100644 index 000000000000..5865c7ddd303 --- /dev/null +++ b/patch/0163-platform-mellanox-Introduce-support-for-rack-manager.patch @@ -0,0 +1,421 @@ +From 3ddb1633cbd4c914ac58b64247d5724ab7f2d6c3 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Mon, 14 Feb 2022 13:24:44 +0200 +Subject: [PATCH backport 5.10 163/182] platform: mellanox: Introduce support + for rack manager switch + +The rack switch is designed to provide high bandwidth, low latency +connectivity using optical fiber as the primary interconnect. + +System supports 32 OSFP ports, non-blocking switching capacity of +25.6Tbps. +System equipped with: +- 2 replaceable power supplies (AC) with 1+1 redundancy model. +- 7 replaceable fan drawers with 6+1 redundancy model. +- 2 External Root of Trust or EROT (Glacier) devices for securing + ASICs firmware. + +Signed-off-by: Vadim Pasternak +--- + drivers/platform/x86/mlx-platform.c | 259 ++++++++++++++++++++++++++++ + 1 file changed, 259 insertions(+) + +diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c +index 1d0c13c653b3..3ad85934d6e3 100644 +--- a/drivers/platform/x86/mlx-platform.c ++++ b/drivers/platform/x86/mlx-platform.c +@@ -90,6 +90,12 @@ + #define MLXPLAT_CPLD_LPC_REG_FAN_OFFSET 0x88 + #define MLXPLAT_CPLD_LPC_REG_FAN_EVENT_OFFSET 0x89 + #define MLXPLAT_CPLD_LPC_REG_FAN_MASK_OFFSET 0x8a ++#define MLXPLAT_CPLD_LPC_REG_EROT_OFFSET 0x91 ++#define MLXPLAT_CPLD_LPC_REG_EROT_EVENT_OFFSET 0x92 ++#define MLXPLAT_CPLD_LPC_REG_EROT_MASK_OFFSET 0x93 ++#define MLXPLAT_CPLD_LPC_REG_EROTE_OFFSET 0x94 ++#define MLXPLAT_CPLD_LPC_REG_EROTE_EVENT_OFFSET 0x95 ++#define MLXPLAT_CPLD_LPC_REG_EROTE_MASK_OFFSET 0x96 + #define MLXPLAT_CPLD_LPC_REG_LC_VR_OFFSET 0x9a + #define MLXPLAT_CPLD_LPC_REG_LC_VR_EVENT_OFFSET 0x9b + #define MLXPLAT_CPLD_LPC_REG_LC_VR_MASK_OFFSET 0x9c +@@ -109,6 +115,8 @@ + #define MLXPLAT_CPLD_LPC_REG_LC_SD_EVENT_OFFSET 0xaa + #define MLXPLAT_CPLD_LPC_REG_LC_SD_MASK_OFFSET 0xab + #define MLXPLAT_CPLD_LPC_REG_LC_PWR_ON 0xb2 ++#define MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET 0xc2 ++#define MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT 0xc3 + #define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_OFFSET 0xc7 + #define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_WP_OFFSET 0xc8 + #define MLXPLAT_CPLD_LPC_REG_WD1_TMR_OFFSET 0xc9 +@@ -215,6 +223,7 @@ + #define MLXPLAT_CPLD_LED_HI_NIBBLE_MASK GENMASK(3, 0) + #define MLXPLAT_CPLD_VOLTREG_UPD_MASK GENMASK(5, 4) + #define MLXPLAT_CPLD_GWP_MASK GENMASK(0, 0) ++#define MLXPLAT_CPLD_EROT_MASK GENMASK(1, 0) + #define MLXPLAT_CPLD_I2C_CAP_BIT 0x04 + #define MLXPLAT_CPLD_I2C_CAP_MASK GENMASK(5, MLXPLAT_CPLD_I2C_CAP_BIT) + +@@ -244,6 +253,7 @@ + #define MLXPLAT_CPLD_CH2_ETH_MODULAR 3 + #define MLXPLAT_CPLD_CH3_ETH_MODULAR 43 + #define MLXPLAT_CPLD_CH4_ETH_MODULAR 51 ++#define MLXPLAT_CPLD_CH2_RACK_SWITCH 18 + + /* Number of LPC attached MUX platform devices */ + #define MLXPLAT_CPLD_LPC_MUX_DEVS 4 +@@ -281,6 +291,9 @@ + /* Minimum power required for turning on Ethernet modular system (WATT) */ + #define MLXPLAT_CPLD_ETH_MODULAR_PWR_MIN 50 + ++/* Default value for PWM control register for rack switch system */ ++#define MLXPLAT_REGMAP_NVSWITCH_PWM_DEFAULT 0xf4 ++ + /* mlxplat_priv - platform private data + * @pdev_i2c - i2c controller platform device + * @pdev_mux - array of mux platform devices +@@ -461,6 +474,36 @@ static struct i2c_mux_reg_platform_data mlxplat_modular_mux_data[] = { + }, + }; + ++/* Platform channels for rack swicth system family */ ++static const int mlxplat_rack_switch_channels[] = { ++ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ++}; ++ ++/* Platform rack switch mux data */ ++static struct i2c_mux_reg_platform_data mlxplat_rack_switch_mux_data[] = { ++ { ++ .parent = 1, ++ .base_nr = MLXPLAT_CPLD_CH1, ++ .write_only = 1, ++ .reg = (void __iomem *)MLXPLAT_CPLD_LPC_REG1, ++ .reg_size = 1, ++ .idle_in_use = 1, ++ .values = mlxplat_rack_switch_channels, ++ .n_values = ARRAY_SIZE(mlxplat_rack_switch_channels), ++ }, ++ { ++ .parent = 1, ++ .base_nr = MLXPLAT_CPLD_CH2_RACK_SWITCH, ++ .write_only = 1, ++ .reg = (void __iomem *)MLXPLAT_CPLD_LPC_REG2, ++ .reg_size = 1, ++ .idle_in_use = 1, ++ .values = mlxplat_msn21xx_channels, ++ .n_values = ARRAY_SIZE(mlxplat_msn21xx_channels), ++ }, ++ ++}; ++ + /* Platform hotplug devices */ + static struct i2c_board_info mlxplat_mlxcpld_pwr[] = { + { +@@ -2165,6 +2208,97 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_chassis_blade_data = { + .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW, + }; + ++/* Platform hotplug for switch systems family data */ ++static struct mlxreg_core_data mlxplat_mlxcpld_erot_ap_items_data[] = { ++ { ++ .label = "erot1_ap", ++ .reg = MLXPLAT_CPLD_LPC_REG_EROT_OFFSET, ++ .mask = BIT(0), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "erot2_ap", ++ .reg = MLXPLAT_CPLD_LPC_REG_EROT_OFFSET, ++ .mask = BIT(1), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++}; ++ ++static struct mlxreg_core_data mlxplat_mlxcpld_erot_error_items_data[] = { ++ { ++ .label = "erot1_error", ++ .reg = MLXPLAT_CPLD_LPC_REG_EROTE_OFFSET, ++ .mask = BIT(0), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++ { ++ .label = "erot2_error", ++ .reg = MLXPLAT_CPLD_LPC_REG_EROTE_OFFSET, ++ .mask = BIT(1), ++ .hpdev.nr = MLXPLAT_CPLD_NR_NONE, ++ }, ++}; ++ ++static struct mlxreg_core_item mlxplat_mlxcpld_rack_switch_items[] = { ++ { ++ .data = mlxplat_mlxcpld_ext_psu_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = MLXPLAT_CPLD_PSU_EXT_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_ext_psu_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_ext_pwr_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = MLXPLAT_CPLD_PWR_EXT_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_ext_pwr_items_data), ++ .inversed = 0, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_default_ng_fan_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = MLXPLAT_CPLD_FAN_NG_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_default_ng_fan_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_erot_ap_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_EROT_OFFSET, ++ .mask = MLXPLAT_CPLD_EROT_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_erot_ap_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_erot_error_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_EROTE_OFFSET, ++ .mask = MLXPLAT_CPLD_EROT_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_erot_error_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++}; ++ ++static ++struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_rack_switch_data = { ++ .items = mlxplat_mlxcpld_rack_switch_items, ++ .counter = ARRAY_SIZE(mlxplat_mlxcpld_rack_switch_items), ++ .cell = MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET, ++ .mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF | MLXPLAT_CPLD_AGGR_MASK_COMEX, ++ .cell_low = MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET, ++ .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW, ++}; ++ + /* Platform led default data */ + static struct mlxreg_core_data mlxplat_mlxcpld_default_led_data[] = { + { +@@ -3166,6 +3300,42 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mask = GENMASK(7, 0) & ~BIT(2), + .mode = 0444, + }, ++ { ++ .label = "erot1_reset", ++ .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(6), ++ .mode = 0644, ++ }, ++ { ++ .label = "erot2_reset", ++ .reg = MLXPLAT_CPLD_LPC_REG_RESET_GP2_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(7), ++ .mode = 0644, ++ }, ++ { ++ .label = "erot1_recovery", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(6), ++ .mode = 0644, ++ }, ++ { ++ .label = "erot2_recovery", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(7), ++ .mode = 0644, ++ }, ++ { ++ .label = "erot1_wp", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(4), ++ .mode = 0644, ++ }, ++ { ++ .label = "erot2_wp", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(5), ++ .mode = 0644, ++ }, + { + .label = "reset_long_pb", + .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, +@@ -3361,6 +3531,25 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mask = GENMASK(7, 0) & ~BIT(4), + .mode = 0644, + }, ++ { ++ .label = "erot1_ap_reset", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(0), ++ .mode = 0444, ++ }, ++ { ++ .label = "erot2_ap_reset", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(1), ++ .mode = 0444, ++ }, ++ { ++ .label = "spi_chnl_select", ++ .reg = MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT, ++ .mask = GENMASK(7, 0), ++ .bit = 1, ++ .mode = 0644, ++ }, + { + .label = "config1", + .reg = MLXPLAT_CPLD_LPC_REG_CONFIG1_OFFSET, +@@ -4577,6 +4766,10 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_PWR_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_AGGRLC_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_IN_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_IN_MASK_OFFSET: +@@ -4594,6 +4787,7 @@ static bool mlxplat_mlxcpld_writeable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_LC_SD_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_SD_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_PWR_ON: ++ case MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT: + case MLXPLAT_CPLD_LPC_REG_WD_CLEAR_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD_CLEAR_WP_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD1_TMR_OFFSET: +@@ -4678,6 +4872,12 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_FAN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_AGGRLC_OFFSET: + case MLXPLAT_CPLD_LPC_REG_AGGRLC_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_IN_OFFSET: +@@ -4702,6 +4902,8 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_LC_SD_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_SD_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_PWR_ON: ++ case MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT: + case MLXPLAT_CPLD_LPC_REG_WD_CLEAR_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD_CLEAR_WP_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD1_TMR_OFFSET: +@@ -4812,6 +5014,12 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_FAN_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_FAN_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROT_MASK_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_EVENT_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_EROTE_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_AGGRLC_OFFSET: + case MLXPLAT_CPLD_LPC_REG_AGGRLC_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_IN_OFFSET: +@@ -4836,6 +5044,8 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) + case MLXPLAT_CPLD_LPC_REG_LC_SD_EVENT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_SD_MASK_OFFSET: + case MLXPLAT_CPLD_LPC_REG_LC_PWR_ON: ++ case MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET: ++ case MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT: + case MLXPLAT_CPLD_LPC_REG_WD2_TMR_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD2_TLEFT_OFFSET: + case MLXPLAT_CPLD_LPC_REG_WD3_TMR_OFFSET: +@@ -4903,6 +5113,13 @@ static const struct reg_default mlxplat_mlxcpld_regmap_ng400[] = { + { MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET, 0x00 }, + }; + ++static const struct reg_default mlxplat_mlxcpld_regmap_rack_switch[] = { ++ { MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, MLXPLAT_REGMAP_NVSWITCH_PWM_DEFAULT }, ++ { MLXPLAT_CPLD_LPC_REG_WD1_ACT_OFFSET, 0x00 }, ++ { MLXPLAT_CPLD_LPC_REG_WD2_ACT_OFFSET, 0x00 }, ++ { MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET, 0x00 }, ++}; ++ + static const struct reg_default mlxplat_mlxcpld_regmap_eth_modular[] = { + { MLXPLAT_CPLD_LPC_REG_GP2_OFFSET, 0x61 }, + { MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, 0x00 }, +@@ -4996,6 +5213,20 @@ static const struct regmap_config mlxplat_mlxcpld_regmap_config_ng400 = { + .reg_write = mlxplat_mlxcpld_reg_write, + }; + ++static const struct regmap_config mlxplat_mlxcpld_regmap_config_rack_switch = { ++ .reg_bits = 8, ++ .val_bits = 8, ++ .max_register = 255, ++ .cache_type = REGCACHE_FLAT, ++ .writeable_reg = mlxplat_mlxcpld_writeable_reg, ++ .readable_reg = mlxplat_mlxcpld_readable_reg, ++ .volatile_reg = mlxplat_mlxcpld_volatile_reg, ++ .reg_defaults = mlxplat_mlxcpld_regmap_rack_switch, ++ .num_reg_defaults = ARRAY_SIZE(mlxplat_mlxcpld_regmap_rack_switch), ++ .reg_read = mlxplat_mlxcpld_reg_read, ++ .reg_write = mlxplat_mlxcpld_reg_write, ++}; ++ + static const struct regmap_config mlxplat_mlxcpld_regmap_config_eth_modular = { + .reg_bits = 8, + .val_bits = 8, +@@ -5303,6 +5534,27 @@ static int __init mlxplat_dmi_qmb8700_matched(const struct dmi_system_id *dmi) + return 1; + } + ++static int __init mlxplat_dmi_rack_switch_matched(const struct dmi_system_id *dmi) ++{ ++ int i; ++ ++ mlxplat_max_adap_num = MLXPLAT_CPLD_MAX_PHYS_ADAPTER_NUM; ++ mlxplat_mux_num = ARRAY_SIZE(mlxplat_rack_switch_mux_data); ++ mlxplat_mux_data = mlxplat_rack_switch_mux_data; ++ mlxplat_hotplug = &mlxplat_mlxcpld_rack_switch_data; ++ mlxplat_hotplug->deferred_nr = ++ mlxplat_msn21xx_channels[MLXPLAT_CPLD_GRP_CHNL_NUM - 1]; ++ mlxplat_led = &mlxplat_default_ng_led_data; ++ mlxplat_regs_io = &mlxplat_default_ng_regs_io_data; ++ mlxplat_fan = &mlxplat_default_fan_data; ++ for (i = 0; i < ARRAY_SIZE(mlxplat_mlxcpld_wd_set_type2); i++) ++ mlxplat_wd_data[i] = &mlxplat_mlxcpld_wd_set_type2[i]; ++ mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; ++ mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_rack_switch; ++ ++ return 1; ++} ++ + static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + { + .callback = mlxplat_dmi_default_wc_matched, +@@ -5367,6 +5619,13 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + DMI_MATCH(DMI_BOARD_NAME, "VMOD0009"), + }, + }, ++ { ++ .callback = mlxplat_dmi_rack_switch_matched, ++ .matches = { ++ DMI_MATCH(DMI_BOARD_NAME, "VMOD0010"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "HI142"), ++ }, ++ }, + { + .callback = mlxplat_dmi_ng400_matched, + .matches = { +-- +2.20.1 + diff --git a/patch/0164-hwmon-jc42-Add-support-for-Seiko-Instruments-S-34TS0.patch b/patch/0164-hwmon-jc42-Add-support-for-Seiko-Instruments-S-34TS0.patch index 946a19675176..1d5e6dd0986f 100644 --- a/patch/0164-hwmon-jc42-Add-support-for-Seiko-Instruments-S-34TS0.patch +++ b/patch/0164-hwmon-jc42-Add-support-for-Seiko-Instruments-S-34TS0.patch @@ -1,7 +1,8 @@ -From d8f82a399f46cfc1b91c2dd64dd18741ce9d7e5a Mon Sep 17 00:00:00 2001 +From c1af33181092b2b2fc53ee5bd10f9ebcdcea1faf Mon Sep 17 00:00:00 2001 From: Oleksandr Shamray Date: Tue, 22 Feb 2022 18:55:15 +0200 -Subject: [PATCH] hwmon: (jc42) Add support for Seiko Instruments S-34TS04A +Subject: [PATCH backport 5.10 164/182] hwmon: (jc42) Add support for Seiko + Instruments S-34TS04A S-34TS04A is a JC42.4 compatible temperature sensor from Seiko Instruments. @@ -12,7 +13,7 @@ Reviewed-by: Vadim Pasternak 1 file changed, 6 insertions(+) diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c -index 4a03d010e..bda2c9fb1 100644 +index 4a03d010ec5a..bda2c9fb1f68 100644 --- a/drivers/hwmon/jc42.c +++ b/drivers/hwmon/jc42.c @@ -63,6 +63,7 @@ static const unsigned short normal_i2c[] = { @@ -43,5 +44,5 @@ index 4a03d010e..bda2c9fb1 100644 { STM_MANID, STTS424E_DEVID, STTS424E_DEVID_MASK }, { STM_MANID, STTS2002_DEVID, STTS2002_DEVID_MASK }, -- -2.14.1 +2.20.1 diff --git a/patch/0165-platform-mellanox-mlxreg-io-Add-locking-for-io-opera.patch b/patch/0165-platform-mellanox-mlxreg-io-Add-locking-for-io-opera.patch index 76ec54b577aa..494b1810fda6 100644 --- a/patch/0165-platform-mellanox-mlxreg-io-Add-locking-for-io-opera.patch +++ b/patch/0165-platform-mellanox-mlxreg-io-Add-locking-for-io-opera.patch @@ -1,8 +1,8 @@ -From 77e8886b6019a37335c66dceb39429c33eb87f28 Mon Sep 17 00:00:00 2001 +From 736f644255c56d2adf32b694d0fd83e2ab6d2d77 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 7 Feb 2022 21:22:04 +0200 -Subject: [PATCH platform-next 02/10] platform/mellanox: mlxreg-io: Add locking - for io operations +Subject: [PATCH backport 5.10 165/182] platform/mellanox: mlxreg-io: Add + locking for io operations Add lock to protect user read/write access to the registers. @@ -12,7 +12,7 @@ Signed-off-by: Vadim Pasternak 1 file changed, 23 insertions(+) diff --git a/drivers/platform/mellanox/mlxreg-io.c b/drivers/platform/mellanox/mlxreg-io.c -index 2c2686d5c..ddc08abf3 100644 +index 2c2686d5c2fc..ddc08abf398c 100644 --- a/drivers/platform/mellanox/mlxreg-io.c +++ b/drivers/platform/mellanox/mlxreg-io.c @@ -31,6 +31,7 @@ diff --git a/patch/0167-leds-mlxreg-Send-udev-change-event.patch b/patch/0166-DS-leds-leds-mlxreg-Send-udev-event-from-leds-mlxreg.patch similarity index 63% rename from patch/0167-leds-mlxreg-Send-udev-change-event.patch rename to patch/0166-DS-leds-leds-mlxreg-Send-udev-event-from-leds-mlxreg.patch index 2ec9dd86f63c..9bc90efc991e 100644 --- a/patch/0167-leds-mlxreg-Send-udev-change-event.patch +++ b/patch/0166-DS-leds-leds-mlxreg-Send-udev-event-from-leds-mlxreg.patch @@ -1,14 +1,22 @@ -From fffab288f4508647dd67ffc854f8f1af1fae44a7 Mon Sep 17 00:00:00 2001 -From: Kebo Liu -Date: Mon, 11 Jul 2022 15:26:20 +0800 -Subject: [PATCH] leds mlxreg send udev change event +From 58797f651264dd362655e7c45bce48a2929cf55c Mon Sep 17 00:00:00 2001 +From: Michael Shych +Date: Mon, 11 Jul 2022 12:51:27 +0300 +Subject: [PATCH backport 5.10 166/182] DS: leds: leds-mlxreg: Send udev event + from leds-mlxreg driver. +Add sending udev event from leds-mlxreg driver in case of color change. +This patch will not be accepted in upstream as it provides no regular flow. +It's done as a workaround of SN2201 limitation, difference, and in order +to save compatibility of NOS work with sysfs attributes. +The patch should be taken to NOSs as exceptions to the upstream procedure. + +Signed-off-by: Michael Shych --- drivers/leds/leds-mlxreg.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c -index 82aea1c..c9c7c82 100644 +index 7df4653a80d7..137ba5afa921 100644 --- a/drivers/leds/leds-mlxreg.c +++ b/drivers/leds/leds-mlxreg.c @@ -11,6 +11,7 @@ @@ -49,18 +57,18 @@ index 82aea1c..c9c7c82 100644 if (value) - return mlxreg_led_store_hw(led_data, led_data->base_color); -+ err = mlxreg_led_store_hw(led_data, led_data->base_color); ++ err = mlxreg_led_store_hw(led_data, led_data->base_color); + else -+ err = mlxreg_led_store_hw(led_data, MLXREG_LED_IS_OFF); ++ err = mlxreg_led_store_hw(led_data, MLXREG_LED_IS_OFF); + + if (!err) -+ return mlxreg_led_udev_event_send(led_data, value); ++ return mlxreg_led_udev_event_send(led_data, value); else - return mlxreg_led_store_hw(led_data, MLXREG_LED_IS_OFF); -+ return err; ++ return err; } static enum led_brightness -- -1.9.1 +2.20.1 diff --git a/patch/0170-i2c-mlxcpld-Fix-register-setting-for-400KHz-frequenc.patch b/patch/0170-i2c-mlxcpld-Fix-register-setting-for-400KHz-frequenc.patch index 3df1c94850cd..64e3412f9f9b 100644 --- a/patch/0170-i2c-mlxcpld-Fix-register-setting-for-400KHz-frequenc.patch +++ b/patch/0170-i2c-mlxcpld-Fix-register-setting-for-400KHz-frequenc.patch @@ -1,7 +1,7 @@ -From 553016c0c35314b0cd9fc3ed3c37d04ec0c6c14e Mon Sep 17 00:00:00 2001 +From d0aec4e04bda89b1183f7568cc64519cda380da8 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Mon, 13 Jun 2022 20:51:35 +0300 -Subject: [PATCH i2c backport v5.10 1/1] i2c: mlxcpld: Fix register setting for +Subject: [PATCH backport 5.10 170/182] i2c: mlxcpld: Fix register setting for 400KHz frequency Fix setting of 'Half Cycle' register for 400KHz frequency. @@ -13,7 +13,7 @@ Signed-off-by: Vadim Pasternak 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c -index fb451d42a..85b78985f 100644 +index 363ea9fd66c4..72fcfb17dd67 100644 --- a/drivers/i2c/busses/i2c-mlxcpld.c +++ b/drivers/i2c/busses/i2c-mlxcpld.c @@ -49,7 +49,7 @@ diff --git a/patch/0171-platform-mellanox-mlxreg-lc-Fix-cleanup-on-failure-a.patch b/patch/0171-platform-mellanox-mlxreg-lc-Fix-cleanup-on-failure-a.patch deleted file mode 100644 index fd84f2801894..000000000000 --- a/patch/0171-platform-mellanox-mlxreg-lc-Fix-cleanup-on-failure-a.patch +++ /dev/null @@ -1,194 +0,0 @@ -From 68ff1efc9fdb309cd9093c4317634b601984ff6e Mon Sep 17 00:00:00 2001 -From: Vadim Pasternak -Date: Wed, 22 Jun 2022 13:01:15 +0300 -Subject: [PATCH platform 1/1] platform/mellanox: mlxreg-lc: Fix cleanup on - failure and add more verbosity in error flow - -Clean client object in case of probing failure. -Prevent running remove routine in case probing failed. -Add error log for each kind of failures during probing. - -Fixes: 62f9529b8d5c ("platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices") -Signed-off-by: Vadim Pasternak ---- - drivers/platform/mellanox/mlxreg-lc.c | 85 ++++++++++++++++++++------- - 1 file changed, 63 insertions(+), 22 deletions(-) - -diff --git a/drivers/platform/mellanox/mlxreg-lc.c b/drivers/platform/mellanox/mlxreg-lc.c -index ea8324020..79d35a281 100644 ---- a/drivers/platform/mellanox/mlxreg-lc.c -+++ b/drivers/platform/mellanox/mlxreg-lc.c -@@ -559,9 +559,6 @@ static int mlxreg_lc_event_handler(void *handle, enum mlxreg_hotplug_kind kind, - dev_info(mlxreg_lc->dev, "linecard#%d state %d event kind %d action %d\n", - mlxreg_lc->data->slot, mlxreg_lc->state, kind, action); - -- if (!(mlxreg_lc->state & MLXREG_LC_INITIALIZED)) -- return 0; -- - switch (kind) { - case MLXREG_HOTPLUG_LC_SYNCED: - /* -@@ -715,8 +712,12 @@ mlxreg_lc_config_init(struct mlxreg_lc *mlxreg_lc, void *regmap, - switch (regval) { - case MLXREG_LC_SN4800_C16: - err = mlxreg_lc_sn4800_c16_config_init(mlxreg_lc, regmap, data); -- if (err) -+ if (err) { -+ dev_err(dev, "Failed to config client %s at bus %d at addr 0x%02x\n", -+ data->hpdev.brdinfo->type, data->hpdev.nr, -+ data->hpdev.brdinfo->addr); - return err; -+ } - break; - default: - return -ENODEV; -@@ -729,8 +730,11 @@ mlxreg_lc_config_init(struct mlxreg_lc *mlxreg_lc, void *regmap, - mlxreg_lc->mux = platform_device_register_resndata(dev, "i2c-mux-mlxcpld", data->hpdev.nr, - NULL, 0, mlxreg_lc->mux_data, - sizeof(*mlxreg_lc->mux_data)); -- if (IS_ERR(mlxreg_lc->mux)) -+ if (IS_ERR(mlxreg_lc->mux)) { -+ dev_err(dev, "Failed to create mux infra for client %s at bus %d at addr 0x%02x\n", -+ data->hpdev.brdinfo->type, data->hpdev.nr, data->hpdev.brdinfo->addr); - return PTR_ERR(mlxreg_lc->mux); -+ } - - /* Register IO access driver. */ - if (mlxreg_lc->io_data) { -@@ -739,6 +743,9 @@ mlxreg_lc_config_init(struct mlxreg_lc *mlxreg_lc, void *regmap, - platform_device_register_resndata(dev, "mlxreg-io", data->hpdev.nr, NULL, 0, - mlxreg_lc->io_data, sizeof(*mlxreg_lc->io_data)); - if (IS_ERR(mlxreg_lc->io_regs)) { -+ dev_err(dev, "Failed to create regio for client %s at bus %d at addr 0x%02x\n", -+ data->hpdev.brdinfo->type, data->hpdev.nr, -+ data->hpdev.brdinfo->addr); - err = PTR_ERR(mlxreg_lc->io_regs); - goto fail_register_io; - } -@@ -752,6 +759,9 @@ mlxreg_lc_config_init(struct mlxreg_lc *mlxreg_lc, void *regmap, - mlxreg_lc->led_data, - sizeof(*mlxreg_lc->led_data)); - if (IS_ERR(mlxreg_lc->led)) { -+ dev_err(dev, "Failed to create LED objects for client %s at bus %d at addr 0x%02x\n", -+ data->hpdev.brdinfo->type, data->hpdev.nr, -+ data->hpdev.brdinfo->addr); - err = PTR_ERR(mlxreg_lc->led); - goto fail_register_led; - } -@@ -808,7 +818,8 @@ static int mlxreg_lc_probe(struct platform_device *pdev) - if (!data->hpdev.adapter) { - dev_err(&pdev->dev, "Failed to get adapter for bus %d\n", - data->hpdev.nr); -- return -EFAULT; -+ err = -EFAULT; -+ goto i2c_get_adapter_fail; - } - - /* Create device at the top of line card I2C tree.*/ -@@ -817,32 +828,40 @@ static int mlxreg_lc_probe(struct platform_device *pdev) - if (IS_ERR(data->hpdev.client)) { - dev_err(&pdev->dev, "Failed to create client %s at bus %d at addr 0x%02x\n", - data->hpdev.brdinfo->type, data->hpdev.nr, data->hpdev.brdinfo->addr); -- -- i2c_put_adapter(data->hpdev.adapter); -- data->hpdev.adapter = NULL; -- return PTR_ERR(data->hpdev.client); -+ err = PTR_ERR(data->hpdev.client); -+ goto i2c_new_device_fail; - } - - regmap = devm_regmap_init_i2c(data->hpdev.client, - &mlxreg_lc_regmap_conf); - if (IS_ERR(regmap)) { -+ dev_err(&pdev->dev, "Failed to create regmap for client %s at bus %d at addr 0x%02x\n", -+ data->hpdev.brdinfo->type, data->hpdev.nr, data->hpdev.brdinfo->addr); - err = PTR_ERR(regmap); -- goto mlxreg_lc_probe_fail; -+ goto devm_regmap_init_i2c_fail; - } - - /* Set default registers. */ - for (i = 0; i < mlxreg_lc_regmap_conf.num_reg_defaults; i++) { - err = regmap_write(regmap, mlxreg_lc_regmap_default[i].reg, - mlxreg_lc_regmap_default[i].def); -- if (err) -- goto mlxreg_lc_probe_fail; -+ if (err) { -+ dev_err(&pdev->dev, "Failed to set default regmap %d for client %s at bus %d at addr 0x%02x\n", -+ i, data->hpdev.brdinfo->type, data->hpdev.nr, -+ data->hpdev.brdinfo->addr); -+ goto regmap_write_fail; -+ } - } - - /* Sync registers with hardware. */ - regcache_mark_dirty(regmap); - err = regcache_sync(regmap); -- if (err) -- goto mlxreg_lc_probe_fail; -+ if (err) { -+ dev_err(&pdev->dev, "Failed to sync regmap for client %s at bus %d at addr 0x%02x\n", -+ data->hpdev.brdinfo->type, data->hpdev.nr, data->hpdev.brdinfo->addr); -+ err = PTR_ERR(regmap); -+ goto regcache_sync_fail; -+ } - - par_pdata = data->hpdev.brdinfo->platform_data; - mlxreg_lc->par_regmap = par_pdata->regmap; -@@ -853,12 +872,27 @@ static int mlxreg_lc_probe(struct platform_device *pdev) - /* Configure line card. */ - err = mlxreg_lc_config_init(mlxreg_lc, regmap, data); - if (err) -- goto mlxreg_lc_probe_fail; -+ goto mlxreg_lc_config_init_fail; - - return err; - --mlxreg_lc_probe_fail: -+mlxreg_lc_config_init_fail: -+regcache_sync_fail: -+regmap_write_fail: -+devm_regmap_init_i2c_fail: -+ if (data->hpdev.client) { -+ i2c_unregister_device(data->hpdev.client); -+ data->hpdev.client = NULL; -+ } -+i2c_new_device_fail: - i2c_put_adapter(data->hpdev.adapter); -+ data->hpdev.adapter = NULL; -+i2c_get_adapter_fail: -+ /* Clear event notification callback and handle. */ -+ if (data->notifier) { -+ data->notifier->user_handler = NULL; -+ data->notifier->handle = NULL; -+ } - return err; - } - -@@ -867,11 +901,18 @@ static int mlxreg_lc_remove(struct platform_device *pdev) - struct mlxreg_core_data *data = dev_get_platdata(&pdev->dev); - struct mlxreg_lc *mlxreg_lc = platform_get_drvdata(pdev); - -- /* Clear event notification callback. */ -- if (data->notifier) { -- data->notifier->user_handler = NULL; -- data->notifier->handle = NULL; -- } -+ /* -+ * Probing and removing are invoked by hotplug events raised on line card insertion and -+ * removing. If probing procedure fails all data is cleared. However, hotplug event still -+ * will be raised on line card removing and activate removing procedure. In this case there -+ * is nothing to remove. -+ */ -+ if (!data->notifier || !data->notifier->handle) -+ return 0; -+ -+ /* Clear event notification callback and handle. */ -+ data->notifier->user_handler = NULL; -+ data->notifier->handle = NULL; - - /* Destroy static I2C device feeding by main power. */ - mlxreg_lc_destroy_static_devices(mlxreg_lc, mlxreg_lc->main_devs, --- -2.20.1 - diff --git a/patch/0173-core-Add-support-for-OSFP-transceiver-modules.patch b/patch/0173-mlxsw-core-Add-support-for-OSFP-transceiver-modules.patch similarity index 92% rename from patch/0173-core-Add-support-for-OSFP-transceiver-modules.patch rename to patch/0173-mlxsw-core-Add-support-for-OSFP-transceiver-modules.patch index 75963661e262..579bb8455131 100644 --- a/patch/0173-core-Add-support-for-OSFP-transceiver-modules.patch +++ b/patch/0173-mlxsw-core-Add-support-for-OSFP-transceiver-modules.patch @@ -1,7 +1,7 @@ -From 2d0cae902b722594b17335e7aceb6500d9bb4525 Mon Sep 17 00:00:00 2001 +From f4a99113cce99f7c41e753ff1097120bc33b6951 Mon Sep 17 00:00:00 2001 From: Danielle Ratson Date: Tue, 22 Feb 2022 19:17:03 +0200 -Subject: [PATCH platform backport v5.10 1/1] mlxsw: core: Add support for OSFP +Subject: [PATCH backport 5.10 173/182] mlxsw: core: Add support for OSFP transceiver modules The driver can already dump the EEPROM contents of QSFP-DD transceiver @@ -43,7 +43,7 @@ index 98f7cf672d9e..f9c770eec8f8 100644 * type through the identifier value. */ diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h -index ce3842ed8460..bec9d94b718a 100644 +index 7b71e9ae3d51..f8c828e057c8 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h @@ -8950,6 +8950,7 @@ enum mlxsw_reg_mcia_eeprom_module_info_id { diff --git a/patch/0175-hwmon-pmbus-Add-support-for-Infineon-Digital-Multi-p.patch b/patch/0175-hwmon-pmbus-Add-support-for-Infineon-Digital-Multi-p.patch index 4f7b6a85b1cc..7718796dbb45 100644 --- a/patch/0175-hwmon-pmbus-Add-support-for-Infineon-Digital-Multi-p.patch +++ b/patch/0175-hwmon-pmbus-Add-support-for-Infineon-Digital-Multi-p.patch @@ -1,8 +1,8 @@ -From 0daa4a8f50be59f0549bbda2d06ad5b74d5134bd Mon Sep 17 00:00:00 2001 +From de8198c01c722ac99814d7eaa81d4b63044684e6 Mon Sep 17 00:00:00 2001 From: "Greg.Schwendimann@infineon.com" Date: Wed, 27 Apr 2022 18:40:12 +0000 -Subject: [PATCH hwmon backport v5.10 1/1] hwmon: (pmbus) Add support for - Infineon Digital Multi-phase xdp152 family controllers +Subject: [PATCH backport 5.10 175/182] hwmon: (pmbus) Add support for Infineon + Digital Multi-phase xdp152 family controllers Add support for devices XDPE152C4, XDPE12584. diff --git a/patch/0176-platform-mellanox-fix-reset_pwr_converter_fail-attri.patch b/patch/0176-platform-mellanox-fix-reset_pwr_converter_fail-attri.patch new file mode 100644 index 000000000000..0ed069f65a96 --- /dev/null +++ b/patch/0176-platform-mellanox-fix-reset_pwr_converter_fail-attri.patch @@ -0,0 +1,31 @@ +From eb20a45ca217d897a1cb623c3ae84d97e6000f88 Mon Sep 17 00:00:00 2001 +From: Michael Shych +Date: Sun, 4 Sep 2022 10:41:45 +0300 +Subject: [PATCH backport 5.10 176/182] platform: mellanox: fix + reset_pwr_converter_fail attribute. + +Change incorrect reset_voltmon_upgrade_fail atitribute name to +reset_pwr_converter_fail. + +Signed-off-by: Michael Shych +Reviewed-by: Vadim Pasternak +--- + drivers/platform/x86/mlx-platform.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c +index 135ccea3a34e..3f29ab98480d 100644 +--- a/drivers/platform/x86/mlx-platform.c ++++ b/drivers/platform/x86/mlx-platform.c +@@ -3414,7 +3414,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mode = 0444, + }, + { +- .label = "reset_voltmon_upgrade_fail", ++ .label = "reset_pwr_converter_fail", + .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE2_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(0), + .mode = 0444, +-- +2.20.1 + diff --git a/patch/0177-Documentation-ABI-fix-description-of-fix-reset_pwr_c.patch b/patch/0177-Documentation-ABI-fix-description-of-fix-reset_pwr_c.patch new file mode 100644 index 000000000000..7c3bed1ce766 --- /dev/null +++ b/patch/0177-Documentation-ABI-fix-description-of-fix-reset_pwr_c.patch @@ -0,0 +1,38 @@ +From 0e8bb4ec5d0133a9d3d3e307095aca57d47bfb36 Mon Sep 17 00:00:00 2001 +From: Michael Shych +Date: Sun, 4 Sep 2022 10:46:01 +0300 +Subject: [PATCH backport 5.10 177/182] Documentation/ABI: fix description of + fix reset_pwr_converter_fail attribute. + +Change description of incorrect reset_voltmon_upgrade_fail atitribute +name to reset_pwr_converter_fail. + +Signed-off-by: Michael Shych +Reviewed-by: Vadim Pasternak +--- + Documentation/ABI/stable/sysfs-driver-mlxreg-io | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Documentation/ABI/stable/sysfs-driver-mlxreg-io b/Documentation/ABI/stable/sysfs-driver-mlxreg-io +index 0913a8daf767..ac503e84e7b3 100644 +--- a/Documentation/ABI/stable/sysfs-driver-mlxreg-io ++++ b/Documentation/ABI/stable/sysfs-driver-mlxreg-io +@@ -103,13 +103,13 @@ Description: These files show the system reset cause, as following: power + What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_comex_pwr_fail + What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_from_comex + What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_system +-What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_voltmon_upgrade_fail ++What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_pwr_converter_fail + Date: November 2018 + KernelVersion: 5.0 + Contact: Vadim Pasternak + Description: These files show the system reset cause, as following: ComEx + power fail, reset from ComEx, system platform reset, reset +- due to voltage monitor devices upgrade failure, ++ due to power converter devices failure, + Value 1 in file means this is reset cause, 0 - otherwise. + Only one bit could be 1 at the same time, representing only + the last reset cause. +-- +2.20.1 + diff --git a/patch/0178-platform-mellanox-Introduce-support-for-next-generat.patch b/patch/0178-platform-mellanox-Introduce-support-for-next-generat.patch new file mode 100644 index 000000000000..ecf135f71858 --- /dev/null +++ b/patch/0178-platform-mellanox-Introduce-support-for-next-generat.patch @@ -0,0 +1,295 @@ +From 30a9045deb3da304b03f8451fad1a8d79a849da9 Mon Sep 17 00:00:00 2001 +From: Michael Shych +Date: Sun, 4 Sep 2022 14:03:58 +0300 +Subject: [PATCH backport 5.10 178/182] platform: mellanox: Introduce support + for next-generation 800GB/s ethernet switch. + +Introduce support for Nvidia next-generation 800GB/s ethernet switch - SN5600. +SN5600 is 51.2 Tbps Ethernet switch based on Nvidia Spectrum-4 ASIC. +It can provide up to 64x800Gb/s (ETH) full bidirectional bandwidth per port +using PAM-4 modulations. The system supports 64 Belly to Belly 2x4 OSFP cages. +The switch was designed to fit standard 2U racks. + +Features: +- 64 OSFP ports support 800GbE - 10GbE speed. +- Additional 25GbE - 1GbE service port on the front panel. +- Air-cooled with 3 + 1 redundant fan units. +- 1 + 1 redundant 3000W or 3600W PSUs. +- System management board is based on Intel Coffee-lake CPU E-2276 + with secure-boot support. + +Signed-off-by: Michael Shych +Reviewed-by: Vadim Pasternak +--- + drivers/platform/x86/mlx-platform.c | 178 ++++++++++++++++++++++++++++ + 1 file changed, 178 insertions(+) + +diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c +index 3f29ab98480d..4bbe1d8f016d 100644 +--- a/drivers/platform/x86/mlx-platform.c ++++ b/drivers/platform/x86/mlx-platform.c +@@ -255,6 +255,7 @@ + #define MLXPLAT_CPLD_CH3_ETH_MODULAR 43 + #define MLXPLAT_CPLD_CH4_ETH_MODULAR 51 + #define MLXPLAT_CPLD_CH2_RACK_SWITCH 18 ++#define MLXPLAT_CPLD_CH2_NG800 34 + + /* Number of LPC attached MUX platform devices */ + #define MLXPLAT_CPLD_LPC_MUX_DEVS 4 +@@ -505,6 +506,37 @@ static struct i2c_mux_reg_platform_data mlxplat_rack_switch_mux_data[] = { + + }; + ++/* Platform channels for ng800 system family */ ++static const int mlxplat_ng800_channels[] = { ++ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ++ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 ++}; ++ ++/* Platform ng800 mux data */ ++static struct i2c_mux_reg_platform_data mlxplat_ng800_mux_data[] = { ++ { ++ .parent = 1, ++ .base_nr = MLXPLAT_CPLD_CH1, ++ .write_only = 1, ++ .reg = (void __iomem *)MLXPLAT_CPLD_LPC_REG1, ++ .reg_size = 1, ++ .idle_in_use = 1, ++ .values = mlxplat_ng800_channels, ++ .n_values = ARRAY_SIZE(mlxplat_ng800_channels), ++ }, ++ { ++ .parent = 1, ++ .base_nr = MLXPLAT_CPLD_CH2_NG800, ++ .write_only = 1, ++ .reg = (void __iomem *)MLXPLAT_CPLD_LPC_REG2, ++ .reg_size = 1, ++ .idle_in_use = 1, ++ .values = mlxplat_msn21xx_channels, ++ .n_values = ARRAY_SIZE(mlxplat_msn21xx_channels), ++ }, ++ ++}; ++ + /* Platform hotplug devices */ + static struct i2c_board_info mlxplat_mlxcpld_pwr[] = { + { +@@ -524,6 +556,15 @@ static struct i2c_board_info mlxplat_mlxcpld_ext_pwr[] = { + }, + }; + ++static struct i2c_board_info mlxplat_mlxcpld_pwr_ng800[] = { ++ { ++ I2C_BOARD_INFO("dps460", 0x59), ++ }, ++ { ++ I2C_BOARD_INFO("dps460", 0x5a), ++ }, ++}; ++ + static struct i2c_board_info mlxplat_mlxcpld_fan[] = { + { + I2C_BOARD_INFO("24c32", 0x50), +@@ -603,6 +644,23 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_pwr_wc_items_data[] = { + }, + }; + ++static struct mlxreg_core_data mlxplat_mlxcpld_default_pwr_ng800_items_data[] = { ++ { ++ .label = "pwr1", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = BIT(0), ++ .hpdev.brdinfo = &mlxplat_mlxcpld_pwr_ng800[0], ++ .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR, ++ }, ++ { ++ .label = "pwr2", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = BIT(1), ++ .hpdev.brdinfo = &mlxplat_mlxcpld_pwr_ng800[1], ++ .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR, ++ }, ++}; ++ + static struct mlxreg_core_data mlxplat_mlxcpld_default_fan_items_data[] = { + { + .label = "fan1", +@@ -1326,6 +1384,47 @@ static struct mlxreg_core_item mlxplat_mlxcpld_ext_items[] = { + } + }; + ++static struct mlxreg_core_item mlxplat_mlxcpld_ng800_items[] = { ++ { ++ .data = mlxplat_mlxcpld_default_ng_psu_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, ++ .mask = MLXPLAT_CPLD_PSU_EXT_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_default_ng_psu_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_default_pwr_ng800_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_PWR_OFFSET, ++ .mask = MLXPLAT_CPLD_PWR_EXT_MASK, ++ .capability = MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_default_pwr_ng800_items_data), ++ .inversed = 0, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_default_ng_fan_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, ++ .mask = MLXPLAT_CPLD_FAN_NG_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_default_ng_fan_items_data), ++ .inversed = 1, ++ .health = false, ++ }, ++ { ++ .data = mlxplat_mlxcpld_default_asic_items_data, ++ .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF, ++ .reg = MLXPLAT_CPLD_LPC_REG_ASIC_HEALTH_OFFSET, ++ .mask = MLXPLAT_CPLD_ASIC_MASK, ++ .count = ARRAY_SIZE(mlxplat_mlxcpld_default_asic_items_data), ++ .inversed = 0, ++ .health = true, ++ }, ++}; ++ + static + struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_ext_data = { + .items = mlxplat_mlxcpld_ext_items, +@@ -1336,6 +1435,16 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_ext_data = { + .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW | MLXPLAT_CPLD_LOW_AGGR_MASK_ASIC2, + }; + ++static ++struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_ng800_data = { ++ .items = mlxplat_mlxcpld_ng800_items, ++ .counter = ARRAY_SIZE(mlxplat_mlxcpld_ng800_items), ++ .cell = MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET, ++ .mask = MLXPLAT_CPLD_AGGR_MASK_NG_DEF | MLXPLAT_CPLD_AGGR_MASK_COMEX, ++ .cell_low = MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET, ++ .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW | MLXPLAT_CPLD_LOW_AGGR_MASK_ASIC2, ++}; ++ + static struct mlxreg_core_data mlxplat_mlxcpld_modular_pwr_items_data[] = { + { + .label = "pwr1", +@@ -3323,6 +3432,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mask = GENMASK(7, 0) & ~BIT(7), + .mode = 0644, + }, ++ { ++ .label = "clk_brd_prog_en", ++ .reg = MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(1), ++ .mode = 0644, ++ }, + { + .label = "erot1_recovery", + .reg = MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, +@@ -3449,6 +3564,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mask = GENMASK(7, 0) & ~BIT(6), + .mode = 0444, + }, ++ { ++ .label = "reset_ac_ok_fail", ++ .reg = MLXPLAT_CPLD_LPC_REG_RST_CAUSE2_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(7), ++ .mode = 0444, ++ }, + { + .label = "psu1_on", + .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, +@@ -3530,6 +3651,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .bit = 5, + .mode = 0444, + }, ++ { ++ .label = "pwr_converter_prog_en", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP0_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(0), ++ .mode = 0644, ++ }, + { + .label = "vpd_wp", + .reg = MLXPLAT_CPLD_LPC_REG_GP0_OFFSET, +@@ -3554,6 +3681,30 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = { + .mask = GENMASK(7, 0) & ~BIT(1), + .mode = 0444, + }, ++ { ++ .label = "clk_brd1_boot_fail", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(4), ++ .mode = 0444, ++ }, ++ { ++ .label = "clk_brd2_boot_fail", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(5), ++ .mode = 0444, ++ }, ++ { ++ .label = "clk_brd_fail", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(6), ++ .mode = 0444, ++ }, ++ { ++ .label = "asic_pg_fail", ++ .reg = MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET, ++ .mask = GENMASK(7, 0) & ~BIT(7), ++ .mode = 0444, ++ }, + { + .label = "spi_chnl_select", + .reg = MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT, +@@ -5568,6 +5719,27 @@ static int __init mlxplat_dmi_rack_switch_matched(const struct dmi_system_id *dm + return 1; + } + ++static int __init mlxplat_dmi_ng800_matched(const struct dmi_system_id *dmi) ++{ ++ int i; ++ ++ mlxplat_max_adap_num = MLXPLAT_CPLD_MAX_PHYS_ADAPTER_NUM; ++ mlxplat_mux_num = ARRAY_SIZE(mlxplat_ng800_mux_data); ++ mlxplat_mux_data = mlxplat_ng800_mux_data; ++ mlxplat_hotplug = &mlxplat_mlxcpld_ng800_data; ++ mlxplat_hotplug->deferred_nr = ++ mlxplat_msn21xx_channels[MLXPLAT_CPLD_GRP_CHNL_NUM - 1]; ++ mlxplat_led = &mlxplat_default_ng_led_data; ++ mlxplat_regs_io = &mlxplat_default_ng_regs_io_data; ++ mlxplat_fan = &mlxplat_default_fan_data; ++ for (i = 0; i < ARRAY_SIZE(mlxplat_mlxcpld_wd_set_type2); i++) ++ mlxplat_wd_data[i] = &mlxplat_mlxcpld_wd_set_type2[i]; ++ mlxplat_i2c = &mlxplat_mlxcpld_i2c_ng_data; ++ mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config_ng400; ++ ++ return 1; ++} ++ + static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + { + .callback = mlxplat_dmi_default_wc_matched, +@@ -5651,6 +5823,12 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { + DMI_MATCH(DMI_BOARD_NAME, "VMOD0011"), + }, + }, ++ { ++ .callback = mlxplat_dmi_ng800_matched, ++ .matches = { ++ DMI_MATCH(DMI_BOARD_NAME, "VMOD0013"), ++ }, ++ }, + { + .callback = mlxplat_dmi_chassis_blade_matched, + .matches = { +-- +2.20.1 + diff --git a/patch/0180-hwmon-pmbus-Fix-sensors-readouts-for-MPS-Multi-phase.patch b/patch/0180-hwmon-pmbus-Fix-sensors-readouts-for-MPS-Multi-phase.patch index 255263557f3d..1ff0f3af47a9 100644 --- a/patch/0180-hwmon-pmbus-Fix-sensors-readouts-for-MPS-Multi-phase.patch +++ b/patch/0180-hwmon-pmbus-Fix-sensors-readouts-for-MPS-Multi-phase.patch @@ -1,8 +1,8 @@ -From ae1a79f21b9a91e1a8bf42586bd7a5c2afbb432a Mon Sep 17 00:00:00 2001 +From c5fe53f12090a49223c057b793b3aa411dabdd7a Mon Sep 17 00:00:00 2001 From: Oleksandr Shamray Date: Mon, 19 Sep 2022 14:55:22 +0300 -Subject: [PATCH hwmon 1/1] hwmon: (pmbus) Fix sensors readouts for MPS - Multi-phase mp2888 controller +Subject: [PATCH backport 5.10 180/182] hwmon: (pmbus) Fix sensors readouts for + MPS Multi-phase mp2888 controller Fix scale factors for reading MPS Multi-phase mp2888 controller. Fixed sensors: @@ -17,7 +17,7 @@ Reviewed-by: Vadim Pasternak 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/hwmon/pmbus/mp2888.c b/drivers/hwmon/pmbus/mp2888.c -index 8ecd4ad..529eb3c 100644 +index 8ecd4adfef40..529eb3c95bb6 100644 --- a/drivers/hwmon/pmbus/mp2888.c +++ b/drivers/hwmon/pmbus/mp2888.c @@ -109,7 +109,7 @@ mp2888_read_phase(struct i2c_client *client, struct mp2888_data *data, int page, @@ -61,5 +61,5 @@ index 8ecd4ad..529eb3c 100644 /* * The below registers are not implemented by device or implemented not according to the -- -2.8.4 +2.20.1 diff --git a/patch/0186-platform-mellanox-mlxreg-hotplug-Allow-more-flexible.patch b/patch/0186-platform-mellanox-mlxreg-hotplug-Allow-more-flexible.patch new file mode 100644 index 000000000000..9347c14df428 --- /dev/null +++ b/patch/0186-platform-mellanox-mlxreg-hotplug-Allow-more-flexible.patch @@ -0,0 +1,107 @@ +From 4244de9783c2348e15b40802c70816e4000e342d Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Mon, 9 Jan 2023 19:35:31 +0200 +Subject: [PATCH backport 5.10 5/5] platform/mellanox: mlxreg-hotplug: Allow + more flexible hotplug events configuration +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream commit 26e118ea98cf + +Currently hotplug configuration in logic device assumes that all items +are provided with no holes. +Thus, any group of hotplug events, associated with the specific +status/event/mask registers is configured in those registers +successively from bit zero to bit #n (#n < 8). + +This logic is changed int order to allow non-successive definition to +support configuration with the skipped bits – for example bits 3, 5, 7 +in status/event/mask registers can be associated with hotplug events, +while others can be skipped. + +Signed-off-by: Vadim Pasternak +--- + drivers/platform/mellanox/mlxreg-hotplug.c | 28 ++++++++++++++++++---- + 1 file changed, 23 insertions(+), 5 deletions(-) + +diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c +index 117bc3f39..b7dcc64cd 100644 +--- a/drivers/platform/mellanox/mlxreg-hotplug.c ++++ b/drivers/platform/mellanox/mlxreg-hotplug.c +@@ -239,6 +239,17 @@ static ssize_t mlxreg_hotplug_attr_show(struct device *dev, + #define PRIV_ATTR(i) priv->mlxreg_hotplug_attr[i] + #define PRIV_DEV_ATTR(i) priv->mlxreg_hotplug_dev_attr[i] + ++static int mlxreg_hotplug_item_label_index_get(u32 mask, u32 bit) ++{ ++ int i, j; ++ ++ for (i = 0, j = -1; i <= bit; i++) { ++ if (mask & BIT(i)) ++ j++; ++ } ++ return j; ++} ++ + static int mlxreg_hotplug_attr_init(struct mlxreg_hotplug_priv_data *priv) + { + struct mlxreg_core_hotplug_platform_data *pdata; +@@ -246,7 +257,7 @@ static int mlxreg_hotplug_attr_init(struct mlxreg_hotplug_priv_data *priv) + struct mlxreg_core_data *data; + unsigned long mask; + u32 regval; +- int num_attrs = 0, id = 0, i, j, k, ret; ++ int num_attrs = 0, id = 0, i, j, k, count, ret; + + pdata = dev_get_platdata(&priv->pdev->dev); + item = pdata->items; +@@ -272,7 +283,8 @@ static int mlxreg_hotplug_attr_init(struct mlxreg_hotplug_priv_data *priv) + /* Go over all unmasked units within item. */ + mask = item->mask; + k = 0; +- for_each_set_bit(j, &mask, item->count) { ++ count = item->ind ? item->ind : item->count; ++ for_each_set_bit(j, &mask, count) { + if (data->capability) { + /* + * Read capability register and skip non +@@ -282,16 +294,17 @@ static int mlxreg_hotplug_attr_init(struct mlxreg_hotplug_priv_data *priv) + data->capability, ®val); + if (ret) + return ret; ++ + if (!(regval & data->bit)) { + data++; + continue; + } + } ++ + PRIV_ATTR(id) = &PRIV_DEV_ATTR(id).dev_attr.attr; + PRIV_ATTR(id)->name = devm_kasprintf(&priv->pdev->dev, + GFP_KERNEL, + data->label); +- + if (!PRIV_ATTR(id)->name) { + dev_err(priv->dev, "Memory allocation failed for attr %d.\n", + id); +@@ -365,9 +378,14 @@ mlxreg_hotplug_work_helper(struct mlxreg_hotplug_priv_data *priv, + regval &= item->mask; + asserted = item->cache ^ regval; + item->cache = regval; +- + for_each_set_bit(bit, &asserted, 8) { +- data = item->data + bit; ++ int pos; ++ ++ pos = mlxreg_hotplug_item_label_index_get(item->mask, bit); ++ if (pos < 0) ++ goto out; ++ ++ data = item->data + pos; + if (regval & BIT(bit)) { + if (item->inversed) + mlxreg_hotplug_device_destroy(priv, data, item->kind); +-- +2.20.1 + diff --git a/patch/0195-platform-x86-MLX_PLATFORM-select-REGMAP-instead-of-d.patch b/patch/0195-platform-x86-MLX_PLATFORM-select-REGMAP-instead-of-d.patch new file mode 100644 index 000000000000..9cea6ef2527d --- /dev/null +++ b/patch/0195-platform-x86-MLX_PLATFORM-select-REGMAP-instead-of-d.patch @@ -0,0 +1,46 @@ +From 7e7e1541c91615e9950d0b96bcd1806d297e970e Mon Sep 17 00:00:00 2001 +From: Randy Dunlap +Date: Sat, 25 Feb 2023 21:39:51 -0800 +Subject: [PATCH] platform: x86: MLX_PLATFORM: select REGMAP instead of + depending on it + +REGMAP is a hidden (not user visible) symbol. Users cannot set it +directly thru "make *config", so drivers should select it instead of +depending on it if they need it. + +Consistently using "select" or "depends on" can also help reduce +Kconfig circular dependency issues. + +Therefore, change the use of "depends on REGMAP" to "select REGMAP". + +Fixes: ef0f62264b2a ("platform/x86: mlx-platform: Add physical bus number auto detection") +Signed-off-by: Randy Dunlap +Cc: Vadim Pasternak +Cc: Darren Hart +Cc: Hans de Goede +Cc: Mark Gross +Cc: platform-driver-x86@vger.kernel.org +Link: https://lore.kernel.org/r/20230226053953.4681-7-rdunlap@infradead.org +Signed-off-by: Hans de Goede +Reviewed-by: Hans de Goede +--- + drivers/platform/x86/Kconfig | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig +index ec7c2b4e1721..4a01b315e0a9 100644 +--- a/drivers/platform/x86/Kconfig ++++ b/drivers/platform/x86/Kconfig +@@ -955,7 +955,8 @@ config SERIAL_MULTI_INSTANTIATE + + config MLX_PLATFORM + tristate "Mellanox Technologies platform support" +- depends on I2C && REGMAP ++ depends on I2C ++ select REGMAP + help + This option enables system support for the Mellanox Technologies + platform. The Mellanox systems provide data center networking +-- +2.14.1 + diff --git a/patch/0201-i2c-mlxbf-incorrect-base-address-passed-during-io-wr.patch b/patch/0201-i2c-mlxbf-incorrect-base-address-passed-during-io-wr.patch new file mode 100644 index 000000000000..1933f8217a84 --- /dev/null +++ b/patch/0201-i2c-mlxbf-incorrect-base-address-passed-during-io-wr.patch @@ -0,0 +1,43 @@ +From e38eed5cc30d8025b3990273c965c3142fc4733a Mon Sep 17 00:00:00 2001 +From: Asmaa Mnebhi +Date: Thu, 8 Sep 2022 13:35:38 -0400 +Subject: [PATCH backport 5.10 02/63] i2c: mlxbf: incorrect base address passed + during io write + +BugLink: https://bugs.launchpad.net/bugs/1991551 + +Correct the base address used during io write. +This bug had no impact over the overall functionality of the read and write +transactions. MLXBF_I2C_CAUSE_OR_CLEAR=0x18 so writing to (smbus->io + 0x18) +instead of (mst_cause->ioi + 0x18) actually writes to the sc_low_timeout +register which just sets the timeout value before a read/write aborts. + +Fixes: b5b5b32081cd206b (i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC) +Reviewed-by: Khalil Blaiech +Signed-off-by: Asmaa Mnebhi +Signed-off-by: Wolfram Sang +(cherry picked from commit 2a5be6d1340c0fefcee8a6489cff7fd88a0d5b85) +Signed-off-by: Asmaa Mnebhi +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/i2c/busses/i2c-mlxbf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c +index ab261d762..042c83b90 100644 +--- a/drivers/i2c/busses/i2c-mlxbf.c ++++ b/drivers/i2c/busses/i2c-mlxbf.c +@@ -675,7 +675,7 @@ static int mlxbf_i2c_smbus_enable(struct mlxbf_i2c_priv *priv, u8 slave, + /* Clear status bits. */ + writel(0x0, priv->smbus->io + MLXBF_I2C_SMBUS_MASTER_STATUS); + /* Set the cause data. */ +- writel(~0x0, priv->smbus->io + MLXBF_I2C_CAUSE_OR_CLEAR); ++ writel(~0x0, priv->mst_cause->io + MLXBF_I2C_CAUSE_OR_CLEAR); + /* Zero PEC byte. */ + writel(0x0, priv->smbus->io + MLXBF_I2C_SMBUS_MASTER_PEC); + /* Zero byte count. */ +-- +2.20.1 + diff --git a/patch/0202-i2c-mlxbf-prevent-stack-overflow-in-mlxbf_i2c_smbus_.patch b/patch/0202-i2c-mlxbf-prevent-stack-overflow-in-mlxbf_i2c_smbus_.patch new file mode 100644 index 000000000000..59db34bc6527 --- /dev/null +++ b/patch/0202-i2c-mlxbf-prevent-stack-overflow-in-mlxbf_i2c_smbus_.patch @@ -0,0 +1,41 @@ +From cf835e1581883f7e90fa322efe2dd91a510e51df Mon Sep 17 00:00:00 2001 +From: Asmaa Mnebhi +Date: Thu, 8 Sep 2022 13:35:39 -0400 +Subject: [PATCH backport 5.10 03/63] i2c: mlxbf: prevent stack overflow in + mlxbf_i2c_smbus_start_transaction() + +BugLink: https://bugs.launchpad.net/bugs/1991551 + +memcpy() is called in a loop while 'operation->length' upper bound +is not checked and 'data_idx' also increments. + +Fixes: b5b5b32081cd206b ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC") +Reviewed-by: Khalil Blaiech +Signed-off-by: Asmaa Mnebhi +Signed-off-by: Wolfram Sang +(cherry picked from commit de24aceb07d426b6f1c59f33889d6a964770547b) +Signed-off-by: Asmaa Mnebhi +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/i2c/busses/i2c-mlxbf.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c +index 042c83b90..d78fb24d5 100644 +--- a/drivers/i2c/busses/i2c-mlxbf.c ++++ b/drivers/i2c/busses/i2c-mlxbf.c +@@ -744,6 +744,9 @@ mlxbf_i2c_smbus_start_transaction(struct mlxbf_i2c_priv *priv, + if (flags & MLXBF_I2C_F_WRITE) { + write_en = 1; + write_len += operation->length; ++ if (data_idx + operation->length > ++ MLXBF_I2C_MASTER_DATA_DESC_SIZE) ++ return -ENOBUFS; + memcpy(data_desc + data_idx, + operation->buffer, operation->length); + data_idx += operation->length; +-- +2.20.1 + diff --git a/patch/0204-i2c-mlxbf-Fix-frequency-calculation.patch b/patch/0204-i2c-mlxbf-Fix-frequency-calculation.patch new file mode 100644 index 000000000000..36905d7bb820 --- /dev/null +++ b/patch/0204-i2c-mlxbf-Fix-frequency-calculation.patch @@ -0,0 +1,190 @@ +From 5c14aec2f54faa6400d0cfd3255853106afbd2d7 Mon Sep 17 00:00:00 2001 +From: Asmaa Mnebhi +Date: Tue, 20 Sep 2022 13:47:29 -0400 +Subject: [PATCH backport 5.10 05/63] i2c: mlxbf: Fix frequency calculation + +BugLink: https://bugs.launchpad.net/bugs/1991551 + +The i2c-mlxbf.c driver is currently broken because there is a bug +in the calculation of the frequency. core_f, core_r and core_od +are components read from hardware registers and are used to +compute the frequency used to compute different timing parameters. +The shifting mechanism used to get core_f, core_r and core_od is +wrong. Use FIELD_GET to mask and shift the bitfields properly. + +Fixes: b5b5b32081cd206b (i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC) +Reviewed-by: Khalil Blaiech +Signed-off-by: Asmaa Mnebhi +Signed-off-by: Wolfram Sang +(cherry picked from commit 37f071ec327b04c83d47637c5e5c2199b39899ca) +Signed-off-by: Asmaa Mnebhi +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/i2c/busses/i2c-mlxbf.c | 63 +++++++++++++--------------------- + 1 file changed, 23 insertions(+), 40 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c +index 066bfeb8a..b4bf1e503 100644 +--- a/drivers/i2c/busses/i2c-mlxbf.c ++++ b/drivers/i2c/busses/i2c-mlxbf.c +@@ -6,6 +6,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -63,13 +64,14 @@ + */ + #define MLXBF_I2C_TYU_PLL_OUT_FREQ (400 * 1000 * 1000) + /* Reference clock for Bluefield - 156 MHz. */ +-#define MLXBF_I2C_PLL_IN_FREQ (156 * 1000 * 1000) ++#define MLXBF_I2C_PLL_IN_FREQ 156250000ULL + + /* Constant used to determine the PLL frequency. */ +-#define MLNXBF_I2C_COREPLL_CONST 16384 ++#define MLNXBF_I2C_COREPLL_CONST 16384ULL ++ ++#define MLXBF_I2C_FREQUENCY_1GHZ 1000000000ULL + + /* PLL registers. */ +-#define MLXBF_I2C_CORE_PLL_REG0 0x0 + #define MLXBF_I2C_CORE_PLL_REG1 0x4 + #define MLXBF_I2C_CORE_PLL_REG2 0x8 + +@@ -187,22 +189,15 @@ enum { + #define MLXBF_I2C_COREPLL_FREQ MLXBF_I2C_TYU_PLL_OUT_FREQ + + /* Core PLL TYU configuration. */ +-#define MLXBF_I2C_COREPLL_CORE_F_TYU_MASK GENMASK(12, 0) +-#define MLXBF_I2C_COREPLL_CORE_OD_TYU_MASK GENMASK(3, 0) +-#define MLXBF_I2C_COREPLL_CORE_R_TYU_MASK GENMASK(5, 0) +- +-#define MLXBF_I2C_COREPLL_CORE_F_TYU_SHIFT 3 +-#define MLXBF_I2C_COREPLL_CORE_OD_TYU_SHIFT 16 +-#define MLXBF_I2C_COREPLL_CORE_R_TYU_SHIFT 20 ++#define MLXBF_I2C_COREPLL_CORE_F_TYU_MASK GENMASK(15, 3) ++#define MLXBF_I2C_COREPLL_CORE_OD_TYU_MASK GENMASK(19, 16) ++#define MLXBF_I2C_COREPLL_CORE_R_TYU_MASK GENMASK(25, 20) + + /* Core PLL YU configuration. */ + #define MLXBF_I2C_COREPLL_CORE_F_YU_MASK GENMASK(25, 0) + #define MLXBF_I2C_COREPLL_CORE_OD_YU_MASK GENMASK(3, 0) +-#define MLXBF_I2C_COREPLL_CORE_R_YU_MASK GENMASK(5, 0) ++#define MLXBF_I2C_COREPLL_CORE_R_YU_MASK GENMASK(31, 26) + +-#define MLXBF_I2C_COREPLL_CORE_F_YU_SHIFT 0 +-#define MLXBF_I2C_COREPLL_CORE_OD_YU_SHIFT 1 +-#define MLXBF_I2C_COREPLL_CORE_R_YU_SHIFT 26 + + /* Core PLL frequency. */ + static u64 mlxbf_i2c_corepll_frequency; +@@ -485,8 +480,6 @@ static struct mutex mlxbf_i2c_bus_lock; + #define MLXBF_I2C_MASK_8 GENMASK(7, 0) + #define MLXBF_I2C_MASK_16 GENMASK(15, 0) + +-#define MLXBF_I2C_FREQUENCY_1GHZ 1000000000 +- + /* + * Function to poll a set of bits at a specific address; it checks whether + * the bits are equal to zero when eq_zero is set to 'true', and not equal +@@ -1416,24 +1409,19 @@ static int mlxbf_i2c_init_master(struct platform_device *pdev, + return 0; + } + +-static u64 mlxbf_calculate_freq_from_tyu(struct mlxbf_i2c_resource *corepll_res) ++static u64 mlxbf_i2c_calculate_freq_from_tyu(struct mlxbf_i2c_resource *corepll_res) + { +- u64 core_frequency, pad_frequency; ++ u64 core_frequency; + u8 core_od, core_r; + u32 corepll_val; + u16 core_f; + +- pad_frequency = MLXBF_I2C_PLL_IN_FREQ; +- + corepll_val = readl(corepll_res->io + MLXBF_I2C_CORE_PLL_REG1); + + /* Get Core PLL configuration bits. */ +- core_f = rol32(corepll_val, MLXBF_I2C_COREPLL_CORE_F_TYU_SHIFT) & +- MLXBF_I2C_COREPLL_CORE_F_TYU_MASK; +- core_od = rol32(corepll_val, MLXBF_I2C_COREPLL_CORE_OD_TYU_SHIFT) & +- MLXBF_I2C_COREPLL_CORE_OD_TYU_MASK; +- core_r = rol32(corepll_val, MLXBF_I2C_COREPLL_CORE_R_TYU_SHIFT) & +- MLXBF_I2C_COREPLL_CORE_R_TYU_MASK; ++ core_f = FIELD_GET(MLXBF_I2C_COREPLL_CORE_F_TYU_MASK, corepll_val); ++ core_od = FIELD_GET(MLXBF_I2C_COREPLL_CORE_OD_TYU_MASK, corepll_val); ++ core_r = FIELD_GET(MLXBF_I2C_COREPLL_CORE_R_TYU_MASK, corepll_val); + + /* + * Compute PLL output frequency as follow: +@@ -1445,31 +1433,26 @@ static u64 mlxbf_calculate_freq_from_tyu(struct mlxbf_i2c_resource *corepll_res) + * Where PLL_OUT_FREQ and PLL_IN_FREQ refer to CoreFrequency + * and PadFrequency, respectively. + */ +- core_frequency = pad_frequency * (++core_f); ++ core_frequency = MLXBF_I2C_PLL_IN_FREQ * (++core_f); + core_frequency /= (++core_r) * (++core_od); + + return core_frequency; + } + +-static u64 mlxbf_calculate_freq_from_yu(struct mlxbf_i2c_resource *corepll_res) ++static u64 mlxbf_i2c_calculate_freq_from_yu(struct mlxbf_i2c_resource *corepll_res) + { + u32 corepll_reg1_val, corepll_reg2_val; +- u64 corepll_frequency, pad_frequency; ++ u64 corepll_frequency; + u8 core_od, core_r; + u32 core_f; + +- pad_frequency = MLXBF_I2C_PLL_IN_FREQ; +- + corepll_reg1_val = readl(corepll_res->io + MLXBF_I2C_CORE_PLL_REG1); + corepll_reg2_val = readl(corepll_res->io + MLXBF_I2C_CORE_PLL_REG2); + + /* Get Core PLL configuration bits */ +- core_f = rol32(corepll_reg1_val, MLXBF_I2C_COREPLL_CORE_F_YU_SHIFT) & +- MLXBF_I2C_COREPLL_CORE_F_YU_MASK; +- core_r = rol32(corepll_reg1_val, MLXBF_I2C_COREPLL_CORE_R_YU_SHIFT) & +- MLXBF_I2C_COREPLL_CORE_R_YU_MASK; +- core_od = rol32(corepll_reg2_val, MLXBF_I2C_COREPLL_CORE_OD_YU_SHIFT) & +- MLXBF_I2C_COREPLL_CORE_OD_YU_MASK; ++ core_f = FIELD_GET(MLXBF_I2C_COREPLL_CORE_F_YU_MASK, corepll_reg1_val); ++ core_r = FIELD_GET(MLXBF_I2C_COREPLL_CORE_R_YU_MASK, corepll_reg1_val); ++ core_od = FIELD_GET(MLXBF_I2C_COREPLL_CORE_OD_YU_MASK, corepll_reg2_val); + + /* + * Compute PLL output frequency as follow: +@@ -1481,7 +1464,7 @@ static u64 mlxbf_calculate_freq_from_yu(struct mlxbf_i2c_resource *corepll_res) + * Where PLL_OUT_FREQ and PLL_IN_FREQ refer to CoreFrequency + * and PadFrequency, respectively. + */ +- corepll_frequency = (pad_frequency * core_f) / MLNXBF_I2C_COREPLL_CONST; ++ corepll_frequency = (MLXBF_I2C_PLL_IN_FREQ * core_f) / MLNXBF_I2C_COREPLL_CONST; + corepll_frequency /= (++core_r) * (++core_od); + + return corepll_frequency; +@@ -2189,14 +2172,14 @@ static struct mlxbf_i2c_chip_info mlxbf_i2c_chip[] = { + [1] = &mlxbf_i2c_corepll_res[MLXBF_I2C_CHIP_TYPE_1], + [2] = &mlxbf_i2c_gpio_res[MLXBF_I2C_CHIP_TYPE_1] + }, +- .calculate_freq = mlxbf_calculate_freq_from_tyu ++ .calculate_freq = mlxbf_i2c_calculate_freq_from_tyu + }, + [MLXBF_I2C_CHIP_TYPE_2] = { + .type = MLXBF_I2C_CHIP_TYPE_2, + .shared_res = { + [0] = &mlxbf_i2c_corepll_res[MLXBF_I2C_CHIP_TYPE_2] + }, +- .calculate_freq = mlxbf_calculate_freq_from_yu ++ .calculate_freq = mlxbf_i2c_calculate_freq_from_yu + } + }; + +-- +2.20.1 + diff --git a/patch/0205-i2c-mlxbf-support-lock-mechanism.patch b/patch/0205-i2c-mlxbf-support-lock-mechanism.patch new file mode 100644 index 000000000000..1314b8b28954 --- /dev/null +++ b/patch/0205-i2c-mlxbf-support-lock-mechanism.patch @@ -0,0 +1,123 @@ +From 12a738e1d79fd3e37436a3477b03a778548eac64 Mon Sep 17 00:00:00 2001 +From: Asmaa Mnebhi +Date: Mon, 26 Sep 2022 15:45:04 -0400 +Subject: [PATCH backport 5.10 06/63] i2c: mlxbf: support lock mechanism + +BugLink: https://bugs.launchpad.net/bugs/1991551 + +Linux is not the only entity using the BlueField I2C busses so +support a lock mechanism provided by hardware to avoid issues +when multiple entities are trying to access the same bus. + +The lock is acquired whenever written explicitely or the lock +register is read. So make sure it is always released at the end +of a successful or failed transaction. + +Fixes: b5b5b32081cd206b (i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC) +Reviewed-by: Khalil Blaiech +Signed-off-by: Asmaa Mnebhi +Signed-off-by: Wolfram Sang +(cherry picked from commit 86067ccfa1424a26491542d6f6d7546d40b61a10) +Signed-off-by: Asmaa Mnebhi +Acked-by: Tim Gardner +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/i2c/busses/i2c-mlxbf.c | 44 ++++++++++++++++++++++++++++++---- + 1 file changed, 39 insertions(+), 5 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c +index b4bf1e503..30b798e92 100644 +--- a/drivers/i2c/busses/i2c-mlxbf.c ++++ b/drivers/i2c/busses/i2c-mlxbf.c +@@ -312,6 +312,7 @@ static u64 mlxbf_i2c_corepll_frequency; + * exact. + */ + #define MLXBF_I2C_SMBUS_TIMEOUT (300 * 1000) /* 300ms */ ++#define MLXBF_I2C_SMBUS_LOCK_POLL_TIMEOUT (300 * 1000) /* 300ms */ + + /* Encapsulates timing parameters. */ + struct mlxbf_i2c_timings { +@@ -520,6 +521,25 @@ static bool mlxbf_smbus_master_wait_for_idle(struct mlxbf_i2c_priv *priv) + return false; + } + ++/* ++ * wait for the lock to be released before acquiring it. ++ */ ++static bool mlxbf_i2c_smbus_master_lock(struct mlxbf_i2c_priv *priv) ++{ ++ if (mlxbf_smbus_poll(priv->smbus->io, MLXBF_I2C_SMBUS_MASTER_GW, ++ MLXBF_I2C_MASTER_LOCK_BIT, true, ++ MLXBF_I2C_SMBUS_LOCK_POLL_TIMEOUT)) ++ return true; ++ ++ return false; ++} ++ ++static void mlxbf_i2c_smbus_master_unlock(struct mlxbf_i2c_priv *priv) ++{ ++ /* Clear the gw to clear the lock */ ++ writel(0, priv->smbus->io + MLXBF_I2C_SMBUS_MASTER_GW); ++} ++ + static bool mlxbf_i2c_smbus_transaction_success(u32 master_status, + u32 cause_status) + { +@@ -711,10 +731,19 @@ mlxbf_i2c_smbus_start_transaction(struct mlxbf_i2c_priv *priv, + slave = request->slave & GENMASK(6, 0); + addr = slave << 1; + +- /* First of all, check whether the HW is idle. */ +- if (WARN_ON(!mlxbf_smbus_master_wait_for_idle(priv))) ++ /* ++ * Try to acquire the smbus gw lock before any reads of the GW register since ++ * a read sets the lock. ++ */ ++ if (WARN_ON(!mlxbf_i2c_smbus_master_lock(priv))) + return -EBUSY; + ++ /* Check whether the HW is idle */ ++ if (WARN_ON(!mlxbf_smbus_master_wait_for_idle(priv))) { ++ ret = -EBUSY; ++ goto out_unlock; ++ } ++ + /* Set first byte. */ + data_desc[data_idx++] = addr; + +@@ -738,8 +767,10 @@ mlxbf_i2c_smbus_start_transaction(struct mlxbf_i2c_priv *priv, + write_en = 1; + write_len += operation->length; + if (data_idx + operation->length > +- MLXBF_I2C_MASTER_DATA_DESC_SIZE) +- return -ENOBUFS; ++ MLXBF_I2C_MASTER_DATA_DESC_SIZE) { ++ ret = -ENOBUFS; ++ goto out_unlock; ++ } + memcpy(data_desc + data_idx, + operation->buffer, operation->length); + data_idx += operation->length; +@@ -771,7 +802,7 @@ mlxbf_i2c_smbus_start_transaction(struct mlxbf_i2c_priv *priv, + ret = mlxbf_i2c_smbus_enable(priv, slave, write_len, block_en, + pec_en, 0); + if (ret) +- return ret; ++ goto out_unlock; + } + + if (read_en) { +@@ -798,6 +829,9 @@ mlxbf_i2c_smbus_start_transaction(struct mlxbf_i2c_priv *priv, + priv->smbus->io + MLXBF_I2C_SMBUS_MASTER_FSM); + } + ++out_unlock: ++ mlxbf_i2c_smbus_master_unlock(priv); ++ + return ret; + } + +-- +2.20.1 + diff --git a/patch/0265-hwmon-mlxreg-fan-Return-zero-speed-for-broken-fan.patch b/patch/0265-hwmon-mlxreg-fan-Return-zero-speed-for-broken-fan.patch new file mode 100644 index 000000000000..cb0440a0f5bd --- /dev/null +++ b/patch/0265-hwmon-mlxreg-fan-Return-zero-speed-for-broken-fan.patch @@ -0,0 +1,40 @@ +From 0bb5bbc78316970c3bde085f091a70799b39b262 Mon Sep 17 00:00:00 2001 +From: Vadim Pasternak +Date: Sun, 5 Feb 2023 09:34:20 +0200 +Subject: [PATCH hwmon backport 5.10 1/1] hwmon: (mlxreg-fan) Return zero speed + for broken fan + +Currently for broken fan driver returns value calculated based on error +code (0xFF) in related fan speed register. +Thus, for such fan user gets fan{n}_fault to 1 and fan{n}_input with +misleading value. + +Add check for fan fault prior return speed value and return zero if +fault is detected. + +Fixes: 65afb4c8e7e4 ("hwmon: (mlxreg-fan) Add support for Mellanox FAN driver") +Signed-off-by: Vadim Pasternak +--- + drivers/hwmon/mlxreg-fan.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c +index acba9d688..b999ca648 100644 +--- a/drivers/hwmon/mlxreg-fan.c ++++ b/drivers/hwmon/mlxreg-fan.c +@@ -158,6 +158,12 @@ mlxreg_fan_read(struct device *dev, enum hwmon_sensor_types type, u32 attr, + if (err) + return err; + ++ if (MLXREG_FAN_GET_FAULT(regval, tacho->mask)) { ++ /* FAN is broken - return zero for FAN speed. */ ++ *val = 0; ++ return 0; ++ } ++ + *val = MLXREG_FAN_GET_RPM(regval, fan->divider, + fan->samples); + break; +-- +2.20.1 + diff --git a/patch/0285-platform-mellanox-nvsw-sn2201-change-fans-i2c-busses.patch b/patch/0285-platform-mellanox-nvsw-sn2201-change-fans-i2c-busses.patch new file mode 100644 index 000000000000..48204a3c39a8 --- /dev/null +++ b/patch/0285-platform-mellanox-nvsw-sn2201-change-fans-i2c-busses.patch @@ -0,0 +1,69 @@ +From 6d9121cc262724d7a5fbc67f2c0be90fd95391d7 Mon Sep 17 00:00:00 2001 +From: Michael Shych +Date: Wed, 12 Jul 2023 14:26:38 +0000 +Subject: [PATCH backport v5.10.164 4/5] platform: mellanox: nvsw-sn2201: + change fans i2c busses. + +Link: https://patchwork.kernel.org/project/platform-driver-x86/patch/20230814203406.12399-16-vadimp@nvidia.com/ + +Define the exact i2c bus (adapter number) of fans on the SN2201 system. +This will cause fan's EEPROMs be connected already from nvsw-sn2201 +platform driver and not from user space after receiving udev events. + +Signed-off-by: Michael Shych +Signed-off-by: Ciju Rajan K +--- + drivers/platform/mellanox/nvsw-sn2201.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/drivers/platform/mellanox/nvsw-sn2201.c b/drivers/platform/mellanox/nvsw-sn2201.c +index 51da240ce4f9..65b677690851 100644 +--- a/drivers/platform/mellanox/nvsw-sn2201.c ++++ b/drivers/platform/mellanox/nvsw-sn2201.c +@@ -84,6 +84,10 @@ + #define NVSW_SN2201_MAIN_MUX_CH5_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 5) + #define NVSW_SN2201_MAIN_MUX_CH6_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 6) + #define NVSW_SN2201_MAIN_MUX_CH7_NR (NVSW_SN2201_MAIN_MUX_CH0_NR + 7) ++#define NVSW_SN2201_2ND_MUX_CH0_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 1) ++#define NVSW_SN2201_2ND_MUX_CH1_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 2) ++#define NVSW_SN2201_2ND_MUX_CH2_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 3) ++#define NVSW_SN2201_2ND_MUX_CH3_NR (NVSW_SN2201_MAIN_MUX_CH7_NR + 4) + + #define NVSW_SN2201_CPLD_NR NVSW_SN2201_MAIN_MUX_CH0_NR + #define NVSW_SN2201_NR_NONE -1 +@@ -425,28 +429,28 @@ static struct mlxreg_core_data nvsw_sn2201_fan_items_data[] = { + .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, + .mask = BIT(0), + .hpdev.brdinfo = &nvsw_sn2201_fan_devices[0], +- .hpdev.nr = NVSW_SN2201_NR_NONE, ++ .hpdev.nr = NVSW_SN2201_2ND_MUX_CH0_NR, + }, + { + .label = "fan2", + .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, + .mask = BIT(1), + .hpdev.brdinfo = &nvsw_sn2201_fan_devices[1], +- .hpdev.nr = NVSW_SN2201_NR_NONE, ++ .hpdev.nr = NVSW_SN2201_2ND_MUX_CH1_NR, + }, + { + .label = "fan3", + .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, + .mask = BIT(2), + .hpdev.brdinfo = &nvsw_sn2201_fan_devices[2], +- .hpdev.nr = NVSW_SN2201_NR_NONE, ++ .hpdev.nr = NVSW_SN2201_2ND_MUX_CH2_NR, + }, + { + .label = "fan4", + .reg = NVSW_SN2201_FAN_PRSNT_STATUS_OFFSET, + .mask = BIT(3), + .hpdev.brdinfo = &nvsw_sn2201_fan_devices[3], +- .hpdev.nr = NVSW_SN2201_NR_NONE, ++ .hpdev.nr = NVSW_SN2201_2ND_MUX_CH3_NR, + }, + }; + +-- +2.20.1 + diff --git a/patch/0999-Revert-mlxsw-thermal-Fix-out-of-bounds-memory-a.patch b/patch/0999-Revert-mlxsw-thermal-Fix-out-of-bounds-memory-a.patch deleted file mode 100644 index 94f91acb05a0..000000000000 --- a/patch/0999-Revert-mlxsw-thermal-Fix-out-of-bounds-memory-a.patch +++ /dev/null @@ -1,103 +0,0 @@ -From: Alexander Allen -Date: Thu, 31 Mar 2022 17:17:59 +0000 -Subject: 0999 Revert "mlxsw: thermal: Fix out-of-bounds memory - accesses" - -This reverts commit e59d839743b50cb1d3f42a786bea48cc5621d254. - -Commit is reverted until thermal infrastructure is ready for other fan devices used by Nvidia systems. -Usage of `cooling_cur_state` for setting fan speed has been deprecated in kernel 5.17 by thermal maintainers. -New interface for fan speed enforcing should be done from `hwmon`. -After all fan drivers are aligned, commit will be retuned back. ---- - .../ethernet/mellanox/mlxsw/core_thermal.c | 52 +++++++++++++++++-- - 1 file changed, 47 insertions(+), 5 deletions(-) - -diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -index e1a760519097..f9c9ebf68fcd 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -@@ -24,8 +24,16 @@ - #define MLXSW_THERMAL_ZONE_MAX_NAME 16 - #define MLXSW_THERMAL_TEMP_SCORE_MAX GENMASK(31, 0) - #define MLXSW_THERMAL_MAX_STATE 10 --#define MLXSW_THERMAL_MIN_STATE 2 - #define MLXSW_THERMAL_MAX_DUTY 255 -+/* Minimum and maximum fan allowed speed in percent: from 20% to 100%. Values -+ * MLXSW_THERMAL_MAX_STATE + x, where x is between 2 and 10 are used for -+ * setting fan speed dynamic minimum. For example, if value is set to 14 (40%) -+ * cooling levels vector will be set to 4, 4, 4, 4, 4, 5, 6, 7, 8, 9, 10 to -+ * introduce PWM speed in percent: 40, 40, 40, 40, 40, 50, 60. 70, 80, 90, 100. -+ */ -+#define MLXSW_THERMAL_SPEED_MIN (MLXSW_THERMAL_MAX_STATE + 2) -+#define MLXSW_THERMAL_SPEED_MAX (MLXSW_THERMAL_MAX_STATE * 2) -+#define MLXSW_THERMAL_SPEED_MIN_LEVEL 2 /* 20% */ - - /* External cooling devices, allowed for binding to mlxsw thermal zones. */ - static char * const mlxsw_thermal_external_allowed_cdev[] = { -@@ -642,16 +650,49 @@ static int mlxsw_thermal_set_cur_state(struct thermal_cooling_device *cdev, - struct mlxsw_thermal *thermal = cdev->devdata; - struct device *dev = thermal->bus_info->dev; - char mfsc_pl[MLXSW_REG_MFSC_LEN]; -+ unsigned long cur_state, i; - int idx; -+ u8 duty; - int err; - -- if (state > MLXSW_THERMAL_MAX_STATE) -- return -EINVAL; -- - idx = mlxsw_get_cooling_device_idx(thermal, cdev); - if (idx < 0) - return idx; - -+ /* Verify if this request is for changing allowed fan dynamical -+ * minimum. If it is - update cooling levels accordingly and update -+ * state, if current state is below the newly requested minimum state. -+ * For example, if current state is 5, and minimal state is to be -+ * changed from 4 to 6, thermal->cooling_levels[0 to 5] will be changed -+ * all from 4 to 6. And state 5 (thermal->cooling_levels[4]) should be -+ * overwritten. -+ */ -+ if (state >= MLXSW_THERMAL_SPEED_MIN && -+ state <= MLXSW_THERMAL_SPEED_MAX) { -+ state -= MLXSW_THERMAL_MAX_STATE; -+ for (i = 0; i <= MLXSW_THERMAL_MAX_STATE; i++) -+ thermal->cooling_levels[i] = max(state, i); -+ -+ mlxsw_reg_mfsc_pack(mfsc_pl, idx, 0); -+ err = mlxsw_reg_query(thermal->core, MLXSW_REG(mfsc), mfsc_pl); -+ if (err) -+ return err; -+ -+ duty = mlxsw_reg_mfsc_pwm_duty_cycle_get(mfsc_pl); -+ cur_state = mlxsw_duty_to_state(duty); -+ -+ /* If current fan state is lower than requested dynamical -+ * minimum, increase fan speed up to dynamical minimum. -+ */ -+ if (state < cur_state) -+ return 0; -+ -+ state = cur_state; -+ } -+ -+ if (state > MLXSW_THERMAL_MAX_STATE) -+ return -EINVAL; -+ - /* Normalize the state to the valid speed range. */ - state = thermal->cooling_levels[state]; - mlxsw_reg_mfsc_pack(mfsc_pl, idx, mlxsw_state_to_duty(state)); -@@ -961,7 +1002,8 @@ int mlxsw_thermal_init(struct mlxsw_core *core, - - /* Initialize cooling levels per PWM state. */ - for (i = 0; i < MLXSW_THERMAL_MAX_STATE; i++) -- thermal->cooling_levels[i] = max(MLXSW_THERMAL_MIN_STATE, i); -+ thermal->cooling_levels[i] = max(MLXSW_THERMAL_SPEED_MIN_LEVEL, -+ i); - - thermal->polling_delay = bus_info->low_frequency ? - MLXSW_THERMAL_SLOW_POLL_INT : --- -2.17.1 - diff --git a/patch/kconfig-exclusions b/patch/kconfig-exclusions index 2d9cb3eb6a00..b7da0ab9b5c4 100644 --- a/patch/kconfig-exclusions +++ b/patch/kconfig-exclusions @@ -11,7 +11,6 @@ CONFIG_CGROUP_NET_PRIO # Unset X86_PAT according to Broadcom's requirement CONFIG_X86_PAT CONFIG_MLXSW_PCI -CONFIG_THERMAL_STATISTICS [arm64] CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU diff --git a/patch/kconfig-inclusions b/patch/kconfig-inclusions index a5f4f09b451c..4e64400e2cd5 100644 --- a/patch/kconfig-inclusions +++ b/patch/kconfig-inclusions @@ -47,7 +47,6 @@ CONFIG_DW_DMAC_PCI=y CONFIG_MLXSW_CORE=m CONFIG_MLXSW_CORE_HWMON=y CONFIG_MLXSW_CORE_THERMAL=y -# CONFIG_MLXSW_CORE_QSFP=y # TODO: enable once 0001-Mellanox-platform-Backport-patches-for-new-Mellanox-.patch is enabled CONFIG_MLXSW_I2C=m CONFIG_MLXSW_MINIMAL=m CONFIG_MFD_INTEL_LPSS=y @@ -79,7 +78,7 @@ CONFIG_SENSORS_DRIVETEMP=m CONFIG_TI_ADS1015=m CONFIG_GPIO_PCA953X=m CONFIG_SERIAL_8250_DETECT_IRQ=y -CONFIG_MLX_WDT=y +CONFIG_MLX_WDT=m CONFIG_LEDS_MLXREG=m CONFIG_MLX_PLATFORM=m CONFIG_MELLANOX_PLATFORM=y @@ -88,12 +87,57 @@ CONFIG_MLXREG_IO=m CONFIG_MAX1363=m CONFIG_THERMAL_NETLINK=y CONFIG_THERMAL_STATISTICS=n - CONFIG_NVSW_SN2201=m CONFIG_TI_ADS1015=m CONFIG_SENSORS_EMC2305=m CONFIG_SENSORS_JC42=m CONFIG_SENSORS_POWR1220=m +CONFIG_NET_VENDOR_MELLANOX=y +CONFIG_NET_DEVLINK=y +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=m +CONFIG_I2C_MUX=m +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=m +CONFIG_SYSFS=y +CONFIG_DMI_SYSFS=y +CONFIG_GPIO_SYSFS=y +CONFIG_WATCHDOG_SYSFS=y +CONFIG_NVMEM_SYSFS=y +CONFIG_MLXREG_LC=m +CONFIG_THERMAL=y +CONFIG_THERMAL_HWMON=y +CONFIG_THERMAL_WRITABLE_TRIPS=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_PMBUS=m +CONFIG_SENSORS_PMBUS=m +CONFIG_HWMON=y +CONFIG_SENSORS_LM75=m +CONFIG_SENSORS_TMP102=m +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=m +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_EEPROM_AT24=m +CONFIG_GPIOLIB=y +CONFIG_GPIO_GENERIC=m +CONFIG_GPIO_ICH=m +CONFIG_LPC_ICH=m +CONFIG_X86_PKG_TEMP_THERMAL=m +CONFIG_SENSORS_CORETEMP=m +CONFIG_INTEL_PCH_THERMAL=m +CONFIG_IGB=y +CONFIG_IGB_HWMON=y +CONFIG_INOTIFY_USER=y +CONFIG_MFD_CORE=y +CONFIG_SERIAL_8250_DW=y +CONFIG_I2C_SMBUS=m +CONFIG_I2C_I801=m +CONFIG_PINCTRL=y +CONFIG_PINCTRL_INTEL=y +CONFIG_SPI_PXA2XX=m ###-> mellanox-end # For Cisco 8000 diff --git a/patch/series b/patch/series index 84131d777533..5e0da595842b 100755 --- a/patch/series +++ b/patch/series @@ -71,107 +71,119 @@ kernel-compat-always-include-linux-compat.h-from-net-compat.patch ###-> mellanox_hw_mgmt-start 0001-i2c-mlxcpld-Update-module-license.patch -0002-i2c-mlxcpld-Decrease-polling-time-for-performan.patch -0003-i2c-mlxcpld-Add-support-for-I2C-bus-frequency-s.patch +0002-i2c-mlxcpld-Decrease-polling-time-for-performance-im.patch +0003-i2c-mlxcpld-Add-support-for-I2C-bus-frequency-settin.patch 0004-i2c-mux-mlxcpld-Update-module-license.patch -0005-i2c-mux-mlxcpld-Move-header-file-out-of-x86-rea.patch -0006-i2c-mux-mlxcpld-Convert-driver-to-platform-driv.patch -0007-i2c-mux-mlxcpld-Prepare-mux-selection-infrastru.patch -0008-i2c-mux-mlxcpld-Get-rid-of-adapter-numbers-enfo.patch -0009-i2c-mux-mlxcpld-Extend-driver-to-support-word-a.patch +0005-i2c-mux-mlxcpld-Move-header-file-out-of-x86-realm.patch +0006-i2c-mux-mlxcpld-Convert-driver-to-platform-driver.patch +0007-i2c-mux-mlxcpld-Prepare-mux-selection-infrastructure.patch +0008-i2c-mux-mlxcpld-Get-rid-of-adapter-numbers-enforceme.patch +0009-i2c-mux-mlxcpld-Extend-driver-to-support-word-addres.patch 0010-i2c-mux-mlxcpld-Extend-supported-mux-number.patch -0011-i2c-mux-mlxcpld-Add-callback-to-notify-mux-crea.patch -0012-hwmon-mlxreg-fan-Add-support-for-fan-drawers-ca.patch -0013-hwmon-pmbus-shrink-code-and-remove-pmbus_do_rem.patch -0015-mlxsw-core-Remove-critical-trip-points-from-the.patch +0011-i2c-mux-mlxcpld-Add-callback-to-notify-mux-creation-.patch +0012-hwmon-mlxreg-fan-Add-support-for-fan-drawers-capabil.patch +0013-hwmon-pmbus-shrink-code-and-remove-pmbus_do_remove.patch +0015-mlxsw-core-Remove-critical-trip-points-from-thermal-.patch 0016-net-don-t-include-ethtool.h-from-netdevice.h.patch -0017-mlxsw-reg-Extend-MTMP-register-with-new-thresho.patch -0018-mlxsw-thermal-Add-function-for-reading-module-t.patch -0019-mlxsw-thermal-Read-module-temperature-threshold.patch -0020-mlxsw-thermal-Fix-null-dereference-of-NULL-temp.patch +0017-mlxsw-reg-Extend-MTMP-register-with-new-threshold-fi.patch +0018-mlxsw-thermal-Add-function-for-reading-module-temper.patch +0019-mlxsw-thermal-Read-module-temperature-thresholds-usi.patch +0020-mlxsw-thermal-Fix-null-dereference-of-NULL-temperatu.patch 0021-mlxsw-reg-Add-bank-number-to-MCIA-register.patch 0022-mlxsw-reg-Document-possible-MCIA-status-values.patch -0023-ethtool-Allow-network-drivers-to-dump-arbitrary.patch -0024-net-ethtool-Export-helpers-for-getting-EEPROM-i.patch -0025-ethtool-Add-fallback-to-get_module_eeprom-from-.patch -0026-mlxsw-core-Add-support-for-module-EEPROM-read-b.patch -0027-ethtool-Decrease-size-of-module-EEPROM-get-poli.patch -0028-ethtool-Use-kernel-data-types-for-internal-EEPR.patch -0029-ethtool-Validate-module-EEPROM-length-as-part-o.patch -0030-ethtool-Validate-module-EEPROM-offset-as-part-o.patch -0031-mlxsw-core_env-Read-module-temperature-threshol.patch +0023-ethtool-Allow-network-drivers-to-dump-arbitrary-EEPR.patch +0024-net-ethtool-Export-helpers-for-getting-EEPROM-info.patch +0025-ethtool-Add-fallback-to-get_module_eeprom-from-netli.patch +0026-mlxsw-core-Add-support-for-module-EEPROM-read-by-pag.patch +0027-ethtool-Decrease-size-of-module-EEPROM-get-policy-ar.patch +0028-ethtool-Use-kernel-data-types-for-internal-EEPROM-st.patch +0029-ethtool-Validate-module-EEPROM-length-as-part-of-pol.patch +0030-ethtool-Validate-module-EEPROM-offset-as-part-of-pol.patch +0031-mlxsw-core_env-Read-module-temperature-thresholds-us.patch 0032-mlxsw-core_env-Avoid-unnecessary-memcpy-s.patch -0035-hwmon-pmbus-Increase-maximum-number-of-phases-p.patch -0036-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2.patch +0035-hwmon-pmbus-Increase-maximum-number-of-phases-per-pa.patch +0036-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2888-c.patch 0037-dt-bindings-Add-MP2888-voltage-regulator-device.patch 0038-ethtool-wire-in-generic-SFP-module-access.patch -0039-ethtool-Fix-NULL-pointer-dereference-during-mod.patch -0040-phy-sfp-add-netlink-SFP-support-to-generic-SFP-.patch +0039-ethtool-Fix-NULL-pointer-dereference-during-module-E.patch +0040-phy-sfp-add-netlink-SFP-support-to-generic-SFP-code.patch 0042-ethtool-support-FEC-settings-over-netlink.patch 0045-i2c-mlxcpld-Fix-criteria-for-frequency-setting.patch -0046-i2c-mlxcpld-Reduce-polling-time-for-performance.patch -0047-i2c-mlxcpld-Allow-flexible-polling-time-setting.patch -0052-hwmon-mlxreg-fan-Return-non-zero-value-when-fan.patch -0053-mlxsw-core-Avoid-creation-virtual-hwmon-objects.patch -0054-mlxsw-minimal-Simplify-method-of-modules-number.patch -0055-platform_data-mlxreg-Add-new-type-to-support-mo.patch -0056-platform-x86-mlx-platform-Add-initial-support-f.patch -0057-platform-mellanox-mlxreg-hotplug-Extend-logic-f.patch -0058-platform-x86-mlx-platform-Configure-notifier-ca.patch -0059-platform-mellanox-mlxreg-io-Extend-number-of-hw.patch -0060-platform_data-mlxreg-Add-new-field-for-secured-.patch -0061-platform-mellanox-mlxreg-lc-Add-initial-support.patch -0062-Documentation-ABI-Add-new-attributes-for-mlxreg.patch -0063-Documentation-ABI-Add-new-line-card-attributes-.patch -0064-hwmon-mlxreg-fan-Extend-the-maximum-number-of-t.patch -0065-platform-x86-mlx-platform-Extend-FAN-and-LED-co.patch -0066-platform-x86-mlx-platform-Add-new-attributes-fo.patch +0046-i2c-mlxcpld-Reduce-polling-time-for-performance-impr.patch +0047-i2c-mlxcpld-Allow-flexible-polling-time-setting-for-.patch +0053-mlxsw-core-Avoid-creation-virtual-hwmon-objects-by-t.patch +0054-mlxsw-minimal-Simplify-method-of-modules-number-dete.patch +0055-platform_data-mlxreg-Add-new-type-to-support-modular.patch +0056-platform-x86-mlx-platform-Add-initial-support-for-ne.patch +0057-platform-mellanox-mlxreg-hotplug-Extend-logic-for-ho.patch +0058-platform-x86-mlx-platform-Configure-notifier-callbac.patch +0059-platform-mellanox-mlxreg-io-Extend-number-of-hwmon-a.patch +0060-platform_data-mlxreg-Add-new-field-for-secured-acces.patch +0061-platform-mellanox-mlxreg-lc-Add-initial-support-for-.patch +0062-Documentation-ABI-Add-new-attributes-for-mlxreg-io-s.patch +0063-Documentation-ABI-Add-new-line-card-attributes-for-m.patch +0064-hwmon-mlxreg-fan-Extend-the-maximum-number-of-tachom.patch +0065-platform-x86-mlx-platform-Extend-FAN-and-LED-config-.patch +0066-platform-x86-mlx-platform-Add-new-attributes-for-Cof.patch +0067-platform-mellanox-Add-dedicated-match-for-system-typ.patch 0068-mlxsw-core-Initialize-switch-driver-last.patch 0069-mlxsw-core-Remove-mlxsw_core_is_initialized.patch -0070-mlxsw-core_env-Defer-handling-of-module-tempera.patch -0071-mlxsw-core_env-Convert-module_info_lock-to-a-mu.patch +0070-mlxsw-core_env-Defer-handling-of-module-temperature-.patch +0071-mlxsw-core_env-Convert-module_info_lock-to-a-mutex.patch 0072-mlxsw-Track-per-module-port-status.patch 0073-mlxsw-reg-Add-fields-to-PMAOS-register.patch 0074-mlxsw-Make-PMAOS-pack-function-more-generic.patch 0075-mlxsw-Add-support-for-transceiver-modules-reset.patch -0076-ethtool-Add-ability-to-control-transceiver-modu.patch -0077-mlxsw-reg-Add-Port-Module-Memory-Map-Properties.patch -0078-mlxsw-reg-Add-Management-Cable-IO-and-Notificat.patch -0079-mlxsw-Add-ability-to-control-transceiver-module.patch +0076-ethtool-Add-ability-to-control-transceiver-modules-p.patch +0077-mlxsw-reg-Add-Port-Module-Memory-Map-Properties-regi.patch +0078-mlxsw-reg-Add-Management-Cable-IO-and-Notifications-.patch +0079-mlxsw-Add-ability-to-control-transceiver-modules-pow.patch 0080-ethtool-Add-transceiver-module-extended-states.patch -0081-platform-x86-mlx-platform-Add-support-for-multi.patch -0082-mlxsw-core-Extend-external-cooling-device-whitelist-.patch -0083-platform_data-mlxreg-Add-field-for-notification-call.patch -0084-i2c-mlxcpld-Add-callback-to-notify-probing-completio.patch -0085-hwmon-powr1220-Upgrade-driver-to-support-hwmon-info-.patch -0086-hwmon-powr1220-Add-support-for-Lattice-s-POWR1014-po.patch -0087-hwmon-Add-support-for-EMC2305-RPM-based-PWM-Fan-Spee.patch -0088-dt-bindings-Add-description-for-EMC2305-for-RPM-base.patch -0089-platform-mellanox-Add-support-for-new-SN2201-system.patch -0090-Documentation-ABI-Add-new-attributes-for-mlxreg-io-s.patch -0091-platform-x86-mlx-platform-Add-support-for-new-s.patch -0092-platform-mellanox-mlxreg-lc-fix-error-code-in-m.patch -0093-hwmon-mlxreg-fan-Extend-driver-to-support-multi.patch -0094-hwmon-mlxreg-fan-Extend-driver-to-support-multi.patch -0095-hwmon-mlxreg-fan-Fix-out-of-bounds-read-on-arra.patch -0096-hwmon-mlxreg-fan-Modify-PWM-connectivity-valida.patch -0097-hwmon-mlxreg-fan-Support-distinctive-names-per-.patch -0999-Revert-mlxsw-thermal-Fix-out-of-bounds-memory-a.patch -0098-mlxsw-i2c-Prevent-transaction-execution-for.patch +0081-platform-x86-mlx-platform-Add-support-for-multiply-c.patch +0082-mlxsw-core-Extend-external-cooling-device-whitelist-.patch +0083-platform_data-mlxreg-Add-field-for-notification-call.patch +0084-i2c-mlxcpld-Add-callback-to-notify-probing-completio.patch +0085-hwmon-powr1220-Upgrade-driver-to-support-hwmon-info-.patch +0086-hwmon-powr1220-Add-support-for-Lattice-s-POWR1014-po.patch +0087-hwmon-Add-support-for-EMC2305-RPM-based-PWM-Fan-Spee.patch +0089-platform-mellanox-Add-support-for-new-SN2201-system.patch +0090-Documentation-ABI-Add-new-attributes-for-mlxreg-io-s.patch +0091-platform-x86-mlx-platform-Add-support-for-new-system.patch +0092-platform-mellanox-mlxreg-lc-fix-error-code-in-mlxreg.patch +0093-hwmon-mlxreg-fan-Extend-driver-to-support-multiply-P.patch +0094-hwmon-mlxreg-fan-Extend-driver-to-support-multiply-c.patch +0095-hwmon-mlxreg-fan-Fix-out-of-bounds-read-on-array-fan.patch +0096-hwmon-mlxreg-fan-Modify-PWM-connectivity-validation.patch +0097-hwmon-mlxreg-fan-Support-distinctive-names-per-diffe.patch +0097-1-mlxsw-Use-u16-for-local_port-field.patch +0097-2-mlxsw-i2c-Fix-chunk-size-setting.patch +0097-3-mlxsw-core_hwmon-Adjust-module-label-names.patch +0152-mlxsw-i2c-Prevent-transaction-execution-for-spec.patch 0157-platform-x86-mlx-platform-Make-activation-of-some-dr.patch 0158-platform-x86-mlx-platform-Add-cosmetic-changes-for-a.patch 0159-mlx-platform-Add-support-for-systems-equipped-with-t.patch -0160-platform-mellanox-Introduce-support-for-COMe-NVSwitc.patch +0160-platform-mellanox-Introduce-support-for-COMe-managem.patch 0161-platform-x86-mlx-platform-Add-support-for-new-system.patch 0162-platform-mellanox-Add-COME-board-revision-register.patch +0163-platform-mellanox-Introduce-support-for-rack-manager.patch 0164-hwmon-jc42-Add-support-for-Seiko-Instruments-S-34TS0.patch 0165-platform-mellanox-mlxreg-io-Add-locking-for-io-opera.patch -0167-leds-mlxreg-Send-udev-change-event.patch +0166-DS-leds-leds-mlxreg-Send-udev-event-from-leds-mlxreg.patch 0170-i2c-mlxcpld-Fix-register-setting-for-400KHz-frequenc.patch -0171-platform-mellanox-mlxreg-lc-Fix-cleanup-on-failure-a.patch -0173-core-Add-support-for-OSFP-transceiver-modules.patch +0173-mlxsw-core-Add-support-for-OSFP-transceiver-modules.patch 0175-hwmon-pmbus-Add-support-for-Infineon-Digital-Multi-p.patch +0176-platform-mellanox-fix-reset_pwr_converter_fail-attri.patch +0177-Documentation-ABI-fix-description-of-fix-reset_pwr_c.patch +0178-platform-mellanox-Introduce-support-for-next-generat.patch 0180-hwmon-pmbus-Fix-sensors-readouts-for-MPS-Multi-phase.patch +0186-platform-mellanox-mlxreg-hotplug-Allow-more-flexible.patch +0195-platform-x86-MLX_PLATFORM-select-REGMAP-instead-of-d.patch +0201-i2c-mlxbf-incorrect-base-address-passed-during-io-wr.patch +0202-i2c-mlxbf-prevent-stack-overflow-in-mlxbf_i2c_smbus_.patch +0204-i2c-mlxbf-Fix-frequency-calculation.patch +0205-i2c-mlxbf-support-lock-mechanism.patch +0265-hwmon-mlxreg-fan-Return-zero-speed-for-broken-fan.patch +0285-platform-mellanox-nvsw-sn2201-change-fans-i2c-busses.patch ###-> mellanox_hw_mgmt-end # Cisco patches for 5.10 kernel