* [PATCH] hwmon: pmbus: pxe1610: don't bail out when not all pages are active
@ 2021-04-15 13:34 Paul Fertser
2021-04-15 15:18 ` Guenter Roeck
0 siblings, 1 reply; 4+ messages in thread
From: Paul Fertser @ 2021-04-15 13:34 UTC (permalink / raw)
To: linux-hwmon
Cc: Paul Fertser, Guenter Roeck, Jean Delvare, Vadim Pasternak, linux-kernel
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@gmail.com>
---
drivers/hwmon/pmbus/pxe1610.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/pmbus/pxe1610.c b/drivers/hwmon/pmbus/pxe1610.c
index 517584cff3de..ff6f6e05923b 100644
--- a/drivers/hwmon/pmbus/pxe1610.c
+++ b/drivers/hwmon/pmbus/pxe1610.c
@@ -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;
+ }
}
}
}
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] hwmon: pmbus: pxe1610: don't bail out when not all pages are active
2021-04-15 13:34 [PATCH] hwmon: pmbus: pxe1610: don't bail out when not all pages are active Paul Fertser
@ 2021-04-15 15:18 ` Guenter Roeck
2021-04-16 10:29 ` [PATCH v2] " Paul Fertser
0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2021-04-15 15:18 UTC (permalink / raw)
To: Paul Fertser, linux-hwmon; +Cc: Jean Delvare, Vadim Pasternak, linux-kernel
On 4/15/21 6:34 AM, Paul Fertser wrote:
> 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@gmail.com>
> ---
> drivers/hwmon/pmbus/pxe1610.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/pmbus/pxe1610.c b/drivers/hwmon/pmbus/pxe1610.c
> index 517584cff3de..ff6f6e05923b 100644
> --- a/drivers/hwmon/pmbus/pxe1610.c
> +++ b/drivers/hwmon/pmbus/pxe1610.c
> @@ -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;
> + }
else after return is unnecessary.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] hwmon: pmbus: pxe1610: don't bail out when not all pages are active
2021-04-15 15:18 ` Guenter Roeck
@ 2021-04-16 10:29 ` Paul Fertser
2021-04-16 14:14 ` Guenter Roeck
0 siblings, 1 reply; 4+ messages in thread
From: Paul Fertser @ 2021-04-16 10:29 UTC (permalink / raw)
To: linux-hwmon
Cc: Paul Fertser, Guenter Roeck, Jean Delvare, Vadim Pasternak, linux-kernel
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@gmail.com>
---
Notes:
Changes for v2:
- Use more imperative style
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.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] hwmon: pmbus: pxe1610: don't bail out when not all pages are active
2021-04-16 10:29 ` [PATCH v2] " Paul Fertser
@ 2021-04-16 14:14 ` Guenter Roeck
0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2021-04-16 14:14 UTC (permalink / raw)
To: Paul Fertser; +Cc: linux-hwmon, Jean Delvare, Vadim Pasternak, linux-kernel
On Fri, Apr 16, 2021 at 01:29:04PM +0300, Paul Fertser wrote:
> 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@gmail.com>
Applied.
Thanks,
Guenter
> ---
>
> Notes:
> Changes for v2:
> - Use more imperative style
>
> 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.20.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-04-16 14:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15 13:34 [PATCH] hwmon: pmbus: pxe1610: don't bail out when not all pages are active Paul Fertser
2021-04-15 15:18 ` Guenter Roeck
2021-04-16 10:29 ` [PATCH v2] " Paul Fertser
2021-04-16 14:14 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.