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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 16 Nov 2023 17:35:20 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     Xing Tong Wu <xingtong_wu@....com>,
        Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     xingtong.wu@...mens.com, tobias.schaffner@...mens.com,
        gerd.haeussler.ext@...mens.com
Subject: Re: [PATCH 1/3] hwmon: (nct6775) Fix incomplete register array

On 11/15/23 18:23, Xing Tong Wu wrote:
> From: Xing Tong Wu <xingtong.wu@...mens.com>
> 
> The nct6116 specification actually includes 5 PWMs, but only 3
> PWMs are present in the array. To address this, the missing 2
> PWMs have been added to the array.
> 
> Signed-off-by: Xing Tong Wu <xingtong.wu@...mens.com>
> ---
>   drivers/hwmon/nct6775-core.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
> index d928eb8ae5a3..2111f0cd9787 100644
> --- a/drivers/hwmon/nct6775-core.c
> +++ b/drivers/hwmon/nct6775-core.c
> @@ -769,7 +769,7 @@ static const u16 NCT6106_FAN_PULSE_SHIFT[] = { 0, 2, 4 };
>   
>   static const u8 NCT6106_REG_PWM_MODE[] = { 0xf3, 0xf3, 0xf3 };
>   static const u8 NCT6106_PWM_MODE_MASK[] = { 0x01, 0x02, 0x04 };
> -static const u16 NCT6106_REG_PWM_READ[] = { 0x4a, 0x4b, 0x4c };
> +static const u16 NCT6106_REG_PWM_READ[] = { 0x4a, 0x4b, 0x4c, 0xd8, 0xd9 };

I have no idea where you got the above register addresses from. Looking at
the datasheet, NCT6116 doesn't use those registers at all, and neither does
NCT6106. The PWM registers for NCT6116 are

static const u16 NCT6116_REG_PWM[] = { 0x119, 0x129, 0x139, 0x199, 0x1a9 };

>   static const u16 NCT6106_REG_FAN_MODE[] = { 0x113, 0x123, 0x133 };
>   static const u16 NCT6106_REG_TEMP_SOURCE[] = {
>   	0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5 };
> @@ -3595,7 +3595,7 @@ int nct6775_probe(struct device *dev, struct nct6775_data *data,
>   		break;
>   	case nct6116:
>   		data->in_num = 9;
> -		data->pwm_num = 3;
> +		data->pwm_num = 5;

This does look correct, though.

Guenter

>   		data->auto_pwm_num = 4;
>   		data->temp_fixed_num = 3;
>   		data->num_temp_alarms = 3;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ