From fdbb8851fee82d04c4fed06e53d233a2d5b37933 Mon Sep 17 00:00:00 2001 From: lguohan Date: Wed, 1 Jul 2020 22:51:53 -0700 Subject: [PATCH] update kernel to 4.19.118 (#150) Signed-off-by: Guohan Lu * Update two patches below 0001-Mellanox-platform-Backport-patches-for-new-Mellanox-.patch 0005-hwmon-pmbus-core-Add-support-for-vid-mode-detection-.patch Co-authored-by: Kebo Liu --- Makefile | 15 +- ...-Backport-patches-for-new-Mellanox-.patch} | 644 +++--------------- ...-Fix-validation-for-FW-minor-version.patch | 10 +- ...d-the-hottest-thermal-zone-detection.patch | 26 +- ...-Add-support-for-vid-mode-detection-.patch | 68 +- ...anox-mlxreg-hotplug-Use-capability-r.patch | 10 +- ...al-Set-default-thermal-trips-at-init.patch | 12 +- ...-Remove-obsolete-code-for-QSFP-EEPRO.patch | 10 +- ...anox-mlxreg-io-Add-support-for-compl.patch | 16 +- ...x-mlxreg-hotplug-Add-environmental-d.patch | 8 +- ...al-Separate-temperature-trend-read-c.patch | 8 +- ...new-transceivers-types-QSFP-DD-and-Q.patch | 10 +- ...-support-new-watchdog-type-with-long.patch | 18 +- patch/driver-iommu-fix-amd-iommu-off.patch | 32 - patch/net-backport-ipv6-missing-route.patch | 39 -- ...-update-in-inet_proto_csum_replace16.patch | 56 -- patch/net-psample-fix-skb-over-panic.patch | 93 --- .../packaging-update-abiname-to-6-2.patch | 30 - .../preconfig/packaging-update-abiname.patch | 34 + patch/preconfig/series | 2 +- patch/series | 6 +- 21 files changed, 214 insertions(+), 933 deletions(-) rename patch/{0001-v4.19-6-Mellanox-platform-Backport-patches-for-new-M.patch => 0001-Mellanox-platform-Backport-patches-for-new-Mellanox-.patch} (91%) delete mode 100644 patch/driver-iommu-fix-amd-iommu-off.patch delete mode 100644 patch/net-backport-ipv6-missing-route.patch delete mode 100644 patch/net-fix-skb-csum-update-in-inet_proto_csum_replace16.patch delete mode 100644 patch/net-psample-fix-skb-over-panic.patch delete mode 100644 patch/preconfig/packaging-update-abiname-to-6-2.patch create mode 100644 patch/preconfig/packaging-update-abiname.patch diff --git a/Makefile b/Makefile index 9fe08c30ef26..59b55e29d13e 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,10 @@ SHELL = /bin/bash .SHELLFLAGS += -e KERNEL_ABI_MINOR_VERSION = 2 -KVERSION_SHORT ?= 4.19.0-6-$(KERNEL_ABI_MINOR_VERSION) +KVERSION_SHORT ?= 4.19.0-9-$(KERNEL_ABI_MINOR_VERSION) KVERSION ?= $(KVERSION_SHORT)-amd64 -KERNEL_VERSION ?= 4.19.67 -KERNEL_SUBVERSION ?= 2+deb10u2 +KERNEL_VERSION ?= 4.19.118 +KERNEL_SUBVERSION ?= 2+deb10u1 kernel_procure_method ?= build CONFIGURED_ARCH ?= amd64 @@ -44,13 +44,14 @@ else # Building kernel DSC_FILE = linux_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION).dsc -ORIG_FILE = linux_$(KERNEL_VERSION).orig.tar.xz DEBIAN_FILE = linux_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION).debian.tar.xz +ORIG_FILE = linux_$(KERNEL_VERSION).orig.tar.xz BUILD_DIR=linux-$(KERNEL_VERSION) +SOURCE_FILE_BASE_URL="http://security.debian.org/debian-security/pool/updates/main/l/linux" -DSC_FILE_URL = "http://security.debian.org/debian-security/pool/updates/main/l/linux/linux_4.19.67-2+deb10u2.dsc" -DEBIAN_FILE_URL = "http://security.debian.org/debian-security/pool/updates/main/l/linux/linux_4.19.67-2+deb10u2.debian.tar.xz" -ORIG_FILE_URL = "http://security.debian.org/debian-security/pool/updates/main/l/linux/linux_4.19.67.orig.tar.xz" +DSC_FILE_URL = "$(SOURCE_FILE_BASE_URL)/$(DSC_FILE)" +DEBIAN_FILE_URL = "$(SOURCE_FILE_BASE_URL)/$(DEBIAN_FILE)" +ORIG_FILE_URL = "$(SOURCE_FILE_BASE_URL)/$(ORIG_FILE)" $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Obtaining the Debian kernel source diff --git a/patch/0001-v4.19-6-Mellanox-platform-Backport-patches-for-new-M.patch b/patch/0001-Mellanox-platform-Backport-patches-for-new-Mellanox-.patch similarity index 91% rename from patch/0001-v4.19-6-Mellanox-platform-Backport-patches-for-new-M.patch rename to patch/0001-Mellanox-platform-Backport-patches-for-new-Mellanox-.patch index 829e894c7c0a..377457c8eecc 100644 --- a/patch/0001-v4.19-6-Mellanox-platform-Backport-patches-for-new-M.patch +++ b/patch/0001-Mellanox-platform-Backport-patches-for-new-Mellanox-.patch @@ -1,8 +1,8 @@ -From 94c3405f5b95f3f699ad8167630b4fbf9a788dce Mon Sep 17 00:00:00 2001 +From e4149afc593ef4bc14d5980a9a72413fd0406750 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak -Date: Tue, 4 Feb 2020 23:30:59 +0200 -Subject: [PATCH 1/2] v4.19-6: Mellanox platform: Backport patches for new - Mellanox systems +Date: Mon, 29 Jun 2020 18:48:23 +0300 +Subject: [backport 01/12] Mellanox platform: Backport patches for new Mellanox + systems It contains backport patches from v4.20 - v5.5 and below bug fixes and optimizations. @@ -27,23 +27,17 @@ Add thermal zone platform parameters definition with the field "no_hwmon" set to true. Use it in thermal_zone_device_register(). It will indicate that the "thermal" to "hwmon" sysfs interface is not -Signed-off-by: Vadim Pasternak -Signed-off-by: Stephen Sun +Adding module for ethtool support. -v4.19-6: Mellanox platform: Additional backport for new Mellanox systems +Changing Mellanox i2c bus poling time frequency. -It contains backport patches from v5.* kernels: -- Adding module for ethtool support. -- Changing Mellanox i2c bus poling time frequency. -- Watchdog Mellanox driver. +Adding watchdog Mellanox driver. Signed-off-by: Vadim Pasternak -Signed-off-by: Stephen Sun --- drivers/hwmon/mlxreg-fan.c | 90 +- - drivers/hwmon/pmbus/tps53679.c | 10 +- drivers/i2c/busses/i2c-mlxcpld.c | 2 +- - drivers/leds/leds-mlxreg.c | 23 +- + drivers/leds/leds-mlxreg.c | 21 +- drivers/net/ethernet/mellanox/mlxsw/Kconfig | 9 + drivers/net/ethernet/mellanox/mlxsw/Makefile | 3 +- drivers/net/ethernet/mellanox/mlxsw/core.c | 82 +- @@ -52,20 +46,19 @@ Signed-off-by: Stephen Sun drivers/net/ethernet/mellanox/mlxsw/core_env.h | 17 + drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 361 +++++- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 696 +++++++++- - drivers/net/ethernet/mellanox/mlxsw/i2c.c | 212 +++- drivers/net/ethernet/mellanox/mlxsw/minimal.c | 328 ++++- drivers/net/ethernet/mellanox/mlxsw/pci.c | 49 +- drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c | 454 +++++++ - drivers/net/ethernet/mellanox/mlxsw/reg.h | 1243 +++++++++++++++++- + drivers/net/ethernet/mellanox/mlxsw/reg.h | 1221 +++++++++++++++++- drivers/net/ethernet/mellanox/mlxsw/resources.h | 6 + drivers/platform/mellanox/mlxreg-hotplug.c | 42 +- - drivers/platform/x86/mlx-platform.c | 1332 +++++++++++++++++--- + drivers/platform/x86/mlx-platform.c | 1328 +++++++++++++++++--- drivers/watchdog/Kconfig | 16 + drivers/watchdog/Makefile | 1 + drivers/watchdog/mlx_wdt.c | 289 +++++ include/linux/platform_data/mlxreg.h | 27 +- include/uapi/linux/ethtool.h | 3 + - 25 files changed, 5247 insertions(+), 340 deletions(-) + 23 files changed, 5039 insertions(+), 298 deletions(-) create mode 100644 drivers/net/ethernet/mellanox/mlxsw/core_env.c create mode 100644 drivers/net/ethernet/mellanox/mlxsw/core_env.h create mode 100644 drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c @@ -95,7 +88,7 @@ index d8fa4be..7028a4f 100644 #define MLXREG_FAN_PWM_DUTY2STATE(duty) (DIV_ROUND_CLOSEST((duty) * \ MLXREG_FAN_MAX_STATE, \ MLXREG_FAN_MAX_DUTY)) -@@ -360,15 +362,57 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, +@@ -360,15 +362,57 @@ static const struct thermal_cooling_device_ops mlxreg_fan_cooling_ops = { .set_cur_state = mlxreg_fan_set_cur_state, }; @@ -248,27 +241,6 @@ index d8fa4be..7028a4f 100644 return PTR_ERR(fan->cdev); } } -diff --git a/drivers/hwmon/pmbus/tps53679.c b/drivers/hwmon/pmbus/tps53679.c -index 85b515c..45eacc5 100644 ---- a/drivers/hwmon/pmbus/tps53679.c -+++ b/drivers/hwmon/pmbus/tps53679.c -@@ -80,7 +80,15 @@ static int tps53679_identify(struct i2c_client *client, - static int tps53679_probe(struct i2c_client *client, - const struct i2c_device_id *id) - { -- return pmbus_do_probe(client, id, &tps53679_info); -+ struct pmbus_driver_info *info; -+ -+ info = devm_kzalloc(&client->dev, sizeof(*info), GFP_KERNEL); -+ if (!info) -+ return -ENOMEM; -+ -+ memcpy(info, &tps53679_info, sizeof(*info)); -+ -+ return pmbus_do_probe(client, id, info); - } - - static const struct i2c_device_id tps53679_id[] = { diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c index 2fd717d..6da4b58 100644 --- a/drivers/i2c/busses/i2c-mlxcpld.c @@ -283,7 +255,7 @@ index 2fd717d..6da4b58 100644 /* LPC I2C registers */ #define MLXCPLD_LPCI2C_CPBLTY_REG 0x0 diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c -index 1ee48cb..0c14a74 100644 +index 1ee48cb..781eb03 100644 --- a/drivers/leds/leds-mlxreg.c +++ b/drivers/leds/leds-mlxreg.c @@ -22,6 +22,7 @@ @@ -328,15 +300,6 @@ index 1ee48cb..0c14a74 100644 led_cdev = &led_data->led_cdev; led_data->data_parent = priv; if (strstr(data->label, "red") || -@@ -213,7 +232,7 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv) - data->label); - led_cdev->name = led_data->led_cdev_name; - led_cdev->brightness = brightness; -- led_cdev->max_brightness = LED_ON; -+ led_cdev->max_brightness = 1; - led_cdev->brightness_set_blocking = - mlxreg_led_brightness_set; - led_cdev->brightness_get = mlxreg_led_brightness_get; diff --git a/drivers/net/ethernet/mellanox/mlxsw/Kconfig b/drivers/net/ethernet/mellanox/mlxsw/Kconfig index 8a291eb..51e485b 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/Kconfig @@ -398,7 +361,7 @@ index 2e6df58..c38c1c5 100644 struct mlxsw_rx_listener_item { struct list_head list; struct mlxsw_rx_listener rxl; -@@ -971,9 +978,9 @@ static int mlxsw_devlink_core_bus_device_reload(struct devlink *devlink, +@@ -971,9 +978,9 @@ static const struct devlink_ops mlxsw_devlink_ops = { }; int mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, @@ -528,7 +491,7 @@ diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/m index c4e4971..3fb3a75 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.h +++ b/drivers/net/ethernet/mellanox/mlxsw/core.h -@@ -28,6 +28,8 @@ +@@ -28,6 +28,8 @@ unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core); void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core); @@ -1489,7 +1452,7 @@ index 6d29dc4..b753729 100644 .min_state = MLXSW_THERMAL_MAX_STATE, .max_state = MLXSW_THERMAL_MAX_STATE, } -@@ -63,13 +91,32 @@ struct mlxsw_thermal_trip { +@@ -63,13 +91,32 @@ static const struct mlxsw_thermal_trip default_thermal_trips[] = { /* Make sure all trips are writable */ #define MLXSW_THERMAL_TRIP_MASK (BIT(MLXSW_THERMAL_NUM_TRIPS) - 1) @@ -1662,7 +1625,7 @@ index 6d29dc4..b753729 100644 static struct thermal_zone_device_ops mlxsw_thermal_ops = { .bind = mlxsw_thermal_bind, .unbind = mlxsw_thermal_unbind, -@@ -243,6 +376,242 @@ static int mlxsw_thermal_set_trip_temp(struct thermal_zone_device *tzdev, +@@ -243,6 +376,242 @@ static struct thermal_zone_device_ops mlxsw_thermal_ops = { .get_trip_type = mlxsw_thermal_get_trip_type, .get_trip_temp = mlxsw_thermal_get_trip_temp, .set_trip_temp = mlxsw_thermal_set_trip_temp, @@ -1958,7 +1921,7 @@ index 6d29dc4..b753729 100644 mlxsw_reg_mfsc_pack(mfsc_pl, idx, mlxsw_state_to_duty(state)); err = mlxsw_reg_write(thermal->core, MLXSW_REG(mfsc), mfsc_pl); if (err) { -@@ -306,6 +714,218 @@ static int mlxsw_thermal_set_cur_state(struct thermal_cooling_device *cdev, +@@ -306,6 +714,218 @@ static const struct thermal_cooling_device_ops mlxsw_cooling_ops = { .set_cur_state = mlxsw_thermal_set_cur_state, }; @@ -2258,392 +2221,6 @@ index 6d29dc4..b753729 100644 if (thermal->tzdev) { thermal_zone_device_unregister(thermal->tzdev); thermal->tzdev = NULL; -diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c -index 798bd5a..e04d521 100644 ---- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c -@@ -14,14 +14,17 @@ - #include "cmd.h" - #include "core.h" - #include "i2c.h" -+#include "resources.h" - - #define MLXSW_I2C_CIR2_BASE 0x72000 - #define MLXSW_I2C_CIR_STATUS_OFF 0x18 - #define MLXSW_I2C_CIR2_OFF_STATUS (MLXSW_I2C_CIR2_BASE + \ - MLXSW_I2C_CIR_STATUS_OFF) - #define MLXSW_I2C_OPMOD_SHIFT 12 -+#define MLXSW_I2C_EVENT_BIT_SHIFT 22 - #define MLXSW_I2C_GO_BIT_SHIFT 23 - #define MLXSW_I2C_CIR_CTRL_STATUS_SHIFT 24 -+#define MLXSW_I2C_EVENT_BIT BIT(MLXSW_I2C_EVENT_BIT_SHIFT) - #define MLXSW_I2C_GO_BIT BIT(MLXSW_I2C_GO_BIT_SHIFT) - #define MLXSW_I2C_GO_OPMODE BIT(MLXSW_I2C_OPMOD_SHIFT) - #define MLXSW_I2C_SET_IMM_CMD (MLXSW_I2C_GO_OPMODE | \ -@@ -33,17 +36,20 @@ - #define MLXSW_I2C_TLV_HDR_SIZE 0x10 - #define MLXSW_I2C_ADDR_WIDTH 4 - #define MLXSW_I2C_PUSH_CMD_SIZE (MLXSW_I2C_ADDR_WIDTH + 4) -+#define MLXSW_I2C_SET_EVENT_CMD (MLXSW_I2C_EVENT_BIT) -+#define MLXSW_I2C_PUSH_EVENT_CMD (MLXSW_I2C_GO_BIT | \ -+ MLXSW_I2C_SET_EVENT_CMD) - #define MLXSW_I2C_READ_SEMA_SIZE 4 - #define MLXSW_I2C_PREP_SIZE (MLXSW_I2C_ADDR_WIDTH + 28) - #define MLXSW_I2C_MBOX_SIZE 20 - #define MLXSW_I2C_MBOX_OUT_PARAM_OFF 12 --#define MLXSW_I2C_MAX_BUFF_SIZE 32 - #define MLXSW_I2C_MBOX_OFFSET_BITS 20 - #define MLXSW_I2C_MBOX_SIZE_BITS 12 - #define MLXSW_I2C_ADDR_BUF_SIZE 4 --#define MLXSW_I2C_BLK_MAX 32 -+#define MLXSW_I2C_BLK_DEF 32 - #define MLXSW_I2C_RETRY 5 - #define MLXSW_I2C_TIMEOUT_MSECS 5000 -+#define MLXSW_I2C_MAX_DATA_SIZE 256 - - /** - * struct mlxsw_i2c - device private data: -@@ -55,6 +61,7 @@ - * @dev: I2C device; - * @core: switch core pointer; - * @bus_info: bus info block; -+ * @block_size: maximum block size allowed to pass to under layer; - */ - struct mlxsw_i2c { - struct { -@@ -67,6 +74,7 @@ struct mlxsw_i2c { - struct device *dev; - struct mlxsw_core *core; - struct mlxsw_bus_info bus_info; -+ u16 block_size; - }; - - #define MLXSW_I2C_READ_MSG(_client, _addr_buf, _buf, _len) { \ -@@ -167,7 +175,7 @@ static int mlxsw_i2c_wait_go_bit(struct i2c_client *client, - return err > 0 ? 0 : err; - } - --/* Routine posts a command to ASIC though mail box. */ -+/* Routine posts a command to ASIC through mail box. */ - static int mlxsw_i2c_write_cmd(struct i2c_client *client, - struct mlxsw_i2c *mlxsw_i2c, - int immediate) -@@ -213,6 +221,66 @@ static int mlxsw_i2c_write_cmd(struct i2c_client *client, - return 0; - } - -+/* Routine posts initialization command to ASIC through mail box. */ -+static int -+mlxsw_i2c_write_init_cmd(struct i2c_client *client, -+ struct mlxsw_i2c *mlxsw_i2c, u16 opcode, u32 in_mod) -+{ -+ __be32 push_cmd_buf[MLXSW_I2C_PUSH_CMD_SIZE / 4] = { -+ 0, cpu_to_be32(MLXSW_I2C_PUSH_EVENT_CMD) -+ }; -+ __be32 prep_cmd_buf[MLXSW_I2C_PREP_SIZE / 4] = { -+ 0, 0, 0, 0, 0, 0, -+ cpu_to_be32(client->adapter->nr & 0xffff), -+ cpu_to_be32(MLXSW_I2C_SET_EVENT_CMD) -+ }; -+ struct i2c_msg push_cmd = -+ MLXSW_I2C_WRITE_MSG(client, push_cmd_buf, -+ MLXSW_I2C_PUSH_CMD_SIZE); -+ struct i2c_msg prep_cmd = -+ MLXSW_I2C_WRITE_MSG(client, prep_cmd_buf, MLXSW_I2C_PREP_SIZE); -+ u8 status; -+ int err; -+ -+ push_cmd_buf[1] = cpu_to_be32(MLXSW_I2C_PUSH_EVENT_CMD | opcode); -+ prep_cmd_buf[3] = cpu_to_be32(in_mod); -+ prep_cmd_buf[7] = cpu_to_be32(MLXSW_I2C_GO_BIT | opcode); -+ mlxsw_i2c_set_slave_addr((u8 *)prep_cmd_buf, -+ MLXSW_I2C_CIR2_BASE); -+ mlxsw_i2c_set_slave_addr((u8 *)push_cmd_buf, -+ MLXSW_I2C_CIR2_OFF_STATUS); -+ -+ /* Prepare Command Interface Register for transaction */ -+ err = i2c_transfer(client->adapter, &prep_cmd, 1); -+ if (err < 0) -+ return err; -+ else if (err != 1) -+ return -EIO; -+ -+ /* Write out Command Interface Register GO bit to push transaction */ -+ err = i2c_transfer(client->adapter, &push_cmd, 1); -+ if (err < 0) -+ return err; -+ else if (err != 1) -+ return -EIO; -+ -+ /* Wait until go bit is cleared. */ -+ err = mlxsw_i2c_wait_go_bit(client, mlxsw_i2c, &status); -+ if (err) { -+ dev_err(&client->dev, "HW semaphore is not released"); -+ return err; -+ } -+ -+ /* Validate transaction completion status. */ -+ if (status) { -+ dev_err(&client->dev, "Bad transaction completion status %x\n", -+ status); -+ return -EIO; -+ } -+ -+ return 0; -+} -+ - /* Routine obtains mail box offsets from ASIC register space. */ - static int mlxsw_i2c_get_mbox(struct i2c_client *client, - struct mlxsw_i2c *mlxsw_i2c) -@@ -248,20 +316,26 @@ static int mlxsw_i2c_get_mbox(struct i2c_client *client, - struct i2c_client *client = to_i2c_client(dev); - struct mlxsw_i2c *mlxsw_i2c = i2c_get_clientdata(client); - unsigned long timeout = msecs_to_jiffies(MLXSW_I2C_TIMEOUT_MSECS); -- u8 tran_buf[MLXSW_I2C_MAX_BUFF_SIZE + MLXSW_I2C_ADDR_BUF_SIZE]; - int off = mlxsw_i2c->cmd.mb_off_in, chunk_size, i, j; - unsigned long end; -+ u8 *tran_buf; - struct i2c_msg write_tran = -- MLXSW_I2C_WRITE_MSG(client, tran_buf, MLXSW_I2C_PUSH_CMD_SIZE); -+ MLXSW_I2C_WRITE_MSG(client, NULL, MLXSW_I2C_PUSH_CMD_SIZE); - int err; - -+ tran_buf = kmalloc(mlxsw_i2c->block_size + MLXSW_I2C_ADDR_BUF_SIZE, -+ GFP_KERNEL); -+ if (!tran_buf) -+ return -ENOMEM; -+ -+ write_tran.buf = tran_buf; - for (i = 0; i < num; i++) { -- chunk_size = (in_mbox_size > MLXSW_I2C_BLK_MAX) ? -- MLXSW_I2C_BLK_MAX : in_mbox_size; -+ chunk_size = (in_mbox_size > mlxsw_i2c->block_size) ? -+ mlxsw_i2c->block_size : in_mbox_size; - write_tran.len = MLXSW_I2C_ADDR_WIDTH + chunk_size; - mlxsw_i2c_set_slave_addr(tran_buf, off); - memcpy(&tran_buf[MLXSW_I2C_ADDR_BUF_SIZE], in_mbox + -- MLXSW_I2C_BLK_MAX * i, chunk_size); -+ mlxsw_i2c->block_size * i, chunk_size); - - j = 0; - end = jiffies + timeout; -@@ -275,9 +349,10 @@ static int mlxsw_i2c_get_mbox(struct i2c_client *client, - (j++ < MLXSW_I2C_RETRY)); - - if (err != 1) { -- if (!err) -+ if (!err) { - err = -EIO; -- return err; -+ goto mlxsw_i2c_write_exit; -+ } - } - - off += chunk_size; -@@ -288,30 +363,33 @@ static int mlxsw_i2c_get_mbox(struct i2c_client *client, - err = mlxsw_i2c_write_cmd(client, mlxsw_i2c, 0); - if (err) { - dev_err(&client->dev, "Could not start transaction"); -- return -EIO; -+ err = -EIO; -+ goto mlxsw_i2c_write_exit; - } - - /* Wait until go bit is cleared. */ - err = mlxsw_i2c_wait_go_bit(client, mlxsw_i2c, p_status); - if (err) { - dev_err(&client->dev, "HW semaphore is not released"); -- return err; -+ goto mlxsw_i2c_write_exit; - } - - /* Validate transaction completion status. */ - if (*p_status) { - dev_err(&client->dev, "Bad transaction completion status %x\n", - *p_status); -- return -EIO; -+ err = -EIO; - } - -- return 0; -+mlxsw_i2c_write_exit: -+ kfree(tran_buf); -+ return err; - } - - /* Routine executes I2C command. */ - static int --mlxsw_i2c_cmd(struct device *dev, size_t in_mbox_size, u8 *in_mbox, -- size_t out_mbox_size, u8 *out_mbox, u8 *status) -+mlxsw_i2c_cmd(struct device *dev, u16 opcode, u32 in_mod, size_t in_mbox_size, -+ u8 *in_mbox, size_t out_mbox_size, u8 *out_mbox, u8 *status) - { - struct i2c_client *client = to_i2c_client(dev); - struct mlxsw_i2c *mlxsw_i2c = i2c_get_clientdata(client); -@@ -326,31 +404,47 @@ static int mlxsw_i2c_get_mbox(struct i2c_client *client, - - WARN_ON(in_mbox_size % sizeof(u32) || out_mbox_size % sizeof(u32)); - -- reg_size = mlxsw_i2c_get_reg_size(in_mbox); -- num = reg_size / MLXSW_I2C_BLK_MAX; -- if (reg_size % MLXSW_I2C_BLK_MAX) -- num++; -+ if (in_mbox) { -+ reg_size = mlxsw_i2c_get_reg_size(in_mbox); -+ num = reg_size / mlxsw_i2c->block_size; -+ if (reg_size % mlxsw_i2c->block_size) -+ num++; - -- if (mutex_lock_interruptible(&mlxsw_i2c->cmd.lock) < 0) { -- dev_err(&client->dev, "Could not acquire lock"); -- return -EINVAL; -- } -+ if (mutex_lock_interruptible(&mlxsw_i2c->cmd.lock) < 0) { -+ dev_err(&client->dev, "Could not acquire lock"); -+ return -EINVAL; -+ } - -- err = mlxsw_i2c_write(dev, reg_size, in_mbox, num, status); -- if (err) -- goto cmd_fail; -+ err = mlxsw_i2c_write(dev, reg_size, in_mbox, num, status); -+ if (err) -+ goto cmd_fail; -+ -+ /* No out mailbox is case of write transaction. */ -+ if (!out_mbox) { -+ mutex_unlock(&mlxsw_i2c->cmd.lock); -+ return 0; -+ } -+ } else { -+ /* No input mailbox is case of initialization query command. */ -+ reg_size = MLXSW_I2C_MAX_DATA_SIZE; -+ num = reg_size / mlxsw_i2c->block_size; -+ -+ if (mutex_lock_interruptible(&mlxsw_i2c->cmd.lock) < 0) { -+ dev_err(&client->dev, "Could not acquire lock"); -+ return -EINVAL; -+ } - -- /* No out mailbox is case of write transaction. */ -- if (!out_mbox) { -- mutex_unlock(&mlxsw_i2c->cmd.lock); -- return 0; -+ err = mlxsw_i2c_write_init_cmd(client, mlxsw_i2c, opcode, -+ in_mod); -+ if (err) -+ goto cmd_fail; - } - - /* Send read transaction to get output mailbox content. */ - read_tran[1].buf = out_mbox; - for (i = 0; i < num; i++) { -- chunk_size = (reg_size > MLXSW_I2C_BLK_MAX) ? -- MLXSW_I2C_BLK_MAX : reg_size; -+ chunk_size = (reg_size > mlxsw_i2c->block_size) ? -+ mlxsw_i2c->block_size : reg_size; - read_tran[1].len = chunk_size; - mlxsw_i2c_set_slave_addr(tran_buf, off); - -@@ -395,8 +489,8 @@ static int mlxsw_i2c_cmd_exec(void *bus_priv, u16 opcode, u8 opcode_mod, - { - struct mlxsw_i2c *mlxsw_i2c = bus_priv; - -- return mlxsw_i2c_cmd(mlxsw_i2c->dev, in_mbox_size, in_mbox, -- out_mbox_size, out_mbox, status); -+ return mlxsw_i2c_cmd(mlxsw_i2c->dev, opcode, in_mod, in_mbox_size, -+ in_mbox, out_mbox_size, out_mbox, status); - } - - static bool mlxsw_i2c_skb_transmit_busy(void *bus_priv, -@@ -414,13 +508,34 @@ static int mlxsw_i2c_skb_transmit(void *bus_priv, struct sk_buff *skb, - static int - mlxsw_i2c_init(void *bus_priv, struct mlxsw_core *mlxsw_core, - const struct mlxsw_config_profile *profile, -- struct mlxsw_res *resources) -+ struct mlxsw_res *res) - { - struct mlxsw_i2c *mlxsw_i2c = bus_priv; -+ char *mbox; -+ int err; - - mlxsw_i2c->core = mlxsw_core; - -- return 0; -+ mbox = mlxsw_cmd_mbox_alloc(); -+ if (!mbox) -+ return -ENOMEM; -+ -+ err = mlxsw_cmd_query_fw(mlxsw_core, mbox); -+ if (err) -+ goto mbox_put; -+ -+ mlxsw_i2c->bus_info.fw_rev.major = -+ mlxsw_cmd_mbox_query_fw_fw_rev_major_get(mbox); -+ mlxsw_i2c->bus_info.fw_rev.minor = -+ mlxsw_cmd_mbox_query_fw_fw_rev_minor_get(mbox); -+ mlxsw_i2c->bus_info.fw_rev.subminor = -+ mlxsw_cmd_mbox_query_fw_fw_rev_subminor_get(mbox); -+ -+ err = mlxsw_core_resources_query(mlxsw_core, mbox, res); -+ -+mbox_put: -+ mlxsw_cmd_mbox_free(mbox); -+ return err; - } - - static void mlxsw_i2c_fini(void *bus_priv) -@@ -442,6 +557,7 @@ static void mlxsw_i2c_fini(void *bus_priv) - static int mlxsw_i2c_probe(struct i2c_client *client, - const struct i2c_device_id *id) - { -+ const struct i2c_adapter_quirks *quirks = client->adapter->quirks; - struct mlxsw_i2c *mlxsw_i2c; - u8 status; - int err; -@@ -450,6 +566,22 @@ static int mlxsw_i2c_probe(struct i2c_client *client, - if (!mlxsw_i2c) - return -ENOMEM; - -+ if (quirks) { -+ if ((quirks->max_read_len && -+ quirks->max_read_len < MLXSW_I2C_BLK_DEF) || -+ (quirks->max_write_len && -+ quirks->max_write_len < MLXSW_I2C_BLK_DEF)) { -+ dev_err(&client->dev, "Insufficient transaction buffer length\n"); -+ return -EOPNOTSUPP; -+ } -+ -+ mlxsw_i2c->block_size = max_t(u16, MLXSW_I2C_BLK_DEF, -+ min_t(u16, quirks->max_read_len, -+ quirks->max_write_len)); -+ } else { -+ mlxsw_i2c->block_size = MLXSW_I2C_BLK_DEF; -+ } -+ - i2c_set_clientdata(client, mlxsw_i2c); - mutex_init(&mlxsw_i2c->cmd.lock); - -@@ -503,6 +635,7 @@ static int mlxsw_i2c_probe(struct i2c_client *client, - mlxsw_i2c->bus_info.device_kind = id->name; - mlxsw_i2c->bus_info.device_name = client->name; - mlxsw_i2c->bus_info.dev = &client->dev; -+ mlxsw_i2c->bus_info.low_frequency = true; - mlxsw_i2c->dev = &client->dev; - - err = mlxsw_core_bus_device_register(&mlxsw_i2c->bus_info, -@@ -513,6 +646,11 @@ static int mlxsw_i2c_probe(struct i2c_client *client, - return err; - } - -+ dev_info(&client->dev, "Firmware revision: %d.%d.%d\n", -+ mlxsw_i2c->bus_info.fw_rev.major, -+ mlxsw_i2c->bus_info.fw_rev.minor, -+ mlxsw_i2c->bus_info.fw_rev.subminor); -+ - return 0; - - errout: diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c index 5a6c445..504db12 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c @@ -3027,7 +2604,7 @@ diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/me index a903e97..b40455f 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/pci.c +++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c -@@ -1039,42 +1039,6 @@ static void mlxsw_pci_aqs_fini(struct mlxsw_pci *mlxsw_pci) +@@ -1039,42 +1039,6 @@ mlxsw_pci_config_profile_swid_config(struct mlxsw_pci *mlxsw_pci, mlxsw_cmd_mbox_config_profile_swid_config_mask_set(mbox, index, mask); } @@ -3568,7 +3145,7 @@ index 0000000..49563a7 +MODULE_AUTHOR("Vadim Pasternak "); +MODULE_DESCRIPTION("Mellanox switch QSFP sysfs driver"); diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h -index aee58b3..7ca9814 100644 +index c989587..7ca9814 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h @@ -295,6 +295,7 @@ enum mlxsw_reg_sfd_rec_type { @@ -3579,7 +3156,7 @@ index aee58b3..7ca9814 100644 }; /* reg_sfd_rec_type -@@ -525,6 +526,61 @@ static inline void mlxsw_reg_sfd_uc_lag_unpack(char *payload, int rec_index, +@@ -525,6 +526,61 @@ mlxsw_reg_sfd_mc_pack(char *payload, int rec_index, mlxsw_reg_sfd_mc_mid_set(payload, rec_index, mid); } @@ -3739,7 +3316,7 @@ index aee58b3..7ca9814 100644 * Access: RW */ MLXSW_ITEM32(reg, sfdf, flush_type, 0x04, 28, 4); -@@ -1315,12 +1441,19 @@ enum mlxsw_reg_slcr_type { +@@ -1315,12 +1441,19 @@ MLXSW_ITEM32(reg, slcr, type, 0x00, 0, 4); */ MLXSW_ITEM32(reg, slcr, lag_hash, 0x04, 0, 20); @@ -3760,7 +3337,7 @@ index aee58b3..7ca9814 100644 } /* SLCOR - Switch LAG Collector Register -@@ -2066,6 +2199,14 @@ static inline void mlxsw_reg_pacl_pack(char *payload, u16 acl_id, +@@ -2066,6 +2199,14 @@ MLXSW_ITEM32(reg, pagt, size, 0x00, 0, 8); */ MLXSW_ITEM32(reg, pagt, acl_group_id, 0x08, 0, 16); @@ -3834,7 +3411,7 @@ index aee58b3..7ca9814 100644 /* PTCE-V2 - Policy-Engine TCAM Entry Register Version 2 * ----------------------------------------------------- * This register is used for accessing rules within a TCAM region. -@@ -2573,7 +2752,7 @@ static inline void mlxsw_reg_perpt_erp_vector_pack(char *payload, +@@ -2573,7 +2752,7 @@ mlxsw_reg_perpt_pack(char *payload, u8 erpt_bank, u8 erpt_index, mlxsw_reg_perpt_erpt_bank_set(payload, erpt_bank); mlxsw_reg_perpt_erpt_index_set(payload, erpt_index); mlxsw_reg_perpt_key_size_set(payload, key_size); @@ -3947,50 +3524,7 @@ index aee58b3..7ca9814 100644 /* IEDR - Infrastructure Entry Delete Register * ---------------------------------------------------- * This register is used for deleting entries from the entry tables. -@@ -3215,7 +3464,7 @@ static inline void mlxsw_reg_qtct_pack(char *payload, u8 local_port, - * Configures the ETS elements. - */ - #define MLXSW_REG_QEEC_ID 0x400D --#define MLXSW_REG_QEEC_LEN 0x1C -+#define MLXSW_REG_QEEC_LEN 0x20 - - MLXSW_REG_DEFINE(qeec, MLXSW_REG_QEEC_ID, MLXSW_REG_QEEC_LEN); - -@@ -3257,6 +3506,15 @@ enum mlxsw_reg_qeec_hr { - */ - MLXSW_ITEM32(reg, qeec, next_element_index, 0x08, 0, 8); - -+/* reg_qeec_mise -+ * Min shaper configuration enable. Enables configuration of the min -+ * shaper on this ETS element -+ * 0 - Disable -+ * 1 - Enable -+ * Access: RW -+ */ -+MLXSW_ITEM32(reg, qeec, mise, 0x0C, 31, 1); -+ - enum { - MLXSW_REG_QEEC_BYTES_MODE, - MLXSW_REG_QEEC_PACKETS_MODE, -@@ -3273,6 +3531,17 @@ enum { - */ - MLXSW_ITEM32(reg, qeec, pb, 0x0C, 28, 1); - -+/* The smallest permitted min shaper rate. */ -+#define MLXSW_REG_QEEC_MIS_MIN 200000 /* Kbps */ -+ -+/* reg_qeec_min_shaper_rate -+ * Min shaper information rate. -+ * For CPU port, can only be configured for port hierarchy. -+ * When in bytes mode, value is specified in units of 1000bps. -+ * Access: RW -+ */ -+MLXSW_ITEM32(reg, qeec, min_shaper_rate, 0x0C, 0, 28); -+ - /* reg_qeec_mase - * Max shaper configuration enable. Enables configuration of the max - * shaper on this ETS element. -@@ -4142,8 +4411,11 @@ static inline void mlxsw_reg_pfcc_pack(char *payload, u8 local_port) +@@ -4162,8 +4411,11 @@ MLXSW_ITEM32(reg, ppcnt, pnat, 0x00, 14, 2); enum mlxsw_reg_ppcnt_grp { MLXSW_REG_PPCNT_IEEE_8023_CNT = 0x0, @@ -4002,7 +3536,7 @@ index aee58b3..7ca9814 100644 MLXSW_REG_PPCNT_PRIO_CNT = 0x10, MLXSW_REG_PPCNT_TC_CNT = 0x11, MLXSW_REG_PPCNT_TC_CONG_TC = 0x13, -@@ -4158,6 +4430,7 @@ enum mlxsw_reg_ppcnt_grp { +@@ -4178,6 +4430,7 @@ enum mlxsw_reg_ppcnt_grp { * 0x2: RFC 2819 Counters * 0x3: RFC 3635 Counters * 0x5: Ethernet Extended Counters @@ -4010,7 +3544,7 @@ index aee58b3..7ca9814 100644 * 0x8: Link Level Retransmission Counters * 0x10: Per Priority Counters * 0x11: Per Traffic Class Counters -@@ -4301,8 +4574,46 @@ enum mlxsw_reg_ppcnt_grp { +@@ -4321,8 +4574,46 @@ MLXSW_ITEM64(reg, ppcnt, a_pause_mac_ctrl_frames_received, MLXSW_ITEM64(reg, ppcnt, a_pause_mac_ctrl_frames_transmitted, MLXSW_REG_PPCNT_COUNTERS_OFFSET + 0x90, 0, 64); @@ -4057,7 +3591,7 @@ index aee58b3..7ca9814 100644 /* reg_ppcnt_ether_stats_pkts64octets * Access: RO */ -@@ -4363,6 +4674,32 @@ enum mlxsw_reg_ppcnt_grp { +@@ -4383,6 +4674,32 @@ MLXSW_ITEM64(reg, ppcnt, ether_stats_pkts4096to8191octets, MLXSW_ITEM64(reg, ppcnt, ether_stats_pkts8192to10239octets, MLXSW_REG_PPCNT_COUNTERS_OFFSET + 0xA0, 0, 64); @@ -4090,7 +3624,7 @@ index aee58b3..7ca9814 100644 /* Ethernet Extended Counter Group Counters */ /* reg_ppcnt_ecn_marked -@@ -4371,6 +4708,80 @@ enum mlxsw_reg_ppcnt_grp { +@@ -4391,6 +4708,80 @@ MLXSW_ITEM64(reg, ppcnt, ether_stats_pkts8192to10239octets, MLXSW_ITEM64(reg, ppcnt, ecn_marked, MLXSW_REG_PPCNT_COUNTERS_OFFSET + 0x08, 0, 64); @@ -4171,7 +3705,7 @@ index aee58b3..7ca9814 100644 /* Ethernet Per Priority Group Counters */ /* reg_ppcnt_rx_octets -@@ -4773,6 +5184,7 @@ enum mlxsw_reg_htgt_trap_group { +@@ -4793,6 +5184,7 @@ enum mlxsw_reg_htgt_trap_group { MLXSW_REG_HTGT_TRAP_GROUP_SP_EVENT, MLXSW_REG_HTGT_TRAP_GROUP_SP_IPV6_MLD, MLXSW_REG_HTGT_TRAP_GROUP_SP_IPV6_ND, @@ -4179,7 +3713,7 @@ index aee58b3..7ca9814 100644 }; /* reg_htgt_trap_group -@@ -5263,6 +5675,8 @@ enum mlxsw_reg_ritr_loopback_protocol { +@@ -5283,6 +5675,8 @@ enum mlxsw_reg_ritr_loopback_protocol { MLXSW_REG_RITR_LOOPBACK_PROTOCOL_IPIP_IPV4, /* IPinIP IPv6 underlay Unicast */ MLXSW_REG_RITR_LOOPBACK_PROTOCOL_IPIP_IPV6, @@ -4188,7 +3722,7 @@ index aee58b3..7ca9814 100644 }; /* reg_ritr_loopback_protocol -@@ -5303,6 +5717,13 @@ enum mlxsw_reg_ritr_loopback_ipip_options { +@@ -5323,6 +5717,13 @@ MLXSW_ITEM32(reg, ritr, loopback_ipip_options, 0x10, 20, 4); */ MLXSW_ITEM32(reg, ritr, loopback_ipip_uvr, 0x10, 0, 16); @@ -4202,7 +3736,7 @@ index aee58b3..7ca9814 100644 /* reg_ritr_loopback_ipip_usip* * Encapsulation Underlay source IP. * Access: RW -@@ -5418,11 +5839,12 @@ static inline void mlxsw_reg_ritr_mac_pack(char *payload, const char *mac) +@@ -5438,11 +5839,12 @@ static inline void mlxsw_reg_ritr_loopback_ipip_common_pack(char *payload, enum mlxsw_reg_ritr_loopback_ipip_type ipip_type, enum mlxsw_reg_ritr_loopback_ipip_options options, @@ -4216,7 +3750,7 @@ index aee58b3..7ca9814 100644 mlxsw_reg_ritr_loopback_ipip_gre_key_set(payload, gre_key); } -@@ -5430,12 +5852,12 @@ static inline void mlxsw_reg_ritr_mac_pack(char *payload, const char *mac) +@@ -5450,12 +5852,12 @@ static inline void mlxsw_reg_ritr_loopback_ipip4_pack(char *payload, enum mlxsw_reg_ritr_loopback_ipip_type ipip_type, enum mlxsw_reg_ritr_loopback_ipip_options options, @@ -4231,7 +3765,7 @@ index aee58b3..7ca9814 100644 mlxsw_reg_ritr_loopback_ipip_usip4_set(payload, usip); } -@@ -6797,6 +7219,13 @@ enum mlxsw_reg_rtdp_type { +@@ -6817,6 +7219,13 @@ MLXSW_ITEM32(reg, rtdp, type, 0x00, 28, 4); */ MLXSW_ITEM32(reg, rtdp, tunnel_index, 0x00, 0, 24); @@ -4245,7 +3779,7 @@ index aee58b3..7ca9814 100644 /* IPinIP */ /* reg_rtdp_ipip_irif -@@ -7446,6 +7875,35 @@ static inline void mlxsw_reg_mfsl_unpack(char *payload, u8 tacho, +@@ -7466,6 +7875,35 @@ static inline void mlxsw_reg_mfsl_unpack(char *payload, u8 tacho, *p_tach_max = mlxsw_reg_mfsl_tach_max_get(payload); } @@ -4281,7 +3815,7 @@ index aee58b3..7ca9814 100644 /* MTCAP - Management Temperature Capabilities * ------------------------------------------- * This register exposes the capabilities of the device and -@@ -7474,16 +7932,21 @@ static inline void mlxsw_reg_mfsl_unpack(char *payload, u8 tacho, +@@ -7494,16 +7932,21 @@ MLXSW_ITEM32(reg, mtcap, sensor_count, 0x00, 0, 7); MLXSW_REG_DEFINE(mtmp, MLXSW_REG_MTMP_ID, MLXSW_REG_MTMP_LEN); @@ -4305,7 +3839,7 @@ index aee58b3..7ca9814 100644 /* reg_mtmp_temperature * Temperature reading from the sensor. Reading is in 0.125 Celsius -@@ -7542,7 +8005,7 @@ static inline void mlxsw_reg_mfsl_unpack(char *payload, u8 tacho, +@@ -7562,7 +8005,7 @@ MLXSW_ITEM32(reg, mtmp, temperature_threshold_lo, 0x10, 0, 16); */ MLXSW_ITEM_BUF(reg, mtmp, sensor_name, 0x18, MLXSW_REG_MTMP_SENSOR_NAME_SIZE); @@ -4314,7 +3848,7 @@ index aee58b3..7ca9814 100644 bool max_temp_enable, bool max_temp_reset) { -@@ -7554,11 +8017,10 @@ static inline void mlxsw_reg_mtmp_pack(char *payload, u8 sensor_index, +@@ -7574,11 +8017,10 @@ static inline void mlxsw_reg_mtmp_pack(char *payload, u8 sensor_index, MLXSW_REG_MTMP_THRESH_HI); } @@ -4329,7 +3863,7 @@ index aee58b3..7ca9814 100644 if (p_temp) { temp = mlxsw_reg_mtmp_temperature_get(payload); -@@ -7572,6 +8034,80 @@ static inline void mlxsw_reg_mtmp_unpack(char *payload, unsigned int *p_temp, +@@ -7592,6 +8034,80 @@ static inline void mlxsw_reg_mtmp_unpack(char *payload, unsigned int *p_temp, mlxsw_reg_mtmp_sensor_name_memcpy_from(payload, sensor_name); } @@ -4410,7 +3944,7 @@ index aee58b3..7ca9814 100644 /* MCIA - Management Cable Info Access * ----------------------------------- * MCIA register is used to access the SFP+ and QSFP connector's EPROM. -@@ -7626,13 +8162,48 @@ static inline void mlxsw_reg_mtmp_unpack(char *payload, unsigned int *p_temp, +@@ -7646,13 +8162,48 @@ MLXSW_ITEM32(reg, mcia, device_address, 0x04, 0, 16); */ MLXSW_ITEM32(reg, mcia, size, 0x08, 0, 16); @@ -4461,7 +3995,7 @@ index aee58b3..7ca9814 100644 static inline void mlxsw_reg_mcia_pack(char *payload, u8 module, u8 lock, u8 page_number, u16 device_addr, -@@ -7968,6 +8539,43 @@ static inline void mlxsw_reg_mlcr_pack(char *payload, u8 local_port, +@@ -7988,6 +8539,43 @@ static inline void mlxsw_reg_mlcr_pack(char *payload, u8 local_port, MLXSW_REG_MLCR_DURATION_MAX : 0); } @@ -4505,7 +4039,7 @@ index aee58b3..7ca9814 100644 /* MCQI - Management Component Query Information * --------------------------------------------- * This register allows querying information about firmware components. -@@ -8279,6 +8887,567 @@ static inline void mlxsw_reg_mgpc_pack(char *payload, u32 counter_index, +@@ -8299,6 +8887,567 @@ static inline void mlxsw_reg_mgpc_pack(char *payload, u32 counter_index, mlxsw_reg_mgpc_opcode_set(payload, opcode); } @@ -5073,7 +4607,7 @@ index aee58b3..7ca9814 100644 /* TIGCR - Tunneling IPinIP General Configuration Register * ------------------------------------------------------- * The TIGCR register is used for setting up the IPinIP Tunnel configuration. -@@ -8336,8 +9505,15 @@ enum mlxsw_reg_sbxx_dir { +@@ -8356,8 +9505,15 @@ MLXSW_ITEM32(reg, sbpr, dir, 0x00, 24, 2); */ MLXSW_ITEM32(reg, sbpr, pool, 0x00, 0, 4); @@ -5089,7 +4623,7 @@ index aee58b3..7ca9814 100644 * Access: RW */ MLXSW_ITEM32(reg, sbpr, size, 0x04, 0, 24); -@@ -8355,13 +9531,15 @@ enum mlxsw_reg_sbpr_mode { +@@ -8375,13 +9531,15 @@ MLXSW_ITEM32(reg, sbpr, mode, 0x08, 0, 4); static inline void mlxsw_reg_sbpr_pack(char *payload, u8 pool, enum mlxsw_reg_sbxx_dir dir, @@ -5106,7 +4640,7 @@ index aee58b3..7ca9814 100644 } /* SBCM - Shared Buffer Class Management Register -@@ -8409,6 +9587,12 @@ static inline void mlxsw_reg_sbpr_pack(char *payload, u8 pool, +@@ -8429,6 +9587,12 @@ MLXSW_ITEM32(reg, sbcm, min_buff, 0x18, 0, 24); #define MLXSW_REG_SBXX_DYN_MAX_BUFF_MIN 1 #define MLXSW_REG_SBXX_DYN_MAX_BUFF_MAX 14 @@ -5119,7 +4653,7 @@ index aee58b3..7ca9814 100644 /* reg_sbcm_max_buff * When the pool associated to the port-pg/tclass is configured to * static, Maximum buffer size for the limiter configured in cells. -@@ -8418,6 +9602,7 @@ static inline void mlxsw_reg_sbpr_pack(char *payload, u8 pool, +@@ -8438,6 +9602,7 @@ MLXSW_ITEM32(reg, sbcm, min_buff, 0x18, 0, 24); * 0: 0 * i: (1/128)*2^(i-1), for i=1..14 * 0xFF: Infinity @@ -5127,7 +4661,7 @@ index aee58b3..7ca9814 100644 * Access: RW */ MLXSW_ITEM32(reg, sbcm, max_buff, 0x1C, 0, 24); -@@ -8430,7 +9615,8 @@ static inline void mlxsw_reg_sbpr_pack(char *payload, u8 pool, +@@ -8450,7 +9615,8 @@ MLXSW_ITEM32(reg, sbcm, pool, 0x24, 0, 4); static inline void mlxsw_reg_sbcm_pack(char *payload, u8 local_port, u8 pg_buff, enum mlxsw_reg_sbxx_dir dir, @@ -5137,7 +4671,7 @@ index aee58b3..7ca9814 100644 { MLXSW_REG_ZERO(sbcm, payload); mlxsw_reg_sbcm_local_port_set(payload, local_port); -@@ -8438,6 +9624,7 @@ static inline void mlxsw_reg_sbcm_pack(char *payload, u8 local_port, u8 pg_buff, +@@ -8458,6 +9624,7 @@ static inline void mlxsw_reg_sbcm_pack(char *payload, u8 local_port, u8 pg_buff, mlxsw_reg_sbcm_dir_set(payload, dir); mlxsw_reg_sbcm_min_buff_set(payload, min_buff); mlxsw_reg_sbcm_max_buff_set(payload, max_buff); @@ -5145,7 +4679,7 @@ index aee58b3..7ca9814 100644 mlxsw_reg_sbcm_pool_set(payload, pool); } -@@ -8748,8 +9935,10 @@ static inline void mlxsw_reg_sbib_pack(char *payload, u8 local_port, +@@ -8768,8 +9935,10 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = { MLXSW_REG(ppbs), MLXSW_REG(prcr), MLXSW_REG(pefa), @@ -5156,7 +4690,7 @@ index aee58b3..7ca9814 100644 MLXSW_REG(perar), MLXSW_REG(ptce3), MLXSW_REG(percr), -@@ -8798,18 +9987,30 @@ static inline void mlxsw_reg_sbib_pack(char *payload, u8 local_port, +@@ -8818,18 +9987,30 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = { MLXSW_REG(mfsc), MLXSW_REG(mfsm), MLXSW_REG(mfsl), @@ -5206,7 +4740,7 @@ index 79a31de..b8b3a01 100644 /* Internal resources. * Determined by the SW, not queried from the HW. -@@ -91,11 +94,14 @@ enum mlxsw_res_id { +@@ -91,11 +94,14 @@ static u16 mlxsw_res_ids[] = { [MLXSW_RES_ID_ACL_ERPT_ENTRIES_4KB] = 0x2951, [MLXSW_RES_ID_ACL_ERPT_ENTRIES_8KB] = 0x2952, [MLXSW_RES_ID_ACL_ERPT_ENTRIES_12KB] = 0x2953, @@ -5294,7 +4828,7 @@ index d52c821..77be37a 100644 priv->regmap = pdata->regmap; diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index 742a0c2..c27548f 100644 +index 69e28c1..c27548f 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -1,34 +1,9 @@ @@ -5501,7 +5035,7 @@ index 742a0c2..c27548f 100644 }; /* Regions for LPC I2C controller and LPC base register space */ -@@ -173,6 +213,30 @@ struct mlxplat_priv { +@@ -173,6 +213,30 @@ static const struct resource mlxplat_lpc_resources[] = { IORESOURCE_IO), }; @@ -5532,7 +5066,7 @@ index 742a0c2..c27548f 100644 /* Platform default channels */ static const int mlxplat_default_channels[][MLXPLAT_CPLD_GRP_CHNL_NUM] = { { -@@ -191,7 +255,33 @@ struct mlxplat_priv { +@@ -191,7 +255,33 @@ static const int mlxplat_default_channels[][MLXPLAT_CPLD_GRP_CHNL_NUM] = { static const int mlxplat_msn21xx_channels[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; /* Platform mux data */ @@ -5567,7 +5101,7 @@ index 742a0c2..c27548f 100644 { .parent = 1, .base_nr = MLXPLAT_CPLD_CH1, -@@ -204,6 +294,14 @@ struct mlxplat_priv { +@@ -204,6 +294,14 @@ static struct i2c_mux_reg_platform_data mlxplat_mux_data[] = { .parent = 1, .base_nr = MLXPLAT_CPLD_CH2, .write_only = 1, @@ -5582,7 +5116,7 @@ index 742a0c2..c27548f 100644 .reg = (void __iomem *)MLXPLAT_CPLD_LPC_REG2, .reg_size = 1, .idle_in_use = 1, -@@ -254,6 +352,22 @@ struct mlxplat_priv { +@@ -254,6 +352,22 @@ static struct i2c_board_info mlxplat_mlxcpld_fan[] = { }, }; @@ -5605,7 +5139,7 @@ index 742a0c2..c27548f 100644 /* Platform hotplug default data */ static struct mlxreg_core_data mlxplat_mlxcpld_default_psu_items_data[] = { { -@@ -368,6 +482,45 @@ struct mlxplat_priv { +@@ -368,6 +482,45 @@ static struct mlxreg_core_item mlxplat_mlxcpld_default_items[] = { }, }; @@ -5668,16 +5202,7 @@ index 742a0c2..c27548f 100644 static struct mlxreg_core_data mlxplat_mlxcpld_msn21xx_pwr_items_data[] = { { .label = "pwr1", -@@ -575,7 +738,7 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_msn274x_data = { - - static - struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_msn201x_data = { -- .items = mlxplat_mlxcpld_msn21xx_items, -+ .items = mlxplat_mlxcpld_msn201x_items, - .counter = ARRAY_SIZE(mlxplat_mlxcpld_msn201x_items), - .cell = MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET, - .mask = MLXPLAT_CPLD_AGGR_MASK_DEF, -@@ -606,36 +769,48 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_msn201x_data = { +@@ -606,36 +769,48 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_fan_items_data[] = { .label = "fan1", .reg = MLXPLAT_CPLD_LPC_REG_FAN_OFFSET, .mask = BIT(0), @@ -5845,7 +5370,7 @@ index 742a0c2..c27548f 100644 .cell_low = MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET, .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_LOW, }; -@@ -838,61 +1123,90 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_ng_data = { +@@ -838,61 +1123,90 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_led_data[] = { .label = "fan1:green", .reg = MLXPLAT_CPLD_LPC_REG_LED2_OFFSET, .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, @@ -5936,7 +5461,7 @@ index 742a0c2..c27548f 100644 }, }; -@@ -901,61 +1215,135 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_ng_data = { +@@ -901,64 +1215,138 @@ static struct mlxreg_core_platform_data mlxplat_default_ng_led_data = { .counter = ARRAY_SIZE(mlxplat_mlxcpld_default_ng_led_data), }; @@ -6024,8 +5549,9 @@ index 742a0c2..c27548f 100644 + .label = "fan3:green", + .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, + .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, -+ }, -+ { + }, + { +- .label = "reset_asic_thermal", + .label = "fan3:red", + .reg = MLXPLAT_CPLD_LPC_REG_LED3_OFFSET, + .mask = MLXPLAT_CPLD_LED_LO_NIBBLE_MASK, @@ -6107,10 +5633,13 @@ index 742a0c2..c27548f 100644 + .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(6), + .mode = 0444, - }, - { - .label = "reset_asic_thermal", -@@ -1064,6 +1452,12 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_ng_data = { ++ }, ++ { ++ .label = "reset_asic_thermal", + .reg = MLXPLAT_CPLD_LPC_REG_RESET_CAUSE_OFFSET, + .mask = GENMASK(7, 0) & ~BIT(7), + .mode = 0444, +@@ -1064,6 +1452,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_msn21xx_regs_io_data[] = { .mode = 0444, }, { @@ -6123,7 +5652,7 @@ index 742a0c2..c27548f 100644 .label = "psu1_on", .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET, .mask = GENMASK(7, 0) & ~BIT(0), -@@ -1088,6 +1482,12 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_ng_data = { +@@ -1088,6 +1482,12 @@ static struct mlxreg_core_data mlxplat_mlxcpld_msn21xx_regs_io_data[] = { .mode = 0200, }, { @@ -6136,7 +5665,7 @@ index 742a0c2..c27548f 100644 .label = "asic_health", .reg = MLXPLAT_CPLD_LPC_REG_ASIC_HEALTH_OFFSET, .mask = MLXPLAT_CPLD_ASIC_MASK, -@@ -1101,6 +1501,221 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_ng_data = { +@@ -1101,6 +1501,221 @@ static struct mlxreg_core_platform_data mlxplat_msn21xx_regs_io_data = { .counter = ARRAY_SIZE(mlxplat_mlxcpld_msn21xx_regs_io_data), }; @@ -6358,7 +5887,7 @@ index 742a0c2..c27548f 100644 /* Platform FAN default */ static struct mlxreg_core_data mlxplat_mlxcpld_default_fan_data[] = { { -@@ -1111,61 +1726,89 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_ng_data = { +@@ -1111,61 +1726,89 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_fan_data[] = { .label = "tacho1", .reg = MLXPLAT_CPLD_LPC_REG_TACHO1_OFFSET, .mask = GENMASK(7, 0), @@ -6448,7 +5977,7 @@ index 742a0c2..c27548f 100644 }, }; -@@ -1174,6 +1817,148 @@ struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_default_ng_data = { +@@ -1174,6 +1817,148 @@ static struct mlxreg_core_platform_data mlxplat_default_fan_data = { .counter = ARRAY_SIZE(mlxplat_mlxcpld_default_fan_data), }; @@ -6747,7 +6276,7 @@ index 742a0c2..c27548f 100644 return true; } return false; -@@ -1305,6 +2153,25 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) +@@ -1305,6 +2153,25 @@ static const struct reg_default mlxplat_mlxcpld_regmap_default[] = { { MLXPLAT_CPLD_LPC_REG_WP1_OFFSET, 0x00 }, { MLXPLAT_CPLD_LPC_REG_WP2_OFFSET, 0x00 }, { MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET, 0x00 }, @@ -6773,7 +6302,7 @@ index 742a0c2..c27548f 100644 }; struct mlxplat_mlxcpld_regmap_context { -@@ -1345,21 +2212,70 @@ struct mlxplat_mlxcpld_regmap_context { +@@ -1345,21 +2212,70 @@ static const struct regmap_config mlxplat_mlxcpld_regmap_config = { .reg_write = mlxplat_mlxcpld_reg_write, }; @@ -6911,12 +6440,9 @@ index 742a0c2..c27548f 100644 mlxplat_mux_data[i].values = mlxplat_msn21xx_channels; mlxplat_mux_data[i].n_values = ARRAY_SIZE(mlxplat_msn21xx_channels); -@@ -1421,17 +2349,21 @@ static int __init mlxplat_dmi_msn201x_matched(const struct dmi_system_id *dmi) - mlxplat_hotplug = &mlxplat_mlxcpld_msn201x_data; - mlxplat_hotplug->deferred_nr = +@@ -1423,15 +2351,19 @@ static int __init mlxplat_dmi_msn201x_matched(const struct dmi_system_id *dmi) mlxplat_default_channels[i - 1][MLXPLAT_CPLD_GRP_CHNL_NUM - 1]; -- mlxplat_led = &mlxplat_default_ng_led_data; -+ mlxplat_led = &mlxplat_msn21xx_led_data; + mlxplat_led = &mlxplat_msn21xx_led_data; mlxplat_regs_io = &mlxplat_msn21xx_regs_io_data; + mlxplat_wd_data[0] = &mlxplat_mlxcpld_wd_set_type1[0]; @@ -6936,12 +6462,10 @@ index 742a0c2..c27548f 100644 mlxplat_mux_data[i].values = mlxplat_msn21xx_channels; mlxplat_mux_data[i].n_values = ARRAY_SIZE(mlxplat_msn21xx_channels); -@@ -1439,14 +2371,117 @@ static int __init mlxplat_dmi_qmb7xx_matched(const struct dmi_system_id *dmi) - mlxplat_hotplug = &mlxplat_mlxcpld_default_ng_data; +@@ -1440,13 +2372,116 @@ static int __init mlxplat_dmi_qmb7xx_matched(const struct dmi_system_id *dmi) mlxplat_hotplug->deferred_nr = mlxplat_msn21xx_channels[MLXPLAT_CPLD_GRP_CHNL_NUM - 1]; -- mlxplat_led = &mlxplat_msn21xx_led_data; -+ mlxplat_led = &mlxplat_default_ng_led_data; + 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++) @@ -7056,7 +6580,7 @@ index 742a0c2..c27548f 100644 .callback = mlxplat_dmi_msn274x_matched, .matches = { DMI_MATCH(DMI_BOARD_VENDOR, "Mellanox Technologies"), -@@ -1499,51 +2534,28 @@ static int __init mlxplat_dmi_qmb7xx_matched(const struct dmi_system_id *dmi) +@@ -1499,51 +2534,28 @@ static const struct dmi_system_id mlxplat_dmi_table[] __initconst = { .callback = mlxplat_dmi_qmb7xx_matched, .matches = { DMI_MATCH(DMI_BOARD_VENDOR, "Mellanox Technologies"), @@ -7305,7 +6829,7 @@ index 742a0c2..c27548f 100644 platform_device_unregister(priv->pdev_i2c); diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig -index b165c46..5763dfc 100644 +index 709d4de..da31a4b 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -241,6 +241,22 @@ config RAVE_SP_WATCHDOG @@ -7732,5 +7256,5 @@ index dc69391..08bb155 100644 /* The reset() operation must clear the flags for the components which * were actually reset. On successful return, the flags indicate the -- -1.9.1 +2.11.0 diff --git a/patch/0003-mlxsw-minimal-Fix-validation-for-FW-minor-version.patch b/patch/0003-mlxsw-minimal-Fix-validation-for-FW-minor-version.patch index 0fe4923f78e7..2ce47907ea6e 100644 --- a/patch/0003-mlxsw-minimal-Fix-validation-for-FW-minor-version.patch +++ b/patch/0003-mlxsw-minimal-Fix-validation-for-FW-minor-version.patch @@ -1,6 +1,7 @@ From d45701f5f15e77f3961717d7f076163d3c2124e2 Mon Sep 17 00:00:00 2001 + From: Vadim Pasternak -Date: Mon, 17 Feb 2020 08:38:01 +0200 + Subject: [v4.19 backport 2/2] mlxsw: minimal: Fix validation for FW minor version @@ -9,11 +10,11 @@ initialization in case FW minor version is older than expected. Signed-off-by: Vadim Pasternak --- - drivers/net/ethernet/mellanox/mlxsw/minimal.c | 5 +++-- + drivers/net/ethernet/mellanox/mlxsw/minimal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c -index 504db124ee2f..8cc969758f2f 100644 +index 504db124e..8cc969758 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c @@ -127,8 +127,9 @@ static int mlxsw_m_fw_rev_validate(struct mlxsw_m *mlxsw_m) @@ -28,6 +29,3 @@ index 504db124ee2f..8cc969758f2f 100644 return 0; dev_info(mlxsw_m->bus_info->dev, "The firmware version %d.%d.%d is incompatible with the driver (required >= %d.%d.%d)\n", --- -2.20.1 - diff --git a/patch/0004-mlxsw-core-Add-the-hottest-thermal-zone-detection.patch b/patch/0004-mlxsw-core-Add-the-hottest-thermal-zone-detection.patch index e8ea2829c1c2..c2c4a32381ca 100644 --- a/patch/0004-mlxsw-core-Add-the-hottest-thermal-zone-detection.patch +++ b/patch/0004-mlxsw-core-Add-the-hottest-thermal-zone-detection.patch @@ -1,6 +1,7 @@ From 835fc5247dc6c3991fcc1bfbbb5cfa05db613cbc Mon Sep 17 00:00:00 2001 + From: Vadim Pasternak -Date: Wed, 7 Aug 2019 09:59:48 +0000 + Subject: [PATCH 5.3 backport 3/3] mlxsw: core: Add the hottest thermal zone detection @@ -36,11 +37,11 @@ All the thermal zones initially are to be configured with mode Signed-off-by: Vadim Pasternak --- - drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 55 ++++++++++++++++++++++ + drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 55 ++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -index 17a340aa9f75..8f5850445cab 100644 +index b75372998..e4343bf11 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -23,6 +23,7 @@ @@ -51,7 +52,7 @@ index 17a340aa9f75..8f5850445cab 100644 #define MLXSW_THERMAL_MAX_STATE 10 #define MLXSW_THERMAL_MAX_DUTY 255 /* Minimum and maximum fan allowed speed in percent: from 20% to 100%. Values -@@ -200,6 +201,34 @@ mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core, +@@ -201,6 +202,34 @@ mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core, return 0; } @@ -86,7 +87,7 @@ index 17a340aa9f75..8f5850445cab 100644 static int mlxsw_thermal_bind(struct thermal_zone_device *tzdev, struct thermal_cooling_device *cdev) { -@@ -295,6 +324,9 @@ static int mlxsw_thermal_get_temp(struct thermal_zone_device *tzdev, +@@ -302,6 +331,9 @@ static int mlxsw_thermal_get_temp(struct thermal_zone_device *tzdev, return err; } mlxsw_reg_mtmp_unpack(mtmp_pl, &temp, NULL, NULL); @@ -96,7 +97,7 @@ index 17a340aa9f75..8f5850445cab 100644 *p_temp = temp; return 0; -@@ -356,6 +388,22 @@ static int mlxsw_thermal_set_trip_hyst(struct thermal_zone_device *tzdev, +@@ -363,6 +395,22 @@ static int mlxsw_thermal_set_trip_hyst(struct thermal_zone_device *tzdev, return 0; } @@ -119,7 +120,7 @@ index 17a340aa9f75..8f5850445cab 100644 struct thermal_zone_params mlxsw_thermal_params = { .no_hwmon = true, }; -@@ -367,6 +415,7 @@ static struct thermal_zone_device_ops mlxsw_thermal_ops = { +@@ -378,6 +426,7 @@ static struct thermal_zone_device_ops mlxsw_thermal_ops = { .set_trip_temp = mlxsw_thermal_set_trip_temp, .get_trip_hyst = mlxsw_thermal_get_trip_hyst, .set_trip_hyst = mlxsw_thermal_set_trip_hyst, @@ -127,7 +128,7 @@ index 17a340aa9f75..8f5850445cab 100644 }; static int mlxsw_thermal_module_bind(struct thermal_zone_device *tzdev, -@@ -478,6 +527,8 @@ static int mlxsw_thermal_module_temp_get(struct thermal_zone_device *tzdev, +@@ -495,6 +544,8 @@ static int mlxsw_thermal_module_temp_get(struct thermal_zone_device *tzdev, /* Update trip points. */ err = mlxsw_thermal_module_trips_update(dev, thermal->core, tz); @@ -136,7 +137,7 @@ index 17a340aa9f75..8f5850445cab 100644 return 0; } -@@ -553,6 +604,7 @@ static struct thermal_zone_device_ops mlxsw_thermal_module_ops = { +@@ -570,6 +621,7 @@ static struct thermal_zone_device_ops mlxsw_thermal_module_ops = { .set_trip_temp = mlxsw_thermal_module_trip_temp_set, .get_trip_hyst = mlxsw_thermal_module_trip_hyst_get, .set_trip_hyst = mlxsw_thermal_module_trip_hyst_set, @@ -144,7 +145,7 @@ index 17a340aa9f75..8f5850445cab 100644 }; static int mlxsw_thermal_gearbox_temp_get(struct thermal_zone_device *tzdev, -@@ -573,6 +625,8 @@ static int mlxsw_thermal_gearbox_temp_get(struct thermal_zone_device *tzdev, +@@ -596,6 +648,8 @@ static int mlxsw_thermal_gearbox_temp_get(struct thermal_zone_device *tzdev, return err; mlxsw_reg_mtmp_unpack(mtmp_pl, &temp, NULL, NULL); @@ -153,7 +154,7 @@ index 17a340aa9f75..8f5850445cab 100644 *p_temp = temp; return 0; -@@ -589,6 +643,7 @@ static struct thermal_zone_device_ops mlxsw_thermal_gearbox_ops = { +@@ -612,6 +666,7 @@ static struct thermal_zone_device_ops mlxsw_thermal_gearbox_ops = { .set_trip_temp = mlxsw_thermal_module_trip_temp_set, .get_trip_hyst = mlxsw_thermal_module_trip_hyst_get, .set_trip_hyst = mlxsw_thermal_module_trip_hyst_set, @@ -161,6 +162,3 @@ index 17a340aa9f75..8f5850445cab 100644 }; static int mlxsw_thermal_get_max_state(struct thermal_cooling_device *cdev, --- -2.11.0 - diff --git a/patch/0005-hwmon-pmbus-core-Add-support-for-vid-mode-detection-.patch b/patch/0005-hwmon-pmbus-core-Add-support-for-vid-mode-detection-.patch index 71d18ca9afc3..afe957b0c256 100644 --- a/patch/0005-hwmon-pmbus-core-Add-support-for-vid-mode-detection-.patch +++ b/patch/0005-hwmon-pmbus-core-Add-support-for-vid-mode-detection-.patch @@ -1,8 +1,8 @@ -From 5766c21f1bb28b43048f188195e8bae90163049c Mon Sep 17 00:00:00 2001 +From 7b4746d925e3173141005f414a239224bd765488 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak -Date: Thu, 12 Mar 2020 17:17:25 +0200 -Subject: [PATCH] hwmon: (pmbus/core) Add support for vid mode detection per - page bases +Date: Mon, 29 Jun 2020 19:05:59 +0300 +Subject: [backport 04/12] hwmon: (pmbus/core) Add support for vid mode + detection per page bases Add support for VID protocol detection per page bases, instead of detecting it based on PMBU_VOUT readout from page 0. @@ -22,29 +22,26 @@ VR12.0 mode, 5-mV DAC - 0x01; VR12.5 mode, 10-mV DAC - 0x02; IMVP9 mode, 5-mV DAC - 0x03; AMD mode 6.25mV - 0x10. - -Signed-off-by: Vadim Pasternak -Signed-off-by: Stephen Sun --- - drivers/hwmon/pmbus/Kconfig | 9 ++ - drivers/hwmon/pmbus/Makefile | 1 + - drivers/hwmon/pmbus/max20751.c | 2 +- - drivers/hwmon/pmbus/pmbus.c | 5 +- - drivers/hwmon/pmbus/pmbus.h | 4 +- - drivers/hwmon/pmbus/pmbus_core.c | 10 +- - drivers/hwmon/pmbus/tps53679.c | 44 ++--- - drivers/hwmon/pmbus/xdpe12284.c | 171 ++++++++++++++++++++ - 8 files changed, 222 insertions(+), 29 deletions(-) + drivers/hwmon/pmbus/Kconfig | 9 +++ + drivers/hwmon/pmbus/Makefile | 1 + + drivers/hwmon/pmbus/max20751.c | 2 +- + drivers/hwmon/pmbus/pmbus.c | 5 +- + drivers/hwmon/pmbus/pmbus.h | 4 +- + drivers/hwmon/pmbus/pmbus_core.c | 10 ++- + drivers/hwmon/pmbus/tps53679.c | 44 +++++----- + drivers/hwmon/pmbus/xdpe12284.c | 171 +++++++++++++++++++++++++++++++++++++++ + 8 files changed, 219 insertions(+), 27 deletions(-) create mode 100644 drivers/hwmon/pmbus/xdpe12284.c diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig -index 505ca2be0..eda871222 100644 +index a82018a..14c0572 100644 --- a/drivers/hwmon/pmbus/Kconfig +++ b/drivers/hwmon/pmbus/Kconfig -@@ -196,6 +196,15 @@ config SENSORS_UCD9200 +@@ -186,6 +186,15 @@ config SENSORS_UCD9200 This driver can also be built as a module. If so, the module will be called ucd9200. - + +config SENSORS_XDPE122 + tristate "Infineon XDPE122 family" + help @@ -58,18 +55,17 @@ index 505ca2be0..eda871222 100644 tristate "Intersil ZL6100 and compatibles" default n diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile -index c76820a4d..edc7c315c 100644 +index ea0e395..8c8edb5 100644 --- a/drivers/hwmon/pmbus/Makefile +++ b/drivers/hwmon/pmbus/Makefile -@@ -21,5 +21,6 @@ obj-$(CONFIG_SENSORS_TPS40422) += tps40422.o +@@ -20,4 +20,5 @@ obj-$(CONFIG_SENSORS_TPS40422) += tps40422.o obj-$(CONFIG_SENSORS_TPS53679) += tps53679.o obj-$(CONFIG_SENSORS_UCD9000) += ucd9000.o obj-$(CONFIG_SENSORS_UCD9200) += ucd9200.o +obj-$(CONFIG_SENSORS_XDPE122) += xdpe12284.o obj-$(CONFIG_SENSORS_ZL6100) += zl6100.o - obj-$(CONFIG_SENSORS_DPS1900) += dps1900.o diff --git a/drivers/hwmon/pmbus/max20751.c b/drivers/hwmon/pmbus/max20751.c -index ab74aeae8..394c662c8 100644 +index ab74aea..394c662 100644 --- a/drivers/hwmon/pmbus/max20751.c +++ b/drivers/hwmon/pmbus/max20751.c @@ -25,7 +25,7 @@ static struct pmbus_driver_info max20751_info = { @@ -82,16 +78,16 @@ index ab74aeae8..394c662c8 100644 .format[PSC_CURRENT_OUT] = linear, .format[PSC_POWER] = linear, diff --git a/drivers/hwmon/pmbus/pmbus.c b/drivers/hwmon/pmbus/pmbus.c -index 7688dab32..4db0400b7 100644 +index 7688dab..4db0400 100644 --- a/drivers/hwmon/pmbus/pmbus.c +++ b/drivers/hwmon/pmbus/pmbus.c @@ -123,7 +123,7 @@ static int pmbus_identify(struct i2c_client *client, } - + if (pmbus_check_byte_register(client, 0, PMBUS_VOUT_MODE)) { - int vout_mode; + int vout_mode, i; - + vout_mode = pmbus_read_byte_data(client, 0, PMBUS_VOUT_MODE); if (vout_mode >= 0 && vout_mode != 0xff) { @@ -132,7 +132,8 @@ static int pmbus_identify(struct i2c_client *client, @@ -105,16 +101,16 @@ index 7688dab32..4db0400b7 100644 case 2: info->format[PSC_VOLTAGE_OUT] = direct; diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h -index 1d24397d3..5481ff9f8 100644 +index 1d24397..5481ff9 100644 --- a/drivers/hwmon/pmbus/pmbus.h +++ b/drivers/hwmon/pmbus/pmbus.h @@ -375,12 +375,12 @@ enum pmbus_sensor_classes { #define PMBUS_PAGE_VIRTUAL BIT(31) - + enum pmbus_data_format { linear = 0, direct, vid }; -enum vrm_version { vr11 = 0, vr12, vr13 }; +enum vrm_version { vr11 = 0, vr12, vr13, imvp9, amd625mv }; - + struct pmbus_driver_info { int pages; /* Total number of pages */ enum pmbus_data_format format[PSC_NUM_CLASSES]; @@ -124,13 +120,13 @@ index 1d24397d3..5481ff9f8 100644 * Support one set of coefficients for each sensor type * Used for chips providing data in direct mode. diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c -index cd24b375d..1d7f950e6 100644 +index cd24b37..1d7f950 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c @@ -709,7 +709,7 @@ static long pmbus_reg2data_vid(struct pmbus_data *data, long val = sensor->data; long rv = 0; - + - switch (data->info->vrm_version) { + switch (data->info->vrm_version[sensor->page]) { case vr11: @@ -152,7 +148,7 @@ index cd24b375d..1d7f950e6 100644 return rv; } diff --git a/drivers/hwmon/pmbus/tps53679.c b/drivers/hwmon/pmbus/tps53679.c -index 45eacc504..28d3de029 100644 +index 2bc352c..0a30101 100644 --- a/drivers/hwmon/pmbus/tps53679.c +++ b/drivers/hwmon/pmbus/tps53679.c @@ -33,27 +33,29 @@ static int tps53679_identify(struct i2c_client *client, @@ -204,11 +200,11 @@ index 45eacc504..28d3de029 100644 + return -EINVAL; + } } - + return 0; diff --git a/drivers/hwmon/pmbus/xdpe12284.c b/drivers/hwmon/pmbus/xdpe12284.c new file mode 100644 -index 000000000..660556b89 +index 0000000..660556b --- /dev/null +++ b/drivers/hwmon/pmbus/xdpe12284.c @@ -0,0 +1,171 @@ @@ -383,6 +379,6 @@ index 000000000..660556b89 +MODULE_AUTHOR("Vadim Pasternak "); +MODULE_DESCRIPTION("PMBus driver for Infineon XDPE122 family"); +MODULE_LICENSE("GPL"); --- -2.20.1 +-- +2.11.0 diff --git a/patch/0006-platform-mellanox-mlxreg-hotplug-Use-capability-r.patch b/patch/0006-platform-mellanox-mlxreg-hotplug-Use-capability-r.patch index 3de055dbb667..3fddfde2a464 100644 --- a/patch/0006-platform-mellanox-mlxreg-hotplug-Use-capability-r.patch +++ b/patch/0006-platform-mellanox-mlxreg-hotplug-Use-capability-r.patch @@ -1,6 +1,7 @@ From af50fedeeaa767a0c7c3a9cf399fe23314adc609 Mon Sep 17 00:00:00 2001 + From: Vadim Pasternak -Date: Thu, 12 Mar 2020 23:51:41 +0200 + Subject: [platform-next v1 1/2] platform/mellanox: mlxreg-hotplug: Use capability register for attribute creation @@ -14,11 +15,11 @@ components like power supplies, FANs, ASICs, line cards. Signed-off-by: Vadim Pasternak --- - drivers/platform/mellanox/mlxreg-hotplug.c | 23 +++++++++++++++++++---- + drivers/platform/mellanox/mlxreg-hotplug.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c -index 77be37a1fbcf..c21754821789 100644 +index 77be37a1f..c21754821 100644 --- a/drivers/platform/mellanox/mlxreg-hotplug.c +++ b/drivers/platform/mellanox/mlxreg-hotplug.c @@ -196,17 +196,29 @@ static int mlxreg_hotplug_attr_init(struct mlxreg_hotplug_priv_data *priv) @@ -68,6 +69,3 @@ index 77be37a1fbcf..c21754821789 100644 } priv->group.attrs = devm_kcalloc(&priv->pdev->dev, --- -2.11.0 - diff --git a/patch/0007-mlxsw-core-thermal-Set-default-thermal-trips-at-init.patch b/patch/0007-mlxsw-core-thermal-Set-default-thermal-trips-at-init.patch index be45a58e8065..8be9d97ee926 100644 --- a/patch/0007-mlxsw-core-thermal-Set-default-thermal-trips-at-init.patch +++ b/patch/0007-mlxsw-core-thermal-Set-default-thermal-trips-at-init.patch @@ -1,6 +1,7 @@ From d1bfc3dfb848ea1b402e2299b1e3b974aad9be60 Mon Sep 17 00:00:00 2001 + From: Vadim Pasternak -Date: Tue, 31 Mar 2020 22:50:02 +0300 + Subject: [backport 1/2] mlxsw: core: thermal: Set default thermal trips at initialization @@ -11,11 +12,11 @@ thermal algorithm. Signed-off-by: Vadim Pasternak --- - drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 12 ++++++++---- + drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c -index b75372998..fc0264f2f 100644 +index e4343bf11..77578f5bb 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -20,6 +20,10 @@ @@ -29,7 +30,7 @@ index b75372998..fc0264f2f 100644 #define MLXSW_THERMAL_HYSTERESIS_TEMP 5000 /* 5C */ #define MLXSW_THERMAL_MODULE_TEMP_SHIFT (MLXSW_THERMAL_HYSTERESIS_TEMP * 2) #define MLXSW_THERMAL_ZONE_MAX_NAME 16 -@@ -153,10 +157,10 @@ static int mlxsw_get_cooling_device_idx(struct mlxsw_thermal *thermal, +@@ -154,10 +158,10 @@ static int mlxsw_get_cooling_device_idx(struct mlxsw_thermal *thermal, static void mlxsw_thermal_module_trips_reset(struct mlxsw_thermal_module *tz) { @@ -44,6 +45,3 @@ index b75372998..fc0264f2f 100644 } static int --- -2.20.1 - diff --git a/patch/0008-mlxsw-qsfp_sysfs-Remove-obsolete-code-for-QSFP-EEPRO.patch b/patch/0008-mlxsw-qsfp_sysfs-Remove-obsolete-code-for-QSFP-EEPRO.patch index dde7af7b22f7..fa819c5d59a7 100644 --- a/patch/0008-mlxsw-qsfp_sysfs-Remove-obsolete-code-for-QSFP-EEPRO.patch +++ b/patch/0008-mlxsw-qsfp_sysfs-Remove-obsolete-code-for-QSFP-EEPRO.patch @@ -1,6 +1,7 @@ From 148312b80f5285b25140a72cf3d4671e3486dcd2 Mon Sep 17 00:00:00 2001 + From: Vadim Pasternak -Date: Tue, 31 Mar 2020 23:01:41 +0300 + Subject: [backport 2/2] mlxsw: qsfp_sysfs: Remove obsolete code for QSFP EEPROM reading @@ -11,8 +12,8 @@ Make de-init order symmetrical with init. . Signed-off-by: Vadim Pasternak --- - drivers/net/ethernet/mellanox/mlxsw/core.c | 4 +- - .../net/ethernet/mellanox/mlxsw/qsfp_sysfs.c | 299 +----------------- + drivers/net/ethernet/mellanox/mlxsw/core.c | 4 + drivers/net/ethernet/mellanox/mlxsw/qsfp_sysfs.c | 299 +--------------------- 2 files changed, 13 insertions(+), 290 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -406,6 +407,3 @@ index 49563a703..931dbd58e 100644 } MODULE_LICENSE("Dual BSD/GPL"); --- -2.20.1 - diff --git a/patch/0009-platform-mellanox-mlxreg-io-Add-support-for-compl.patch b/patch/0009-platform-mellanox-mlxreg-io-Add-support-for-compl.patch index 6fa77d02f4f9..019decceae1b 100644 --- a/patch/0009-platform-mellanox-mlxreg-io-Add-support-for-compl.patch +++ b/patch/0009-platform-mellanox-mlxreg-io-Add-support-for-compl.patch @@ -1,6 +1,7 @@ From f0b3ddaafa62a2d36ce88bf369dfaf8b8efb7c6b Mon Sep 17 00:00:00 2001 + From: Vadim Pasternak -Date: Wed, 1 Apr 2020 02:20:21 +0300 + Subject: [backport] platform/mellanox: mlxreg-io: Add support for complex attributes @@ -13,10 +14,10 @@ or FPGA versioning, power consuming info, etcetera. Signed-off-by: Vadim Pasternak --- - drivers/platform/mellanox/mlxreg-hotplug.c | 31 ++--- - drivers/platform/mellanox/mlxreg-io.c | 54 +++++++-- - drivers/platform/x86/mlx-platform.c | 128 +++++++++++++++++++++ - include/linux/platform_data/mlxreg.h | 2 + + drivers/platform/mellanox/mlxreg-hotplug.c | 31 ++++--- + drivers/platform/mellanox/mlxreg-io.c | 54 +++++++++--- + drivers/platform/x86/mlx-platform.c | 128 ++++++++++++++++++++++++++++ + include/linux/platform_data/mlxreg.h | 2 4 files changed, 189 insertions(+), 26 deletions(-) diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c @@ -183,7 +184,7 @@ index acfaf64ff..cc7b78301 100644 err = mlxreg_io_attr_init(priv); if (err) { diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index c27548fd3..034736cec 100644 +index f5d70d67f..7fac80615 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -26,6 +26,10 @@ @@ -397,6 +398,3 @@ index b8da8aef2..a2adc3ad4 100644 }; /** --- -2.20.1 - diff --git a/patch/0010-platform-mellanox-mlxreg-hotplug-Add-environmental-d.patch b/patch/0010-platform-mellanox-mlxreg-hotplug-Add-environmental-d.patch index 6dc5175c4786..36db054ab133 100644 --- a/patch/0010-platform-mellanox-mlxreg-hotplug-Add-environmental-d.patch +++ b/patch/0010-platform-mellanox-mlxreg-hotplug-Add-environmental-d.patch @@ -1,6 +1,7 @@ From 11d848d48f9a2eb7b0466c1dddf07684c4691012 Mon Sep 17 00:00:00 2001 + From: Vadim Pasternak -Date: Thu, 9 Apr 2020 12:41:01 +0300 + Subject: [backport] platform/mellanox: mlxreg-hotplug: Add environmental data to uevent @@ -9,7 +10,7 @@ Send "udev" event with environmental data in order to allow handling Signed-off-by: Vadim Pasternak --- - drivers/platform/mellanox/mlxreg-hotplug.c | 28 ++++++++++++++++++++++++++-- + drivers/platform/mellanox/mlxreg-hotplug.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c @@ -71,6 +72,3 @@ index 832fcf282..3e99ad9fe 100644 if (data->hpdev.client) { i2c_unregister_device(data->hpdev.client); --- -2.11.0 - diff --git a/patch/0011-mlxsw-core-thermal-Separate-temperature-trend-read-c.patch b/patch/0011-mlxsw-core-thermal-Separate-temperature-trend-read-c.patch index a9fd8f3ebdc2..e941d3526b7b 100644 --- a/patch/0011-mlxsw-core-thermal-Separate-temperature-trend-read-c.patch +++ b/patch/0011-mlxsw-core-thermal-Separate-temperature-trend-read-c.patch @@ -1,6 +1,7 @@ From b3fb34f9f6215e0677de88e07f2139b56ba7508f Mon Sep 17 00:00:00 2001 + From: Vadim Pasternak -Date: Thu, 21 May 2020 13:34:17 +0300 + Subject: [backport 4.19 2/3] mlxsw: core: thermal: Separate temperature trend read callback @@ -17,7 +18,7 @@ add new get_trend() callback for chip. Signed-off-by: Vadim Pasternak --- - drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 23 ++++++++++++++++++---- + drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 23 +++++++++++++++++--- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -75,6 +76,3 @@ index 77578f5bb..775343a25 100644 }; static int mlxsw_thermal_get_max_state(struct thermal_cooling_device *cdev, --- -2.11.0 - diff --git a/patch/0012-Add-support-for-new-transceivers-types-QSFP-DD-and-Q.patch b/patch/0012-Add-support-for-new-transceivers-types-QSFP-DD-and-Q.patch index e60c1df84627..a80cd23728d4 100644 --- a/patch/0012-Add-support-for-new-transceivers-types-QSFP-DD-and-Q.patch +++ b/patch/0012-Add-support-for-new-transceivers-types-QSFP-DD-and-Q.patch @@ -1,6 +1,7 @@ From abc748c3e12290443c4ec95aed11b59bf4c948f3 Mon Sep 17 00:00:00 2001 + From: Vadim Pasternak -Date: Thu, 7 May 2020 15:05:12 +0300 + Subject: [backport] Add support for new transceivers types: QSFP-DD and QSFP+ with Common Management Interface Specification (CMIS). @@ -13,8 +14,8 @@ The QSFP-DD supports both optical and copper interfaces. Signed-off-by: Vadim Pasternak --- - drivers/net/ethernet/mellanox/mlxsw/core_env.c | 71 +++++++++++++++++++------- - drivers/net/ethernet/mellanox/mlxsw/reg.h | 2 + + drivers/net/ethernet/mellanox/mlxsw/core_env.c | 71 ++++++++++++++++++------ + drivers/net/ethernet/mellanox/mlxsw/reg.h | 2 + 2 files changed, 54 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_env.c b/drivers/net/ethernet/mellanox/mlxsw/core_env.c @@ -218,6 +219,3 @@ index 7ca981464..a5952a03f 100644 MLXSW_REG_MCIA_EEPROM_MODULE_INFO_SIZE, }; --- -2.11.0 - diff --git a/patch/0013-watchdog-mlx-wdt-support-new-watchdog-type-with-long.patch b/patch/0013-watchdog-mlx-wdt-support-new-watchdog-type-with-long.patch index fbf7e83ffe5d..8d7a175fc4d0 100644 --- a/patch/0013-watchdog-mlx-wdt-support-new-watchdog-type-with-long.patch +++ b/patch/0013-watchdog-mlx-wdt-support-new-watchdog-type-with-long.patch @@ -1,6 +1,7 @@ From cbe97c15b2688abef8745977e85e13dbf1bfc3e8 Mon Sep 17 00:00:00 2001 + From: Michael Shych -Date: Sun, 24 May 2020 13:15:07 +0300 + Subject: [new watchdog type 1/1] watchdog: mlx-wdt: support new watchdog type with longer timeout period platform_data/mlxreg: support new watchdog type with longer timeout period platform/x86: mlx-platform: support new watchdog @@ -14,13 +15,13 @@ It is differentiated by WD capability bit. Signed-off-by: Michael Shych --- - drivers/platform/x86/mlx-platform.c | 106 +++++++++++++++++++++++++++++++++++ - drivers/watchdog/mlx_wdt.c | 86 ++++++++++++++++++++++------ - include/linux/platform_data/mlxreg.h | 5 +- + drivers/platform/x86/mlx-platform.c | 106 ++++++++++++++++++++++++++++++++++ + drivers/watchdog/mlx_wdt.c | 86 ++++++++++++++++++++++------ + include/linux/platform_data/mlxreg.h | 5 +- 3 files changed, 179 insertions(+), 18 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c -index 034736cec..208f4a476 100644 +index 7fac80615..97f60b045 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -186,7 +186,9 @@ @@ -129,7 +130,7 @@ index 034736cec..208f4a476 100644 case MLXPLAT_CPLD_LPC_REG_WD3_ACT_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM1_OFFSET: case MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET: -@@ -2729,6 +2811,27 @@ static int mlxplat_mlxcpld_verify_bus_topology(int *nr) +@@ -2622,6 +2704,27 @@ static int mlxplat_mlxcpld_verify_bus_topology(int *nr) return 0; } @@ -157,7 +158,7 @@ index 034736cec..208f4a476 100644 static int __init mlxplat_init(void) { struct mlxplat_priv *priv; -@@ -2861,6 +2964,9 @@ static int __init mlxplat_init(void) +@@ -2754,6 +2857,9 @@ static int __init mlxplat_init(void) } /* Add WD drivers. */ @@ -369,6 +370,3 @@ index a2adc3ad4..03d768d73 100644 bool attached; u8 regnum; }; --- -2.11.0 - diff --git a/patch/driver-iommu-fix-amd-iommu-off.patch b/patch/driver-iommu-fix-amd-iommu-off.patch deleted file mode 100644 index 6be23bfb1e06..000000000000 --- a/patch/driver-iommu-fix-amd-iommu-off.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 3ddbe913e55516d3e2165d43d4d5570761769878 Mon Sep 17 00:00:00 2001 -From: Kevin Mitchell -Date: Wed, 12 Jun 2019 14:52:03 -0700 -Subject: [PATCH] iommu/amd: Make iommu_disable safer - -Make it safe to call iommu_disable during early init error conditions -before mmio_base is set, but after the struct amd_iommu has been added -to the amd_iommu_list. For example, this happens if firmware fails to -fill in mmio_phys in the ACPI table leading to a NULL pointer -dereference in iommu_feature_disable. - -Fixes: 2c0ae1720c09c ('iommu/amd: Convert iommu initialization to state machine') -Signed-off-by: Kevin Mitchell -Signed-off-by: Joerg Roedel ---- - drivers/iommu/amd_iommu_init.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c -index f977df90d2a491..df144dc6d8aca2 100644 ---- a/drivers/iommu/amd_iommu_init.c -+++ b/drivers/iommu/amd_iommu_init.c -@@ -418,6 +418,9 @@ static void iommu_enable(struct amd_iommu *iommu) - - static void iommu_disable(struct amd_iommu *iommu) - { -+ if (!iommu->mmio_base) -+ return; -+ - /* Disable command buffer */ - iommu_feature_disable(iommu, CONTROL_CMDBUF_EN); - diff --git a/patch/net-backport-ipv6-missing-route.patch b/patch/net-backport-ipv6-missing-route.patch deleted file mode 100644 index 2e5b279dda38..000000000000 --- a/patch/net-backport-ipv6-missing-route.patch +++ /dev/null @@ -1,39 +0,0 @@ -The below patch has been backported to fix "ipv6: Handle missing host route in __ipv6_ifa_notify" - -https://github.com/torvalds/linux/commit/2d819d250a1393a3e725715425ab70a0e0772a71#diff-0907850728440370acc820310df76f30 - -From: Arun Saravanan Balachandran ---- - net/ipv6/addrconf.c | 17 ++++++++++++----- - 1 file changed, 12 insertions(+), 5 deletions(-) - -diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c -index c57efd5c5..ea68ecb0a 100644 ---- a/net/ipv6/addrconf.c -+++ b/net/ipv6/addrconf.c -@@ -5677,13 +5677,20 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) - switch (event) { - case RTM_NEWADDR: - /* -- * If the address was optimistic -- * we inserted the route at the start of -- * our DAD process, so we don't need -- * to do it again -+ * If the address was optimistic we inserted the route at the -+ * start of our DAD process, so we don't need to do it again. -+ * If the device was taken down in the middle of the DAD -+ * cycle there is a race where we could get here without a -+ * host route, so nothing to insert. That will be fixed when -+ * the device is brought up. - */ -- if (!rcu_access_pointer(ifp->rt->fib6_node)) -+ if (ifp->rt && !rcu_access_pointer(ifp->rt->fib6_node)) { - ip6_ins_rt(net, ifp->rt); -+ } else if (!ifp->rt && (ifp->idev->dev->flags & IFF_UP)) { -+ pr_warn("BUG: Address %pI6c on device %s is missing its host route.\n", -+ &ifp->addr, ifp->idev->dev->name); -+ } -+ - if (ifp->idev->cnf.forwarding) - addrconf_join_anycast(ifp); - if (!ipv6_addr_any(&ifp->peer_addr)) diff --git a/patch/net-fix-skb-csum-update-in-inet_proto_csum_replace16.patch b/patch/net-fix-skb-csum-update-in-inet_proto_csum_replace16.patch deleted file mode 100644 index aa6b10672ed4..000000000000 --- a/patch/net-fix-skb-csum-update-in-inet_proto_csum_replace16.patch +++ /dev/null @@ -1,56 +0,0 @@ -skb->csum is updated incorrectly, when manipulation for NF_NAT_MANIP_SRC\DST -is done on IPV6 packet. - -Fix: -There is no need to update skb->csum in inet_proto_csum_replace16(), because -update in two fields a.) IPv6 src/dst address and b.) L4 header checksum -cancels each other for skb->csum calculation. -Whereas inet_proto_csum_replace4 function needs to update skb->csum, -because update in 3 fields a.) IPv4 src/dst address, b.) IPv4 Header checksum -and c.) L4 header checksum results in same diff as L4 Header checksum for -skb->csum calculation. - -Signed-off-by: Praveen Chaudhary -Signed-off-by: Zhenggen Xu -Signed-off-by: Andy Stracner - -Reviewed-by: Florian Westphal ---- -diff --git a/net/core/utils.c b/net/core/utils.c -index cf5622b..3317f90 100644 ---- a/net/core/utils.c -+++ b/net/core/utils.c -@@ -316,6 +316,23 @@ void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb, - } - EXPORT_SYMBOL(inet_proto_csum_replace4); - -+/** -+ * inet_proto_csum_replace16 - update layer 4 header checksum field -+ * @sum: Layer 4 header checksum field -+ * @skb: sk_buff for the packet -+ * @from: old IPv6 address -+ * @to: new IPv6 address -+ * @pseudohdr: True if layer 4 header checksum includes pseudoheader -+ * -+ * Update layer 4 header as per the update in IPv6 src/dst address. -+ * -+ * There is no need to update skb->csum in this function, because update in two -+ * fields a.) IPv6 src/dst address and b.) L4 header checksum cancels each other -+ * for skb->csum calculation. Whereas inet_proto_csum_replace4 function needs to -+ * update skb->csum, because update in 3 fields a.) IPv4 src/dst address, -+ * b.) IPv4 Header checksum and c.) L4 header checksum results in same diff as -+ * L4 Header checksum for skb->csum calculation. -+ */ - void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, - const __be32 *from, const __be32 *to, - bool pseudohdr) -@@ -327,9 +344,6 @@ void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, - if (skb->ip_summed != CHECKSUM_PARTIAL) { - *sum = csum_fold(csum_partial(diff, sizeof(diff), - ~csum_unfold(*sum))); -- if (skb->ip_summed == CHECKSUM_COMPLETE && pseudohdr) -- skb->csum = ~csum_partial(diff, sizeof(diff), -- ~skb->csum); - } else if (pseudohdr) - *sum = ~csum_fold(csum_partial(diff, sizeof(diff), - csum_unfold(*sum))); diff --git a/patch/net-psample-fix-skb-over-panic.patch b/patch/net-psample-fix-skb-over-panic.patch deleted file mode 100644 index b8b996c32f7c..000000000000 --- a/patch/net-psample-fix-skb-over-panic.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 7eb9d7675c08937cd11d32b0b40442d4d731c5ee Mon Sep 17 00:00:00 2001 - -From: Nikolay Aleksandrov - -Subject: [PATCH] net: psample: fix skb_over_panic - -We need to calculate the skb size correctly otherwise we risk triggering -skb_over_panic[1]. The issue is that data_len is added to the skb in a -nl attribute, but we don't account for its header size (nlattr 4 bytes) -and alignment. We account for it when calculating the total size in -the > PSAMPLE_MAX_PACKET_SIZE comparison correctly, but not when -allocating after that. The fix is simple - use nla_total_size() for -data_len when allocating. - -To reproduce: - $ tc qdisc add dev eth1 clsact - $ tc filter add dev eth1 egress matchall action sample rate 1 group 1 trunc 129 - $ mausezahn eth1 -b bcast -a rand -c 1 -p 129 - < skb_over_panic BUG(), tail is 4 bytes past skb->end > - -[1] Trace: - [ 50.459526][ T3480] skbuff: skb_over_panic: text:(____ptrval____) len:196 put:136 head:(____ptrval____) data:(____ptrval____) tail:0xc4 end:0xc0 dev: - [ 50.474339][ T3480] ------------[ cut here ]------------ - [ 50.481132][ T3480] kernel BUG at net/core/skbuff.c:108! - [ 50.486059][ T3480] invalid opcode: 0000 [#1] PREEMPT SMP - [ 50.489463][ T3480] CPU: 3 PID: 3480 Comm: mausezahn Not tainted 5.4.0-rc7 #108 - [ 50.492844][ T3480] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-2.fc30 04/01/2014 - [ 50.496551][ T3480] RIP: 0010:skb_panic+0x79/0x7b - [ 50.498261][ T3480] Code: bc 00 00 00 41 57 4c 89 e6 48 c7 c7 90 29 9a 83 4c 8b 8b c0 00 00 00 50 8b 83 b8 00 00 00 50 ff b3 c8 00 00 00 e8 ae ef c0 fe <0f> 0b e8 2f df c8 fe 48 8b 55 08 44 89 f6 4c 89 e7 48 c7 c1 a0 22 - [ 50.504111][ T3480] RSP: 0018:ffffc90000447a10 EFLAGS: 00010282 - [ 50.505835][ T3480] RAX: 0000000000000087 RBX: ffff888039317d00 RCX: 0000000000000000 - [ 50.507900][ T3480] RDX: 0000000000000000 RSI: ffffffff812716e1 RDI: 00000000ffffffff - [ 50.509820][ T3480] RBP: ffffc90000447a60 R08: 0000000000000001 R09: 0000000000000000 - [ 50.511735][ T3480] R10: ffffffff81d4f940 R11: 0000000000000000 R12: ffffffff834a22b0 - [ 50.513494][ T3480] R13: ffffffff82c10433 R14: 0000000000000088 R15: ffffffff838a8084 - [ 50.515222][ T3480] FS: 00007f3536462700(0000) GS:ffff88803eac0000(0000) knlGS:0000000000000000 - [ 50.517135][ T3480] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 - [ 50.518583][ T3480] CR2: 0000000000442008 CR3: 000000003b222000 CR4: 00000000000006e0 - [ 50.520723][ T3480] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 - [ 50.522709][ T3480] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 - [ 50.524450][ T3480] Call Trace: - [ 50.525214][ T3480] skb_put.cold+0x1b/0x1b - [ 50.526171][ T3480] psample_sample_packet+0x1d3/0x340 - [ 50.527307][ T3480] tcf_sample_act+0x178/0x250 - [ 50.528339][ T3480] tcf_action_exec+0xb1/0x190 - [ 50.529354][ T3480] mall_classify+0x67/0x90 - [ 50.530332][ T3480] tcf_classify+0x72/0x160 - [ 50.531286][ T3480] __dev_queue_xmit+0x3db/0xd50 - [ 50.532327][ T3480] dev_queue_xmit+0x18/0x20 - [ 50.533299][ T3480] packet_sendmsg+0xee7/0x2090 - [ 50.534331][ T3480] sock_sendmsg+0x54/0x70 - [ 50.535271][ T3480] __sys_sendto+0x148/0x1f0 - [ 50.536252][ T3480] ? tomoyo_file_ioctl+0x23/0x30 - [ 50.537334][ T3480] ? ksys_ioctl+0x5e/0xb0 - [ 50.540068][ T3480] __x64_sys_sendto+0x2a/0x30 - [ 50.542810][ T3480] do_syscall_64+0x73/0x1f0 - [ 50.545383][ T3480] entry_SYSCALL_64_after_hwframe+0x44/0xa9 - [ 50.548477][ T3480] RIP: 0033:0x7f35357d6fb3 - [ 50.551020][ T3480] Code: 48 8b 0d 18 90 20 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d f9 d3 20 00 00 75 13 49 89 ca b8 2c 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 34 c3 48 83 ec 08 e8 eb f6 ff ff 48 89 04 24 - [ 50.558547][ T3480] RSP: 002b:00007ffe0c7212c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c - [ 50.561870][ T3480] RAX: ffffffffffffffda RBX: 0000000001dac010 RCX: 00007f35357d6fb3 - [ 50.565142][ T3480] RDX: 0000000000000082 RSI: 0000000001dac2a2 RDI: 0000000000000003 - [ 50.568469][ T3480] RBP: 00007ffe0c7212f0 R08: 00007ffe0c7212d0 R09: 0000000000000014 - [ 50.571731][ T3480] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000082 - [ 50.574961][ T3480] R13: 0000000001dac2a2 R14: 0000000000000001 R15: 0000000000000003 - [ 50.578170][ T3480] Modules linked in: sch_ingress virtio_net - [ 50.580976][ T3480] ---[ end trace 61a515626a595af6 ]--- - -CC: Yotam Gigi -CC: Jiri Pirko -CC: Jamal Hadi Salim -CC: Simon Horman -CC: Roopa Prabhu -Fixes: 6ae0a6286171 ("net: Introduce psample, a new genetlink channel for packet sampling") -Signed-off-by: Nikolay Aleksandrov -Signed-off-by: David S. Miller ---- - net/psample/psample.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/psample/psample.c b/net/psample/psample.c -index 64f95624f..13314dea4 100644 ---- a/net/psample/psample.c -+++ b/net/psample/psample.c -@@ -223,7 +223,7 @@ void psample_sample_packet(struct psample_group *group, struct sk_buff *skb, - data_len = PSAMPLE_MAX_PACKET_SIZE - meta_len - NLA_HDRLEN - - NLA_ALIGNTO; - -- nl_skb = genlmsg_new(meta_len + data_len, GFP_ATOMIC); -+ nl_skb = genlmsg_new(meta_len + nla_total_size(data_len), GFP_ATOMIC); - if (unlikely(!nl_skb)) - return; - diff --git a/patch/preconfig/packaging-update-abiname-to-6-2.patch b/patch/preconfig/packaging-update-abiname-to-6-2.patch deleted file mode 100644 index ade93466035b..000000000000 --- a/patch/preconfig/packaging-update-abiname-to-6-2.patch +++ /dev/null @@ -1,30 +0,0 @@ -Update debian abiname to 6-2 - -From: Olivier Singla - - -diff --git a/debian/config/defines b/debian/config/defines -index 9c85fab..3563e79 100644 ---- a/debian/config/defines -+++ b/debian/config/defines -@@ -1,5 +1,5 @@ - [abi] --abiname: 6 -+abiname: 6-2 - ignore-changes: - __cpuhp_* - bpf_analyzer - -diff --git a/debian/control.md5sum b/debian/control.md5sum -index 594492a..3f598c8 100644 ---- a/debian/control.md5sum -+++ b/debian/control.md5sum -@@ -25,7 +25,7 @@ eda4623fb10d5ba1cefa8502ebaeb0fd debian/templates/control.image-dbg.in - 0c86e2579f89e94a6cd144eb98593a5b debian/templates/control.extra.in - fe4456d48e3218fb8980c8577d03a7ae debian/templates/control.config.in - 103ea5fb237e376b511ba638afc41837 debian/templates/control.headers.arch.in --55e418f2d36dd4465141b93d5901ca04 debian/config/defines -+cd65d8ea2035508cd6f5e4c205678aea debian/config/defines - 151f2a989308056668d9a162a321c32a debian/config/i386/defines - d08ab699e6a25ec0da4cb70efc0f2288 debian/config/ppc64el/defines - 32e264f468daa991fa1bafce9e1eee3c debian/config/mips64el/defines diff --git a/patch/preconfig/packaging-update-abiname.patch b/patch/preconfig/packaging-update-abiname.patch new file mode 100644 index 000000000000..80d54db51044 --- /dev/null +++ b/patch/preconfig/packaging-update-abiname.patch @@ -0,0 +1,34 @@ +Update debian abiname to 9-2 + +From: Olivier Singla + + +--- + debian/config/defines | 2 +- + debian/control.md5sum | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/debian/config/defines b/debian/config/defines +index 5b8562d43..9366229f0 100644 +--- a/debian/config/defines ++++ b/debian/config/defines +@@ -1,5 +1,5 @@ + [abi] +-abiname: 9 ++abiname: 9-2 + ignore-changes: + __cpuhp_* + bpf_analyzer +diff --git a/debian/control.md5sum b/debian/control.md5sum +index 085323e31..8f484283d 100644 +--- a/debian/control.md5sum ++++ b/debian/control.md5sum +@@ -25,7 +25,7 @@ afb508873a44a1f196c2a525fec4b415 debian/templates/image.prerm.in + 51797b6c275eb14e99009e78553904cc debian/templates/perf.lintian-overrides.in + 814dda166c7e3ef02e6e259e805ac66a debian/templates/tests-control.image.in + befa899554918fd2a5264e5dca3c4eef debian/templates/tests-control.main.in +-334fdefa84d0804cb0ec672010528eeb debian/config/defines ++7726b7cfcdd85592ccc92496068faca0 debian/config/defines + da871dd4234a8d1ed82d76fa536fa411 debian/config/alpha/defines + 6a030dc96bbeb2340082dc7c5c67a640 debian/config/amd64/defines + 3f9e6c98b1abe4a32b12add5d1ada119 debian/config/arm64/defines diff --git a/patch/preconfig/series b/patch/preconfig/series index bb9460110329..2177aeab565d 100644 --- a/patch/preconfig/series +++ b/patch/preconfig/series @@ -1 +1 @@ -packaging-update-abiname-to-6-2.patch +packaging-update-abiname.patch diff --git a/patch/series b/patch/series index dad09fe565ab..2458b0656567 100755 --- a/patch/series +++ b/patch/series @@ -23,7 +23,6 @@ driver-hwmon-max6658-fix-write-convrate.patch driver-hwmon-pmbus-dni_dps460.patch driver-hwmon-pmbus-dni_dps460-update-pmbus-core.patch driver-hwmon-pmbus-dps1900.patch -driver-iommu-fix-amd-iommu-off.patch driver-support-tun-config-carrier-enable.patch driver-support-optoe.patch driver-support-optoe-EOF_fix.patch @@ -35,11 +34,8 @@ e1000-Do-not-perform-reset-in-reset_task-if-we-are-a.patch # 0042-Marvell-a385-Micron-4G-flash-support.patch # 0042-armhf-additional-configs.patch # 0042-armhf-proc-dma-kconfig.patch -net-psample-fix-skb-over-panic.patch -net-backport-ipv6-missing-route.patch Support-for-fullcone-nat.patch driver-ixgbe-external-phy.patch -net-fix-skb-csum-update-in-inet_proto_csum_replace16.patch # # This series applies on GIT commit 1451b36b2b0d62178e42f648d8a18131af18f7d8 # Tkernel-sched-core-fix-cgroup-fork-race.patch @@ -52,7 +48,7 @@ net-fix-skb-csum-update-in-inet_proto_csum_replace16.patch # Tbridge-per-port-multicast-broadcast-flood-flags.patch # # Mellanox patches for 4.19 -0001-v4.19-6-Mellanox-platform-Backport-patches-for-new-M.patch +0001-Mellanox-platform-Backport-patches-for-new-Mellanox-.patch 0003-mlxsw-minimal-Fix-validation-for-FW-minor-version.patch 0004-mlxsw-core-Add-the-hottest-thermal-zone-detection.patch 0005-hwmon-pmbus-core-Add-support-for-vid-mode-detection-.patch