Skip to contentSkip to conversation

hwmon: (pmbus/mp2975) Fix PGOOD in READ_STATUS_WORD

PATCH Superseded Naresh Solanki 2 participants 6 messages Jul 28, 2023 – Jul 31, 2023 Hardware monitoring

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (pmbus/mp2975) Fix PGOOD in READ_STATUS_WORD

From: Patrick Rudolph <[email protected]>

MPS returns PGOOD instead of PB_STATUS_POWER_GOOD_N. Fix that in the read_word_data hook.

---
 drivers/hwmon/pmbus/mp2975.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/hwmon/pmbus/mp2975.c +4 -0
index 28f33f4618fa..410b6eae6d02 100644
@@ -297,6 +297,10 @@ static int mp2973_read_word_data(struct i2c_client *client, int page,
 	int ret;
 
 	switch (reg) {
+	case PMBUS_STATUS_WORD:
+		ret = pmbus_read_word_data(client, page, phase, reg);
+		ret ^= PB_STATUS_POWER_GOOD_N;
+		break;
 	case PMBUS_OT_FAULT_LIMIT:
 		ret = mp2975_read_word_helper(client, page, phase, reg,
 					      GENMASK(7, 0));

base-commit: a4bb1ce5b9e3ca403c04e20ebeae77fd6447cb11

Signature · 1 line
2.41.0
maintainer
#1 lore raw
Quoted 5 lines · Naresh Solanki

From: Patrick Rudolph <[email protected]>

MPS returns PGOOD instead of PB_STATUS_POWER_GOOD_N. Fix that in the read_word_data hook.

Datasheets are not public, so I can not verify, but the code below only handles MP2973 and MP2971. What about MP2975 ?

Either case, this appears to affect most Monolithic chips, but not all of them. Please limit the statement to known to be affected chips.

Quoted 11 lines
---
  drivers/hwmon/pmbus/mp2975.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/hwmon/pmbus/mp2975.c +0 -0
index 28f33f4618fa..410b6eae6d02 100644

drivers/hwmon/pmbus/mp2975.c static int mp2973_read_word_data(struct i2c_client *client, int page, · line 301

Quoted 5 lines
drivers/hwmon/pmbus/mp2975.c +2 -0
@@ -297,6 +297,10 @@ static int mp2973_read_word_data(struct i2c_client *client, int page,
  	int ret;
 
  	switch (reg) {
+	case PMBUS_STATUS_WORD:
+		ret = pmbus_read_word_data(client, page, phase, reg);
		if (ret < 0)
			return ret;

Please add a comment explaining what is going on.

Quoted 7 lines
drivers/hwmon/pmbus/mp2975.c +2 -0
+		ret ^= PB_STATUS_POWER_GOOD_N;
+		break;
  	case PMBUS_OT_FAULT_LIMIT:
  		ret = mp2975_read_word_helper(client, page, phase, reg,
  					      GENMASK(7, 0));

base-commit: a4bb1ce5b9e3ca403c04e20ebeae77fd6447cb11

#2 lore raw

Hi Guenter,

Quoted 9 lines · Guenter Roeck
Quoted 5 lines · Naresh Solanki

From: Patrick Rudolph <[email protected]>

MPS returns PGOOD instead of PB_STATUS_POWER_GOOD_N. Fix that in the read_word_data hook.

Datasheets are not public, so I can not verify, but the code below only handles MP2973 and MP2971. What about MP2975 ?

I dont have MP2975 to even verify. I'm not sure if its applicable.

Quoted 4 lines

Either case, this appears to affect most Monolithic chips, but not all of them. Please limit the statement to known to be affected chips.

Yes. With what we observed, this affects mp2973 & mp2971. Will update accordingly.

Quoted 14 lines
Quoted 14 lines
---
  drivers/hwmon/pmbus/mp2975.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/hwmon/pmbus/mp2975.c +0 -0
index 28f33f4618fa..410b6eae6d02 100644
@@ -297,6 +297,10 @@ static int mp2973_read_word_data(struct i2c_client *client, int page,
      int ret;
 
Quoted 8 lines

drivers/hwmon/pmbus/mp2975.c static int mp2973_read_word_data(struct i2c_client *client, int page, · line 301

Quoted 3 lines
drivers/hwmon/pmbus/mp2975.c +2 -0
      switch (reg) {
+     case PMBUS_STATUS_WORD:
+             ret = pmbus_read_word_data(client, page, phase, reg);
                if (ret < 0)
                        return ret;

Please add a comment explaining what is going on.

Sure.

Quoted 9 lines
Quoted 8 lines
drivers/hwmon/pmbus/mp2975.c +2 -0
+             ret ^= PB_STATUS_POWER_GOOD_N;
+             break;
      case PMBUS_OT_FAULT_LIMIT:
              ret = mp2975_read_word_helper(client, page, phase, reg,
                                            GENMASK(7, 0));

base-commit: a4bb1ce5b9e3ca403c04e20ebeae77fd6447cb11

maintainer
#3 lore raw
Quoted 13 lines · Naresh Solanki

Hi Guenter,

Quoted 9 lines · Guenter Roeck
Quoted 5 lines · Naresh Solanki

From: Patrick Rudolph <[email protected]>

MPS returns PGOOD instead of PB_STATUS_POWER_GOOD_N. Fix that in the read_word_data hook.

Datasheets are not public, so I can not verify, but the code below only handles MP2973 and MP2971. What about MP2975 ?

Quoted 7 lines

I dont have MP2975 to even verify. I'm not sure if its applicable.

Quoted 4 lines

Either case, this appears to affect most Monolithic chips, but not all of them. Please limit the statement to known to be affected chips.

Yes. With what we observed, this affects mp2973 & mp2971. Will update accordingly.

Please also add a comment that MP2975 is likely affected but can not be confirmed due to lack of a datasheet.

Thanks,
Guenter

Quoted 32 lines
Quoted 14 lines
Quoted 14 lines
---
   drivers/hwmon/pmbus/mp2975.c | 4 ++++
   1 file changed, 4 insertions(+)
drivers/hwmon/pmbus/mp2975.c +0 -0
index 28f33f4618fa..410b6eae6d02 100644
@@ -297,6 +297,10 @@ static int mp2973_read_word_data(struct i2c_client *client, int page,
       int ret;
 
Quoted 8 lines

drivers/hwmon/pmbus/mp2975.c static int mp2973_read_word_data(struct i2c_client *client, int page, · line 301

Quoted 3 lines
drivers/hwmon/pmbus/mp2975.c +2 -0
       switch (reg) {
+     case PMBUS_STATUS_WORD:
+             ret = pmbus_read_word_data(client, page, phase, reg);
                 if (ret < 0)
                         return ret;

Please add a comment explaining what is going on.

Sure.

Quoted 9 lines
Quoted 8 lines
drivers/hwmon/pmbus/mp2975.c +2 -0
+             ret ^= PB_STATUS_POWER_GOOD_N;
+             break;
       case PMBUS_OT_FAULT_LIMIT:
               ret = mp2975_read_word_helper(client, page, phase, reg,
                                             GENMASK(7, 0));

base-commit: a4bb1ce5b9e3ca403c04e20ebeae77fd6447cb11

#4 lore raw

Hi

Quoted 17 lines · Guenter Roeck
Quoted 15 lines · Naresh Solanki

Hi Guenter,

Quoted 9 lines · Guenter Roeck
Quoted 5 lines · Naresh Solanki

From: Patrick Rudolph <[email protected]>

MPS returns PGOOD instead of PB_STATUS_POWER_GOOD_N. Fix that in the read_word_data hook.

Datasheets are not public, so I can not verify, but the code below only handles MP2973 and MP2971. What about MP2975 ?

I dont have MP2975 to even verify. I'm not sure if its applicable.

Quoted 1 line
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Either case, this appears to affect most Monolithic chips, but not all of them. Please limit the statement to known to be affected chips.

Yes. With what we observed, this affects mp2973 & mp2971. Will update accordingly.

Please also add a comment that MP2975 is likely affected but can not be confirmed due to lack of a datasheet.

I have the datasheet for MP2975 but haven't verified it on real HW.

Regards,
Naresh

Quoted 37 lines

Thanks,
Guenter

Quoted 32 lines
Quoted 14 lines
Quoted 14 lines
---
   drivers/hwmon/pmbus/mp2975.c | 4 ++++
   1 file changed, 4 insertions(+)
drivers/hwmon/pmbus/mp2975.c +0 -0
index 28f33f4618fa..410b6eae6d02 100644
@@ -297,6 +297,10 @@ static int mp2973_read_word_data(struct i2c_client *client, int page,
       int ret;
 
Quoted 8 lines

drivers/hwmon/pmbus/mp2975.c static int mp2973_read_word_data(struct i2c_client *client, int page, · line 301

Quoted 3 lines
drivers/hwmon/pmbus/mp2975.c +2 -0
       switch (reg) {
+     case PMBUS_STATUS_WORD:
+             ret = pmbus_read_word_data(client, page, phase, reg);
                 if (ret < 0)
                         return ret;

Please add a comment explaining what is going on.

Sure.

Quoted 9 lines
Quoted 8 lines
drivers/hwmon/pmbus/mp2975.c +2 -0
+             ret ^= PB_STATUS_POWER_GOOD_N;
+             break;
       case PMBUS_OT_FAULT_LIMIT:
               ret = mp2975_read_word_helper(client, page, phase, reg,
                                             GENMASK(7, 0));

base-commit: a4bb1ce5b9e3ca403c04e20ebeae77fd6447cb11

maintainer
#5 lore raw
In reply to Naresh Solanki
Quoted 6 lines · Naresh Solanki

Hi Guenter,

Quoted 2 lines · Guenter Roeck

On 7/28/23 01:25, Naresh Solanki wrote:

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

From: Patrick Rudolph <[email protected]>

MPS returns PGOOD instead of PB_STATUS_POWER_GOOD_N. Fix that in the read_word_data hook.

Datasheets are not public, so I can not verify, but the code below only handles MP2973 and MP2971. What about MP2975 ?

I dont have MP2975 to even verify. I'm not sure if its applicable.

Maybe Vadim can check / confirm.

Guenter

Quoted 38 lines
Quoted 4 lines

Either case, this appears to affect most Monolithic chips, but not all of them. Please limit the statement to known to be affected chips.

Yes. With what we observed, this affects mp2973 & mp2971. Will update accordingly.

Quoted 14 lines
Quoted 14 lines
---
   drivers/hwmon/pmbus/mp2975.c | 4 ++++
   1 file changed, 4 insertions(+)
drivers/hwmon/pmbus/mp2975.c +0 -0
index 28f33f4618fa..410b6eae6d02 100644
@@ -297,6 +297,10 @@ static int mp2973_read_word_data(struct i2c_client *client, int page,
       int ret;
 
Quoted 8 lines

drivers/hwmon/pmbus/mp2975.c static int mp2973_read_word_data(struct i2c_client *client, int page, · line 301

Quoted 3 lines
drivers/hwmon/pmbus/mp2975.c +2 -0
       switch (reg) {
+     case PMBUS_STATUS_WORD:
+             ret = pmbus_read_word_data(client, page, phase, reg);
                 if (ret < 0)
                         return ret;

Please add a comment explaining what is going on.

Sure.

Quoted 9 lines
Quoted 8 lines
drivers/hwmon/pmbus/mp2975.c +2 -0
+             ret ^= PB_STATUS_POWER_GOOD_N;
+             break;
       case PMBUS_OT_FAULT_LIMIT:
               ret = mp2975_read_word_helper(client, page, phase, reg,
                                             GENMASK(7, 0));

base-commit: a4bb1ce5b9e3ca403c04e20ebeae77fd6447cb11