[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210512144848.189477610@linuxfoundation.org>
Date: Wed, 12 May 2021 16:46:15 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Paul Fertser <fercerpav@...il.com>,
Guenter Roeck <linux@...ck-us.net>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.12 329/677] hwmon: (pmbus/pxe1610) dont bail out when not all pages are active
From: Paul Fertser <fercerpav@...il.com>
[ Upstream commit f025314306ae17a3fdaf2874d7e878ce19cea363 ]
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")
Signed-off-by: Paul Fertser <fercerpav@...il.com>
Link: https://lore.kernel.org/r/20210416102926.13614-1-fercerpav@gmail.com
Signed-off-by: Guenter Roeck <linux@...ck-us.net>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/hwmon/pmbus/pxe1610.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/hwmon/pmbus/pxe1610.c b/drivers/hwmon/pmbus/pxe1610.c
index da27ce34ee3f..eb4a06003b7f 100644
--- a/drivers/hwmon/pmbus/pxe1610.c
+++ b/drivers/hwmon/pmbus/pxe1610.c
@@ -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;
}
}
--
2.30.2
Powered by blists - more mailing lists