linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Jan Kundrát" <jan.kundrat@cesnet.cz>
Cc: linux-hwmon@vger.kernel.org, Vadim Pasternak <vadimp@mellanox.com>
Subject: Re: [PATCH] hwmon: (pmbus) Fix page vs. register when accessing fans
Date: Tue, 23 Jun 2020 07:03:02 -0700	[thread overview]
Message-ID: <20200623140302.GA73558@roeck-us.net> (raw)
In-Reply-To: <449bc9e6c0e4305581e45905ce9d043b356a9932.1592904387.git.jan.kundrat@cesnet.cz>

On Tue, Jun 23, 2020 at 09:47:39AM +0200, Jan Kundrát wrote:
> Commit 16358542f32f added support for multi-phase pmbus devices.
> However, when calling pmbus_add_sensor() for fans, the patch swapped
> the `page` and `reg` attributes. As a result, the fan speeds were
> reported as 0 RPM on my device.
> 
> Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
> Fixes: 16358542f32f hwmon: (pmbus) Implement multi-phase support

Applied.

Thanks,
Guenter

> ---
>  a/drivers/hwmon/pmbus/pmbus_core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
> index 8d321bf7d15b..e721a016f3e7 100644
> --- a/drivers/hwmon/pmbus/pmbus_core.c
> +++ b/drivers/hwmon/pmbus/pmbus_core.c
> @@ -1869,7 +1869,7 @@ static int pmbus_add_fan_ctrl(struct i2c_client *client,
>  	struct pmbus_sensor *sensor;
>  
>  	sensor = pmbus_add_sensor(data, "fan", "target", index, page,
> -				  PMBUS_VIRT_FAN_TARGET_1 + id, 0xff, PSC_FAN,
> +				  0xff, PMBUS_VIRT_FAN_TARGET_1 + id, PSC_FAN,
>  				  false, false, true);
>  
>  	if (!sensor)
> @@ -1880,14 +1880,14 @@ static int pmbus_add_fan_ctrl(struct i2c_client *client,
>  		return 0;
>  
>  	sensor = pmbus_add_sensor(data, "pwm", NULL, index, page,
> -				  PMBUS_VIRT_PWM_1 + id, 0xff, PSC_PWM,
> +				  0xff, PMBUS_VIRT_PWM_1 + id, PSC_PWM,
>  				  false, false, true);
>  
>  	if (!sensor)
>  		return -ENOMEM;
>  
>  	sensor = pmbus_add_sensor(data, "pwm", "enable", index, page,
> -				  PMBUS_VIRT_PWM_ENABLE_1 + id, 0xff, PSC_PWM,
> +				  0xff, PMBUS_VIRT_PWM_ENABLE_1 + id, PSC_PWM,
>  				  true, false, false);
>  
>  	if (!sensor)
> @@ -1929,7 +1929,7 @@ static int pmbus_add_fan_attributes(struct i2c_client *client,
>  				continue;
>  
>  			if (pmbus_add_sensor(data, "fan", "input", index,
> -					     page, pmbus_fan_registers[f], 0xff,
> +					     page, 0xff, pmbus_fan_registers[f],
>  					     PSC_FAN, true, true, true) == NULL)
>  				return -ENOMEM;
>  

      reply	other threads:[~2020-06-23 14:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23  7:47 [PATCH] hwmon: (pmbus) Fix page vs. register when accessing fans Jan Kundrát
2020-06-23 14:03 ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200623140302.GA73558@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=jan.kundrat@cesnet.cz \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=vadimp@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).