lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210512225548.GA2874606@roeck-us.net>
Date:   Wed, 12 May 2021 15:55:48 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Chu Lin <linchuyuan@...gle.com>
Cc:     linchuyuan@...il.com, jasonling@...gle.com, zhongqil@...gle.com,
        jdelvare@...e.com, linux-hwmon@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hwmon: adm1272: enable adm1272 temperature reporting

On Wed, May 12, 2021 at 05:10:43PM +0000, Chu Lin wrote:
> adm1272 supports temperature reporting but it is disabled by default.
> 
> Tested:
> ls temp1_*
> temp1_crit           temp1_highest        temp1_max
> temp1_crit_alarm     temp1_input          temp1_max_alarm
> 
> cat temp1_input
> 26642
> 
> Signed-off-by: Chu Lin <linchuyuan@...gle.com>

Applied, after updating the affected driver in the subject line
(the change affects adm1272, but the driver is still the adm1275 driver).

Thanks,
Guenter

> ---
>  drivers/hwmon/pmbus/adm1275.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c
> index e7997f37b266..0be1b5777d2f 100644
> --- a/drivers/hwmon/pmbus/adm1275.c
> +++ b/drivers/hwmon/pmbus/adm1275.c
> @@ -611,11 +611,13 @@ static int adm1275_probe(struct i2c_client *client)
>  		tindex = 8;
>  
>  		info->func[0] |= PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT |
> -			PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT;
> +			PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT |
> +			PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
>  
> -		/* Enable VOUT if not enabled (it is disabled by default) */
> -		if (!(config & ADM1278_VOUT_EN)) {
> -			config |= ADM1278_VOUT_EN;
> +		/* Enable VOUT & TEMP1 if not enabled (disabled by default) */
> +		if ((config & (ADM1278_VOUT_EN | ADM1278_TEMP1_EN)) !=
> +		    (ADM1278_VOUT_EN | ADM1278_TEMP1_EN)) {
> +			config |= ADM1278_VOUT_EN | ADM1278_TEMP1_EN;
>  			ret = i2c_smbus_write_byte_data(client,
>  							ADM1275_PMON_CONFIG,
>  							config);
> @@ -625,10 +627,6 @@ static int adm1275_probe(struct i2c_client *client)
>  				return -ENODEV;
>  			}
>  		}
> -
> -		if (config & ADM1278_TEMP1_EN)
> -			info->func[0] |=
> -				PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
>  		if (config & ADM1278_VIN_EN)
>  			info->func[0] |= PMBUS_HAVE_VIN;
>  		break;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ