Skip to content

Commit 904ca54

Browse files
committed
hw-mgmt: patches: Correct mp2891 voltage scaling
This patch fixes the issue while shifting the bits in pmbus register 0xBD. A right shift of 14 bits would make the value as 0 and the check for BIT(13) will always fail. This was causing the wrong scale value of 5mv to be used (instead of 2.5mv) for vou2. Bug #3962952 Signed-off-by: Ciju Rajan K <[email protected]>
1 parent fbbfa70 commit 904ca54

File tree

4 files changed

+43
-34
lines changed

4 files changed

+43
-34
lines changed

debian/changelog

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
hw-management (1.mlnx.7.0040.1006) unstable; urgency=low
1+
hw-management (1.mlnx.7.0040.1007) unstable; urgency=low
22
[ MLNX ]
33

4-
-- Yehuda Yehudai <[email protected]> Thu, 25 Jul 2024 17:10:00 +0300
4+
-- Yehuda Yehudai <[email protected]> Tue, 30 Jul 2024 17:10:00 +0300

recipes-kernel/linux/linux-5.10/0294-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2891-c.patch

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Signed-off-by: Vadim Pasternak <[email protected]>
2424
Documentation/hwmon/mp2891.rst | 128 ++++++++++
2525
drivers/hwmon/pmbus/Kconfig | 9 +
2626
drivers/hwmon/pmbus/Makefile | 1 +
27-
drivers/hwmon/pmbus/mp2891.c | 423 +++++++++++++++++++++++++++++++++
28-
4 files changed, 561 insertions(+)
27+
drivers/hwmon/pmbus/mp2891.c | 426 +++++++++++++++++++++++++++++++++
28+
4 files changed, 564 insertions(+)
2929
create mode 100644 Documentation/hwmon/mp2891.rst
3030
create mode 100644 drivers/hwmon/pmbus/mp2891.c
3131

@@ -164,43 +164,43 @@ index 000000000..c4bda3d7e
164164
+
165165
+**temp1_max_alarm**
166166
diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
167-
index ee94fcfde..3eba14fac 100644
167+
index 2303b5b45..8a08b8102 100644
168168
--- a/drivers/hwmon/pmbus/Kconfig
169169
+++ b/drivers/hwmon/pmbus/Kconfig
170-
@@ -220,6 +220,15 @@ config SENSORS_MP2888
170+
@@ -230,6 +230,15 @@ config SENSORS_MP2888
171171
This driver can also be built as a module. If so, the module will
172172
be called mp2888.
173173

174174
+config SENSORS_MP2891
175-
+ tristate "MPS MP2891"
176-
+ help
177-
+ If you say yes here you get hardware monitoring support for MPS
178-
+ MP2891 Dual Loop Digital Multi-Phase Controller.
175+
+ tristate "MPS MP2891"
176+
+ help
177+
+ If you say yes here you get hardware monitoring support for MPS
178+
+ MP2891 Dual Loop Digital Multi-Phase Controller.
179179
+
180-
+ This driver can also be built as a module. If so, the module will
181-
+ be called mp2891.
180+
+ This driver can also be built as a module. If so, the module will
181+
+ be called mp2891.
182182
+
183183
config SENSORS_MP2975
184184
tristate "MPS MP2975"
185185
help
186186
diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
187-
index b1b9a3c8b..60151ac03 100644
187+
index baab12bbf..cc4e09cc4 100644
188188
--- a/drivers/hwmon/pmbus/Makefile
189189
+++ b/drivers/hwmon/pmbus/Makefile
190-
@@ -25,6 +25,7 @@ obj-$(CONFIG_SENSORS_MAX31785) += max31785.o
191-
obj-$(CONFIG_SENSORS_MAX34440) += max34440.o
190+
@@ -26,6 +26,7 @@ obj-$(CONFIG_SENSORS_MAX34440) += max34440.o
191+
obj-$(CONFIG_SENSORS_DNI_DPS460) += dni_dps460.o
192192
obj-$(CONFIG_SENSORS_MAX8688) += max8688.o
193193
obj-$(CONFIG_SENSORS_MP2888) += mp2888.o
194-
+obj-$(CONFIG_SENSORS_MP2891) += mp2891.o
194+
+obj-$(CONFIG_SENSORS_MP2891) += mp2891.o
195195
obj-$(CONFIG_SENSORS_MP2975) += mp2975.o
196196
obj-$(CONFIG_SENSORS_PXE1610) += pxe1610.o
197197
obj-$(CONFIG_SENSORS_TPS40422) += tps40422.o
198198
diff --git a/drivers/hwmon/pmbus/mp2891.c b/drivers/hwmon/pmbus/mp2891.c
199199
new file mode 100644
200-
index 000000000..54f019e22
200+
index 000000000..8e551b9c5
201201
--- /dev/null
202202
+++ b/drivers/hwmon/pmbus/mp2891.c
203-
@@ -0,0 +1,423 @@
203+
@@ -0,0 +1,426 @@
204204
+// SPDX-License-Identifier: GPL-2.0-or-later
205205
+/*
206206
+ * Hardware monitoring driver for MPS Multi-phase Digital VR Controllers(MP2891)
@@ -456,7 +456,7 @@ index 000000000..54f019e22
456456
+ * bit 13 = 0, the vid_step is defined by bits 15:14:
457457
+ * 00b - 6.25mV/LSB, 01b - 5mV/LSB, 10b - 2mV/LSB, 11b - 1mV
458458
+ */
459-
+ if ((ret & MP2891_DAC_2P5MV_MASK) >> MP2891_VID_STEP_POS) {
459+
+ if (ret & MP2891_DAC_2P5MV_MASK) {
460460
+ data->vid_step[page] = 250;
461461
+ return mp2891_git_vid_volt_ref(client, data, page);
462462
+ }
@@ -468,6 +468,9 @@ index 000000000..54f019e22
468468
+ case 2:
469469
+ data->vid_step[page] = 200;
470470
+ break;
471+
+ case 3:
472+
+ data->vid_step[page] = 100;
473+
+ break;
471474
+ default:
472475
+ data->vid_step[page] = 250;
473476
+ break;
@@ -625,5 +628,5 @@ index 000000000..54f019e22
625628
+MODULE_DESCRIPTION("PMBus driver for MPS MP2891 device");
626629
+MODULE_LICENSE("GPL");
627630
--
628-
2.20.1
631+
2.44.0
629632

recipes-kernel/linux/linux-5.10/sonic/0294-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2891-c.patch

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Signed-off-by: Vadim Pasternak <[email protected]>
2424
Documentation/hwmon/mp2891.rst | 128 +++++++++
2525
drivers/hwmon/pmbus/Kconfig | 9 +
2626
drivers/hwmon/pmbus/Makefile | 1 +
27-
drivers/hwmon/pmbus/mp2891.c | 423 +++++++++++++++++++++++++++++++++
28-
4 files changed, 561 insertions(+)
27+
drivers/hwmon/pmbus/mp2891.c | 426 +++++++++++++++++++++++++++++++++
28+
4 files changed, 564 insertions(+)
2929
create mode 100644 Documentation/hwmon/mp2891.rst
3030
create mode 100644 drivers/hwmon/pmbus/mp2891.c
3131

@@ -197,10 +197,10 @@ index b1b9a3c8b..60151ac03 100644
197197
obj-$(CONFIG_SENSORS_TPS40422) += tps40422.o
198198
diff --git a/drivers/hwmon/pmbus/mp2891.c b/drivers/hwmon/pmbus/mp2891.c
199199
new file mode 100644
200-
index 000000000..38b5365f9
200+
index 000000000..8e551b9c5
201201
--- /dev/null
202202
+++ b/drivers/hwmon/pmbus/mp2891.c
203-
@@ -0,0 +1,423 @@
203+
@@ -0,0 +1,426 @@
204204
+// SPDX-License-Identifier: GPL-2.0-or-later
205205
+/*
206206
+ * Hardware monitoring driver for MPS Multi-phase Digital VR Controllers(MP2891)
@@ -456,7 +456,7 @@ index 000000000..38b5365f9
456456
+ * bit 13 = 0, the vid_step is defined by bits 15:14:
457457
+ * 00b - 6.25mV/LSB, 01b - 5mV/LSB, 10b - 2mV/LSB, 11b - 1mV
458458
+ */
459-
+ if ((ret & MP2891_DAC_2P5MV_MASK) >> MP2891_VID_STEP_POS) {
459+
+ if (ret & MP2891_DAC_2P5MV_MASK) {
460460
+ data->vid_step[page] = 250;
461461
+ return mp2891_git_vid_volt_ref(client, data, page);
462462
+ }
@@ -468,6 +468,9 @@ index 000000000..38b5365f9
468468
+ case 2:
469469
+ data->vid_step[page] = 200;
470470
+ break;
471+
+ case 3:
472+
+ data->vid_step[page] = 100;
473+
+ break;
471474
+ default:
472475
+ data->vid_step[page] = 250;
473476
+ break;

recipes-kernel/linux/linux-6.1/0048-hwmon-pmbus-Add-support-for-MPS-Multi-phase-mp2891-c.patch

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ Signed-off-by: Vadim Pasternak <[email protected]>
2424
Documentation/hwmon/mp2891.rst | 128 ++++++++++
2525
drivers/hwmon/pmbus/Kconfig | 9 +
2626
drivers/hwmon/pmbus/Makefile | 1 +
27-
drivers/hwmon/pmbus/mp2891.c | 424 +++++++++++++++++++++++++++++++++
28-
4 files changed, 562 insertions(+)
27+
drivers/hwmon/pmbus/mp2891.c | 427 +++++++++++++++++++++++++++++++++
28+
4 files changed, 565 insertions(+)
2929
create mode 100644 Documentation/hwmon/mp2891.rst
3030
create mode 100644 drivers/hwmon/pmbus/mp2891.c
3131

3232
diff --git a/Documentation/hwmon/mp2891.rst b/Documentation/hwmon/mp2891.rst
3333
new file mode 100644
34-
index 000000000000..c4bda3d7ee8a
34+
index 000000000..c4bda3d7e
3535
--- /dev/null
3636
+++ b/Documentation/hwmon/mp2891.rst
3737
@@ -0,0 +1,128 @@
@@ -164,7 +164,7 @@ index 000000000000..c4bda3d7ee8a
164164
+
165165
+**temp1_max_alarm**
166166
diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
167-
index 89668af67206..77d67344cee4 100644
167+
index 89668af67..77d67344c 100644
168168
--- a/drivers/hwmon/pmbus/Kconfig
169169
+++ b/drivers/hwmon/pmbus/Kconfig
170170
@@ -299,6 +299,15 @@ config SENSORS_MP2888
@@ -184,7 +184,7 @@ index 89668af67206..77d67344cee4 100644
184184
tristate "MPS MP2975"
185185
help
186186
diff --git a/drivers/hwmon/pmbus/Makefile b/drivers/hwmon/pmbus/Makefile
187-
index 0002dbe22d52..8e767d7b8c5b 100644
187+
index 0002dbe22..8e767d7b8 100644
188188
--- a/drivers/hwmon/pmbus/Makefile
189189
+++ b/drivers/hwmon/pmbus/Makefile
190190
@@ -32,6 +32,7 @@ obj-$(CONFIG_SENSORS_MAX31785) += max31785.o
@@ -197,10 +197,10 @@ index 0002dbe22d52..8e767d7b8c5b 100644
197197
obj-$(CONFIG_SENSORS_PLI1209BC) += pli1209bc.o
198198
diff --git a/drivers/hwmon/pmbus/mp2891.c b/drivers/hwmon/pmbus/mp2891.c
199199
new file mode 100644
200-
index 000000000000..1547625fea7e
200+
index 000000000..a4386e8e9
201201
--- /dev/null
202202
+++ b/drivers/hwmon/pmbus/mp2891.c
203-
@@ -0,0 +1,424 @@
203+
@@ -0,0 +1,427 @@
204204
+// SPDX-License-Identifier: GPL-2.0-or-later
205205
+/*
206206
+ * Hardware monitoring driver for MPS Multi-phase Digital VR Controllers(MP2891)
@@ -456,7 +456,7 @@ index 000000000000..1547625fea7e
456456
+ * bit 13 = 0, the vid_step is defined by bits 15:14:
457457
+ * 00b - 6.25mV/LSB, 01b - 5mV/LSB, 10b - 2mV/LSB, 11b - 1mV
458458
+ */
459-
+ if ((ret & MP2891_DAC_2P5MV_MASK) >> MP2891_VID_STEP_POS) {
459+
+ if (ret & MP2891_DAC_2P5MV_MASK) {
460460
+ data->vid_step[page] = 250;
461461
+ return mp2891_git_vid_volt_ref(client, data, page);
462462
+ }
@@ -468,6 +468,9 @@ index 000000000000..1547625fea7e
468468
+ case 2:
469469
+ data->vid_step[page] = 200;
470470
+ break;
471+
+ case 3:
472+
+ data->vid_step[page] = 100;
473+
+ break;
471474
+ default:
472475
+ data->vid_step[page] = 250;
473476
+ break;
@@ -626,5 +629,5 @@ index 000000000000..1547625fea7e
626629
+MODULE_LICENSE("GPL");
627630
+MODULE_IMPORT_NS(PMBUS);
628631
--
629-
2.20.1
632+
2.44.0
630633

0 commit comments

Comments
 (0)