Skip to content

Commit 2fcd4e3

Browse files
authored
[mellanox]: Backport new kernel patches (#195)
0024-mlxsw-core-Fix-memory-leak-on-module-removal.patch torvalds/linux@adc80b6 @v5.10-rc2 0025-platform-x86-mlx-platform-Remove-PSU-EEPROM-configur.patch torvalds/linux@2bf5046 @v5.11-rc1 0026-platform-x86-mlx-platform-Remove-PSU-EEPROM-configur.patch torvalds/linux@912b341 @v5.11-rc1 regression tests have been performed against these patches on the Mellanox platform, no issue found. Signed-off-by: Kebo Liu <[email protected]>
1 parent 7c57fef commit 2fcd4e3

4 files changed

+160
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
From adc80b6cfedff6dad8b93d46a5ea2775fd5af9ec Mon Sep 17 00:00:00 2001
2+
From: Ido Schimmel <[email protected]>
3+
Date: Sat, 24 Oct 2020 16:37:32 +0300
4+
Subject: [PATCH] mlxsw: core: Fix memory leak on module removal
5+
6+
Free the devlink instance during the teardown sequence in the non-reload
7+
case to avoid the following memory leak.
8+
9+
unreferenced object 0xffff888232895000 (size 2048):
10+
comm "modprobe", pid 1073, jiffies 4295568857 (age 164.871s)
11+
hex dump (first 32 bytes):
12+
00 01 00 00 00 00 ad de 22 01 00 00 00 00 ad de ........".......
13+
10 50 89 32 82 88 ff ff 10 50 89 32 82 88 ff ff .P.2.....P.2....
14+
backtrace:
15+
[<00000000c704e9a6>] __kmalloc+0x13a/0x2a0
16+
[<00000000ee30129d>] devlink_alloc+0xff/0x760
17+
[<0000000092ab3e5d>] 0xffffffffa042e5b0
18+
[<000000004f3f8a31>] 0xffffffffa042f6ad
19+
[<0000000092800b4b>] 0xffffffffa0491df3
20+
[<00000000c4843903>] local_pci_probe+0xcb/0x170
21+
[<000000006993ded7>] pci_device_probe+0x2c2/0x4e0
22+
[<00000000a8e0de75>] really_probe+0x2c5/0xf90
23+
[<00000000d42ba75d>] driver_probe_device+0x1eb/0x340
24+
[<00000000bcc95e05>] device_driver_attach+0x294/0x300
25+
[<000000000e2bc177>] __driver_attach+0x167/0x2f0
26+
[<000000007d44cd6e>] bus_for_each_dev+0x148/0x1f0
27+
[<000000003cd5a91e>] driver_attach+0x45/0x60
28+
[<000000000041ce51>] bus_add_driver+0x3b8/0x720
29+
[<00000000f5215476>] driver_register+0x230/0x4e0
30+
[<00000000d79356f5>] __pci_register_driver+0x190/0x200
31+
32+
Fixes: a22712a96291 ("mlxsw: core: Fix devlink unregister flow")
33+
Signed-off-by: Ido Schimmel <[email protected]>
34+
Reported-by: Vadim Pasternak <[email protected]>
35+
Tested-by: Oleksandr Shamray <[email protected]>
36+
Signed-off-by: Jakub Kicinski <[email protected]>
37+
---
38+
drivers/net/ethernet/mellanox/mlxsw/core.c | 2 ++
39+
1 files changed, 2 insertions(+), 0 deletions(-)
40+
41+
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
42+
index b67d610..e2faedc 100644
43+
--- a/drivers/net/ethernet/mellanox/mlxsw/core.c
44+
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.c
45+
@@ -1135,6 +1135,8 @@ void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core,
46+
if (!reload)
47+
devlink_resources_unregister(devlink, NULL);
48+
mlxsw_core->bus->fini(mlxsw_core->bus_priv);
49+
+ if (!reload)
50+
+ devlink_free(devlink);
51+
52+
return;
53+
54+
--
55+
1.7.1
56+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
From 2bf5046bdb649908df8bcc0a012c56eee931a9af Mon Sep 17 00:00:00 2001
2+
From: Vadim Pasternak <[email protected]>
3+
Date: Wed, 25 Nov 2020 12:10:55 +0200
4+
Subject: [PATCH] platform/x86: mlx-platform: Remove PSU EEPROM from default platform configuration
5+
6+
Remove PSU EEPROM configuration for systems class equipped with
7+
Mellanox chip Spectrum and Celeron CPU - system types MSN2700, MSN2100.
8+
Till now all the systems from this class used few types of power units,
9+
all equipped with EEPROM device with address space two bytes. Thus, all
10+
these devices have been handled by EEPROM driver "24c02".
11+
12+
There is a new requirement is to support power unit replacement by "off
13+
the shelf" device, matching electrical required parameters. Such device
14+
can be equipped with different EEPROM type, which could be one byte
15+
address space addressing or even could be not equipped with EEPROM.
16+
In such case "24c02" will not work.
17+
18+
Fixes: c6acad68e ("platform/mellanox: mlxreg-hotplug: Modify to use a regmap interface")
19+
Fixes: ba814fdd0 ("platform/x86: mlx-platform: Use defines for bus assignment")
20+
Signed-off-by: Vadim Pasternak <[email protected]>
21+
Link: https://lore.kernel.org/r/[email protected]
22+
Signed-off-by: Hans de Goede <[email protected]>
23+
---
24+
drivers/platform/x86/mlx-platform.c | 6 ++----
25+
1 files changed, 2 insertions(+), 4 deletions(-)
26+
27+
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
28+
index d6c87fb..6400f1d 100644
29+
--- a/drivers/platform/x86/mlx-platform.c
30+
+++ b/drivers/platform/x86/mlx-platform.c
31+
@@ -375,15 +375,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_psu_items_data[] = {
32+
.label = "psu1",
33+
.reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET,
34+
.mask = BIT(0),
35+
- .hpdev.brdinfo = &mlxplat_mlxcpld_psu[0],
36+
- .hpdev.nr = MLXPLAT_CPLD_PSU_DEFAULT_NR,
37+
+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE,
38+
},
39+
{
40+
.label = "psu2",
41+
.reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET,
42+
.mask = BIT(1),
43+
- .hpdev.brdinfo = &mlxplat_mlxcpld_psu[1],
44+
- .hpdev.nr = MLXPLAT_CPLD_PSU_DEFAULT_NR,
45+
+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE,
46+
},
47+
};
48+
49+
--
50+
1.7.1
51+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
From 912b341585e302ee44fc5a2733f7bcf505e2c86f Mon Sep 17 00:00:00 2001
2+
From: Vadim Pasternak <[email protected]>
3+
Date: Wed, 25 Nov 2020 12:10:56 +0200
4+
Subject: [PATCH] platform/x86: mlx-platform: Remove PSU EEPROM from MSN274x platform configuration
5+
6+
Remove PSU EEPROM configuration for systems class equipped with
7+
Mellanox chip Spectrum and ATOM CPU - system types MSN274x. Till now
8+
all the systems from this class used few types of power units, all
9+
equipped with EEPROM device with address space two bytes. Thus, all
10+
these devices have been handled by EEPROM driver "24c02".
11+
12+
There is a new requirement is to support power unit replacement by "off
13+
the shelf" device, matching electrical required parameters. Such device
14+
can be equipped with different EEPROM type, which could be one byte
15+
address space addressing or even could be not equipped with EEPROM.
16+
In such case "24c02" will not work.
17+
18+
Fixes: ef08e14a3 ("platform/x86: mlx-platform: Add support for new msn274x system type")
19+
Signed-off-by: Vadim Pasternak <[email protected]>
20+
Link: https://lore.kernel.org/r/[email protected]
21+
Signed-off-by: Hans de Goede <[email protected]>
22+
---
23+
drivers/platform/x86/mlx-platform.c | 6 ++----
24+
1 files changed, 2 insertions(+), 4 deletions(-)
25+
26+
diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
27+
index 6400f1d..c1d1a78 100644
28+
--- a/drivers/platform/x86/mlx-platform.c
29+
+++ b/drivers/platform/x86/mlx-platform.c
30+
@@ -593,15 +593,13 @@ static struct mlxreg_core_data mlxplat_mlxcpld_msn274x_psu_items_data[] = {
31+
.label = "psu1",
32+
.reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET,
33+
.mask = BIT(0),
34+
- .hpdev.brdinfo = &mlxplat_mlxcpld_psu[0],
35+
- .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR,
36+
+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE,
37+
},
38+
{
39+
.label = "psu2",
40+
.reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET,
41+
.mask = BIT(1),
42+
- .hpdev.brdinfo = &mlxplat_mlxcpld_psu[1],
43+
- .hpdev.nr = MLXPLAT_CPLD_PSU_MSNXXXX_NR,
44+
+ .hpdev.nr = MLXPLAT_CPLD_NR_NONE,
45+
},
46+
};
47+
48+
--
49+
1.7.1
50+

patch/series

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ driver-ixgbe-external-phy.patch
7272
0021-platform-x86-mlx-platform-Remove-PSU-EEPROM-configur.patch
7373
0022-mlxsw-core-Increase-critical-threshold-for-ASIC-ther.patch
7474
0023-mlxsw-core-Add-validation-of-transceiver-temperature.patch
75+
0024-mlxsw-core-Fix-memory-leak-on-module-removal.patch
76+
0025-platform-x86-mlx-platform-Remove-PSU-EEPROM-configur.patch
77+
0026-platform-x86-mlx-platform-Remove-PSU-EEPROM-configur.patch
7578
############################################################
7679
#
7780
# Internal patches will be added below (placeholder)

0 commit comments

Comments
 (0)