Skip to contentSkip to conversation

hwmon: pmbus: pxe1610: don't bail out when not all pages are active

PATCH Superseded Paul Fertser 2 participants 4 messages Apr 15, 2021 – Apr 16, 2021 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: pmbus: pxe1610: don't bail out when not all pages are active

Certain VRs might be configured to use only the first output channel and so the mode for the second will be 0. Handle this gracefully.

Fixes b9fa0a3acfd8 ("hwmon: (pmbus/core) Add support for vid mode detection per page bases")
---
 drivers/hwmon/pmbus/pxe1610.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/hwmon/pmbus/pxe1610.c +10 -1
index 517584cff3de..ff6f6e05923b 100644
@@ -41,7 +41,16 @@ static int pxe1610_identify(struct i2c_client *client,
 				info->vrm_version[i] = vr13;
 				break;
 			default:
-				return -ENODEV;
+				/*
+				 * If prior pages are available limit operation
+				 * to them
+				 */
+				if (i != 0) {
+					info->pages = i;
+					return 0;
+				} else {
+					return -ENODEV;
+				}
 			}
 		}
 	}
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 18 lines · Paul Fertser

Certain VRs might be configured to use only the first output channel and so the mode for the second will be 0. Handle this gracefully.

Fixes b9fa0a3acfd8 ("hwmon: (pmbus/core) Add support for vid mode detection per page bases")
---
 drivers/hwmon/pmbus/pxe1610.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/hwmon/pmbus/pxe1610.c +0 -1
index 517584cff3de..ff6f6e05923b 100644
@@ -41,7 +41,16 @@ static int pxe1610_identify(struct i2c_client *client,
 				info->vrm_version[i] = vr13;
 				break;
 			default:
-				return -ENODEV;

drivers/hwmon/pmbus/pxe1610.c static int pxe1610_identify(struct i2c_client *client, · line 53

Quoted 10 lines
drivers/hwmon/pmbus/pxe1610.c +10 -0
+				/*
+				 * If prior pages are available limit operation
+				 * to them
+				 */
+				if (i != 0) {
+					info->pages = i;
+					return 0;
+				} else {
+					return -ENODEV;
+				}

else after return is unnecessary.

Thanks,
Guenter

#2 lore raw

PATCH v2 1/1 hwmon: pmbus: pxe1610: don't bail out when not all pages are active

Certain VRs might be configured to use only the first output channel and so the mode for the second will be 0. Handle this gracefully.

Fixes b9fa0a3acfd8 ("hwmon: (pmbus/core) Add support for vid mode detection per page bases")

---

Notes:
Changes for v2:
- Use more imperative style

 drivers/hwmon/pmbus/pxe1610.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/hwmon/pmbus/pxe1610.c +9 -0
index da27ce34ee3f..eb4a06003b7f 100644
@@ -41,6 +41,15 @@ static int pxe1610_identify(struct i2c_client *client,
 				info->vrm_version[i] = vr13;
 				break;
 			default:
+				/*
+				 * If prior pages are available limit operation
+				 * to them
+				 */
+				if (i != 0) {
+					info->pages = i;
+					return 0;
+				}
+
 				return -ENODEV;
 			}
 		}
Signature · 1 line
2.20.1
maintainer Applied
#3 lore raw
Quoted 5 lines · Paul Fertser

Certain VRs might be configured to use only the first output channel and so the mode for the second will be 0. Handle this gracefully.

Fixes b9fa0a3acfd8 ("hwmon: (pmbus/core) Add support for vid mode detection per page bases")

Applied.

Thanks,
Guenter

Quoted 32 lines

---

Notes:
Changes for v2:
- Use more imperative style

 drivers/hwmon/pmbus/pxe1610.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/hwmon/pmbus/pxe1610.c +9 -0
index da27ce34ee3f..eb4a06003b7f 100644
@@ -41,6 +41,15 @@ static int pxe1610_identify(struct i2c_client *client,
 				info->vrm_version[i] = vr13;
 				break;
 			default:
+				/*
+				 * If prior pages are available limit operation
+				 * to them
+				 */
+				if (i != 0) {
+					info->pages = i;
+					return 0;
+				}
+
 				return -ENODEV;
 			}
 		}
Signature · 1 line
2.20.1