Patch "hwmon: (nct6775) Fix fan speed set failure in automatic mode" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    hwmon: (nct6775) Fix fan speed set failure in automatic mode

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hwmon-nct6775-fix-fan-speed-set-failure-in-automatic.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ea4c03ce6cbf520ca91e8b6ce4d9958f54283a3f
Author: Xing Tong Wu <xingtong.wu@xxxxxxxxxxx>
Date:   Tue Nov 21 16:16:04 2023 +0800

    hwmon: (nct6775) Fix fan speed set failure in automatic mode
    
    [ Upstream commit 8b3800256abad20e91c2698607f9b28591407b19 ]
    
    Setting the fan speed is only valid in manual mode; it is not possible
    to set the fan's speed in automatic mode.
    Return error when attempting to set the fan speed in automatic mode.
    
    Signed-off-by: Xing Tong Wu <xingtong.wu@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20231121081604.2499-3-xingtong_wu@xxxxxxx
    Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index 80310845fb99..9720ad214c20 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -2462,6 +2462,13 @@ store_pwm(struct device *dev, struct device_attribute *attr, const char *buf,
 	int err;
 	u16 reg;
 
+	/*
+	 * The fan control mode should be set to manual if the user wants to adjust
+	 * the fan speed. Otherwise, it will fail to set.
+	 */
+	if (index == 0 && data->pwm_enable[nr] > manual)
+		return -EBUSY;
+
 	err = kstrtoul(buf, 10, &val);
 	if (err < 0)
 		return err;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux