From: Guenter Roeck <linux@roeck-us.net>
To: Hardware Monitoring <linux-hwmon@vger.kernel.org>
Cc: Jean Delvare <jdelvare@suse.com>, Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 4/7] hwmon: (it87) Ensure that pwm control cache is current before updating values
Date: Thu, 9 Feb 2017 07:06:12 -0800 [thread overview]
Message-ID: <1486652775-3926-4-git-send-email-linux@roeck-us.net> (raw)
In-Reply-To: <1486652775-3926-1-git-send-email-linux@roeck-us.net>
If sensor attributes were never read, the pwm control data has not been
initiialized, which can cause wrong driver behavior. Ensure that cached
data is current before acting on it.
Cc: stable@vger.kernel.org # 4.4+
Reported-by: Kevin Folz <kfolz@evertz.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/hwmon/it87.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 11a28b233006..85918d8a747a 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -1360,6 +1360,7 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
return -EINVAL;
mutex_lock(&data->update_lock);
+ it87_update_pwm_ctrl(data, nr);
if (has_newer_autopwm(data)) {
/*
* If we are in automatic mode, the PWM duty cycle register
@@ -1472,6 +1473,7 @@ static ssize_t set_pwm_temp_map(struct device *dev,
}
mutex_lock(&data->update_lock);
+ it87_update_pwm_ctrl(data, nr);
data->pwm_temp_map[nr] = reg;
/*
* If we are in automatic mode, write the temp mapping immediately;
--
2.7.4
next prev parent reply other threads:[~2017-02-09 17:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-09 15:06 [PATCH 1/7] hwmon: (it87) Add feature flag indicating that VIN3 is connected to 5V Guenter Roeck
2017-02-09 15:06 ` [PATCH 2/7] hwmon: (it87) Add support for IT8622E Guenter Roeck
2017-02-09 15:06 ` [PATCH 3/7] hwmon: (it87) Improve IT8622 support Guenter Roeck
2017-02-09 15:06 ` Guenter Roeck [this message]
2017-02-09 15:06 ` [PATCH 5/7] hwmon: (it87) Fix pwm4 detection for IT8620 and IT8628 Guenter Roeck
2017-02-09 15:06 ` [PATCH 6/7] hwmon: (it87) Do not overwrite bit 2..6 of pwm control registers Guenter Roeck
2017-02-09 15:06 ` [PATCH 7/7] hwmon: (it87) Add support for IT8792E Guenter Roeck
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=1486652775-3926-4-git-send-email-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
/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