Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mellanox] Integrate HW-MGMT 7.0030.4003 Changes #396

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
From bb46d45ce13c8faf9c2ab57b945c3a3adc587918 Mon Sep 17 00:00:00 2001
From c729c7228762db53a6219d3ef126226b50b54dfc Mon Sep 17 00:00:00 2001
From: Vadim Pasternak <vadimp@nvidia.com>
Date: Sun, 23 Jul 2023 06:26:09 +0000
Subject: [PATCH backport 6.1.42 42/85] hwmon: (mlxreg-fan) Add support for new
flavour of capability register
Subject: [PATCH v6.1 23/80] hwmon: (mlxreg-fan) Add support for new flavour of
capability register

FAN platform data is common across the various systems, while fan
driver should be able to apply only the fan instances relevant
Expand All @@ -27,14 +27,41 @@ bitmask or counter.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
---
drivers/hwmon/mlxreg-fan.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
drivers/hwmon/mlxreg-fan.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c
index 96017cc8da7e..dad94d2892b2 100644
index 96017cc8da7e..342ff355e925 100644
--- a/drivers/hwmon/mlxreg-fan.c
+++ b/drivers/hwmon/mlxreg-fan.c
@@ -390,7 +390,7 @@ static int mlxreg_fan_connect_verify(struct mlxreg_fan *fan,
@@ -63,12 +63,14 @@ struct mlxreg_fan;
* @reg: register offset;
* @mask: fault mask;
* @prsnt: present register offset;
+ * @shift: tacho presence bit shift;
*/
struct mlxreg_fan_tacho {
bool connected;
u32 reg;
u32 mask;
u32 prsnt;
+ u32 shift;
};

/*
@@ -143,8 +145,10 @@ mlxreg_fan_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
/*
* Map channel to presence bit - drawer can be equipped with
* one or few FANs, while presence is indicated per drawer.
+ * Shift channle value if necessary to align with register value.
*/
- if (BIT(channel / fan->tachos_per_drwr) & regval) {
+ if (BIT(rol32(channel, tacho->shift) / fan->tachos_per_drwr) &
+ regval) {
/* FAN is not connected - return zero for FAN speed. */
*val = 0;
return 0;
@@ -390,7 +394,7 @@ static int mlxreg_fan_connect_verify(struct mlxreg_fan *fan,
return err;
}

Expand All @@ -43,7 +70,7 @@ index 96017cc8da7e..dad94d2892b2 100644
}

static int mlxreg_pwm_connect_verify(struct mlxreg_fan *fan,
@@ -527,7 +527,15 @@ static int mlxreg_fan_config(struct mlxreg_fan *fan,
@@ -527,7 +531,15 @@ static int mlxreg_fan_config(struct mlxreg_fan *fan,
return err;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
From fa70f126d07b6fe84c1c110fb3a3923570b72f2e Mon Sep 17 00:00:00 2001
From 8769d44cd9dab3e8e6f539956a40eb041f479fef Mon Sep 17 00:00:00 2001
From: Vadim Pasternak <vadimp@nvidia.com>
Date: Sun, 23 Jul 2023 06:49:01 +0000
Subject: [PATCH backport 6.1.42 43/85] hwmon: (mlxreg-fan) Extend number of
supporetd fans
Subject: [PATCH v6.1 24/80] hwmon: (mlxreg-fan) Extend number of supporetd
fans

Some new big modular systems can be equipped with up to 24 fans.
Extend maximum number of fans accordingly.
Expand All @@ -13,7 +13,7 @@ Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c
index dad94d2892b2..c515e1d2fe4e 100644
index 342ff355e925..bddc927b207c 100644
--- a/drivers/hwmon/mlxreg-fan.c
+++ b/drivers/hwmon/mlxreg-fan.c
@@ -12,7 +12,7 @@
Expand All @@ -25,7 +25,7 @@ index dad94d2892b2..c515e1d2fe4e 100644
#define MLXREG_FAN_MAX_PWM 4
#define MLXREG_FAN_PWM_NOT_CONNECTED 0xff
#define MLXREG_FAN_MAX_STATE 10
@@ -300,6 +300,16 @@ static const struct hwmon_channel_info *mlxreg_fan_hwmon_info[] = {
@@ -304,6 +304,16 @@ static const struct hwmon_channel_info *mlxreg_fan_hwmon_info[] = {
HWMON_F_INPUT | HWMON_F_FAULT,
HWMON_F_INPUT | HWMON_F_FAULT,
HWMON_F_INPUT | HWMON_F_FAULT,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
From 46c4b0cdf2a3abe321e137bcb87e5639c39fd655 Mon Sep 17 00:00:00 2001
From 242233be3adcd06398d728b2e793d9e40e6fbc3d Mon Sep 17 00:00:00 2001
From: Vadim Pasternak <vadimp@nvidia.com>
Date: Thu, 20 Jul 2023 11:01:56 +0000
Subject: [PATCH backport 6.1.42 44/85] leds: mlxreg: Add support for new
flavour of capability register
Subject: [PATCH v6.1 25/81] leds: mlxreg: Add support for new flavour of
capability register

LED platform data is common across the various systems, while LED
driver should be able to apply only the LED instances relevant
Expand All @@ -28,7 +28,7 @@ Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c
index b7855c93bd72..063a9cb50a2b 100644
index b7855c93bd72..161195de78ba 100644
--- a/drivers/leds/leds-mlxreg.c
+++ b/drivers/leds/leds-mlxreg.c
@@ -206,16 +206,22 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv)
Expand All @@ -43,7 +43,7 @@ index b7855c93bd72..063a9cb50a2b 100644
+ */
+ if (data->slot && data->slot > regval)
+ continue;
+ else if (!(regval & data->bit))
+ else if (!(regval & data->bit) && !data->slot)
continue;
/*
* Field "bit" can contain one capability bit in 0 byte
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
From af93d2527b5af3f2e53507c7e35bcd9c9bd521cb Mon Sep 17 00:00:00 2001
From 9fc276007cac2ab2efc9f55f66c11816f4e2da6b Mon Sep 17 00:00:00 2001
From: Vadim Pasternak <vadimp@nvidia.com>
Date: Thu, 20 Jul 2023 11:17:31 +0000
Subject: [PATCH backport 6.1.42 45/85] leds: mlxreg: Remove code for amber LED
colour
Subject: [PATCH v6.1 26/81] leds: mlxreg: Remove code for amber LED colour

Remove unused code for amber LED colour.

Expand All @@ -15,7 +14,7 @@ Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c
index 063a9cb50a2b..215132f67c07 100644
index 161195de78ba..23de154ade61 100644
--- a/drivers/leds/leds-mlxreg.c
+++ b/drivers/leds/leds-mlxreg.c
@@ -19,7 +19,6 @@
Expand Down
Loading