Re: [PATCH] hwmon: (nct6683) Return -EBUSY if a fan curve is no longer supported
From: Guenter Roeck
Date: Sun Nov 29 2026 - 13:25:44 EST
On Sun, Nov 29, 2026 at 06:43:05PM +0100, Tomasz Bojanowski wrote:
> Before writing a point of a fan curve, the driver checks that it still
> supports the curve which is set in the EC. If it does not, nothing is
> written, so this is not an I/O error. Return -EBUSY instead of -EIO.
>
> Writing pwmN_auto_channels_temp already returns -EBUSY if its check of the
> current temperature source fails.
>
> -EIO is still returned if the EC does not take the new curve. Document
> both, and that the check includes whether the curve sets a duty cycle.
>
> Compile tested.
>
> Signed-off-by: Tomasz Bojanowski <tomasz@xxxxxxxxxxxxx>
Applied.
On a side note, I tested the recent changes on boards with
NCT6683_CUSTOMER_ID_MSI3 (MAG B650M MORTAR WIFI (MS-7D76) and MAG B650
TOMAHAWK WIFI (MS-7D75)). This is what I get on the Tomahawk board:
pwm1:87
pwm1_auto_channels_temp:1
pwm1_auto_point1_pwm:51
pwm1_auto_point1_temp:0
pwm1_auto_point2_pwm:89
pwm1_auto_point2_temp:45000
pwm1_auto_point3_pwm:178
pwm1_auto_point3_temp:65000
pwm1_auto_point4_pwm:255
pwm1_auto_point4_temp:80000
pwm1_auto_point5_pwm:255
pwm1_auto_point5_temp:80000
pwm1_auto_point6_pwm:255
pwm1_auto_point6_temp:80000
pwm1_auto_point7_pwm:255
pwm1_auto_point7_temp:80000
pwm1_enable:2
pwm1_step_down_time:100
pwm1_step_up_time:100
pwm2:255
pwm2_auto_channels_temp:1
pwm2_auto_point1_pwm:255
pwm2_auto_point1_temp:32000
pwm2_auto_point2_pwm:255
pwm2_auto_point2_temp:32000
pwm2_auto_point3_pwm:255
pwm2_auto_point3_temp:32000
pwm2_auto_point4_pwm:255
pwm2_auto_point4_temp:32000
pwm2_auto_point5_pwm:255
pwm2_auto_point5_temp:32000
pwm2_auto_point6_pwm:255
pwm2_auto_point6_temp:32000
pwm2_auto_point7_pwm:255
pwm2_auto_point7_temp:32000
pwm2_enable:2
pwm2_step_down_time:100
pwm2_step_up_time:100
pwm3:87
pwm4:153
pwm5:79
pwm6:153
pwm7:153
pwm8:97
and:
fan10_input:0
fan10_min:0
fan10_pulses:2
fan1_input:825
fan1_min:0
fan1_pulses:2
fan2_input:0
fan2_min:0
fan2_pulses:2
fan3_input:775
fan3_min:0
fan3_pulses:2
fan4_input:0
fan4_min:0
fan4_pulses:2
fan5_input:707
fan5_min:0
fan5_pulses:2
fan6_input:0
fan6_min:0
fan6_pulses:2
fan7_input:0
fan7_min:0
fan7_pulses:2
fan8_input:598
fan8_min:0
fan8_pulses:2
fan9_input:0
fan9_min:0
fan9_pulses:2
On the Mortar board a fan is connected to pwm2/fan2, so the data for that
channel works as expected.
pwm control is enabled on all fans. I don't know if that means that pwm3+
have a different register set. Either case, I figured that it would be too
risky to enable pwm control for these boards; I just wanted to let you
know.
Thanks,
Guenter