From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>,
Jean Delvare <khali@linux-fr.org>
Subject: [ 20/40] hwmon: (pmbus/ltc2978) Fix peak attribute handling
Date: Tue, 12 Mar 2013 15:43:41 -0700 [thread overview]
Message-ID: <20130312223213.680319637@linuxfoundation.org> (raw)
In-Reply-To: <20130312223211.492954675@linuxfoundation.org>
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <linux@roeck-us.net>
commit dbd712c2272764a536e29ad6841dba74989a39d9 upstream.
Peak attributes were not initialized and cleared correctly.
Also, temp2_max is only supported on page 0 and thus does not need to be
an array.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hwmon/pmbus/ltc2978.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
--- a/drivers/hwmon/pmbus/ltc2978.c
+++ b/drivers/hwmon/pmbus/ltc2978.c
@@ -62,7 +62,7 @@ struct ltc2978_data {
int temp_min, temp_max;
int vout_min[8], vout_max[8];
int iout_max[2];
- int temp2_max[2];
+ int temp2_max;
struct pmbus_driver_info info;
};
@@ -204,10 +204,9 @@ static int ltc3880_read_word_data(struct
ret = pmbus_read_word_data(client, page,
LTC3880_MFR_TEMPERATURE2_PEAK);
if (ret >= 0) {
- if (lin11_to_val(ret)
- > lin11_to_val(data->temp2_max[page]))
- data->temp2_max[page] = ret;
- ret = data->temp2_max[page];
+ if (lin11_to_val(ret) > lin11_to_val(data->temp2_max))
+ data->temp2_max = ret;
+ ret = data->temp2_max;
}
break;
case PMBUS_VIRT_READ_VIN_MIN:
@@ -248,11 +247,11 @@ static int ltc2978_write_word_data(struc
switch (reg) {
case PMBUS_VIRT_RESET_IOUT_HISTORY:
- data->iout_max[page] = 0x7fff;
+ data->iout_max[page] = 0x7c00;
ret = ltc2978_clear_peaks(client, page, data->id);
break;
case PMBUS_VIRT_RESET_TEMP2_HISTORY:
- data->temp2_max[page] = 0x7fff;
+ data->temp2_max = 0x7c00;
ret = ltc2978_clear_peaks(client, page, data->id);
break;
case PMBUS_VIRT_RESET_VOUT_HISTORY:
@@ -262,12 +261,12 @@ static int ltc2978_write_word_data(struc
break;
case PMBUS_VIRT_RESET_VIN_HISTORY:
data->vin_min = 0x7bff;
- data->vin_max = 0;
+ data->vin_max = 0x7c00;
ret = ltc2978_clear_peaks(client, page, data->id);
break;
case PMBUS_VIRT_RESET_TEMP_HISTORY:
data->temp_min = 0x7bff;
- data->temp_max = 0x7fff;
+ data->temp_max = 0x7c00;
ret = ltc2978_clear_peaks(client, page, data->id);
break;
default:
@@ -321,10 +320,11 @@ static int ltc2978_probe(struct i2c_clie
info = &data->info;
info->write_word_data = ltc2978_write_word_data;
- data->vout_min[0] = 0xffff;
data->vin_min = 0x7bff;
+ data->vin_max = 0x7c00;
data->temp_min = 0x7bff;
- data->temp_max = 0x7fff;
+ data->temp_max = 0x7c00;
+ data->temp2_max = 0x7c00;
switch (id->driver_data) {
case ltc2978:
@@ -336,7 +336,6 @@ static int ltc2978_probe(struct i2c_clie
for (i = 1; i < 8; i++) {
info->func[i] = PMBUS_HAVE_VOUT
| PMBUS_HAVE_STATUS_VOUT;
- data->vout_min[i] = 0xffff;
}
break;
case ltc3880:
@@ -352,11 +351,14 @@ static int ltc2978_probe(struct i2c_clie
| PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT
| PMBUS_HAVE_POUT
| PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;
- data->vout_min[1] = 0xffff;
+ data->iout_max[0] = 0x7c00;
+ data->iout_max[1] = 0x7c00;
break;
default:
return -ENODEV;
}
+ for (i = 0; i < info->pages; i++)
+ data->vout_min[i] = 0xffff;
return pmbus_do_probe(client, id, info);
}
next prev parent reply other threads:[~2013-03-12 22:43 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 22:43 [ 00/40] 3.4.36-stable review Greg Kroah-Hartman
2013-03-12 22:43 ` [ 01/40] ARM: VFP: fix emulation of second VFP instruction Greg Kroah-Hartman
2013-03-12 22:43 ` [ 02/40] ARM: fix scheduling while atomic warning in alignment handling code Greg Kroah-Hartman
2013-03-12 22:43 ` [ 03/40] xen/pci: We dont do multiple MSIs Greg Kroah-Hartman
2013-03-12 22:43 ` [ 04/40] SCSI: dc395x: uninitialized variable in device_alloc() Greg Kroah-Hartman
2013-03-12 22:43 ` [ 05/40] SCSI: storvsc: Initialize the sglist Greg Kroah-Hartman
2013-03-12 22:43 ` [ 06/40] target/pscsi: Fix page increment Greg Kroah-Hartman
2013-03-12 22:43 ` [ 07/40] btrfs: Init io_lock after cloning btrfs device struct Greg Kroah-Hartman
2013-03-12 22:43 ` [ 08/40] cifs: ensure that cifs_get_root() only traverses directories Greg Kroah-Hartman
2013-03-12 22:43 ` [ 09/40] NFS: Dont allow NFS silly-renamed files to be deleted, no signal Greg Kroah-Hartman
2013-03-12 22:43 ` [ 10/40] SUNRPC: Dont start the retransmission timer when out of socket space Greg Kroah-Hartman
2013-03-12 22:43 ` [ 11/40] ata_piix: reenable MS Virtual PC guests Greg Kroah-Hartman
2013-03-12 22:43 ` [ 12/40] hw_random: make buffer usable in scatterlist Greg Kroah-Hartman
2013-03-13 22:54 ` Satoru Takeuchi
2013-03-14 6:41 ` Rusty Russell
2013-03-14 13:24 ` [PATCH] hw_random: free rng_buffer at module exit Satoru Takeuchi
2013-03-15 5:05 ` Rusty Russell
2013-03-17 2:14 ` Ben Hutchings
2013-03-18 2:40 ` Rusty Russell
2013-03-20 0:29 ` Satoru Takeuchi
2013-03-12 22:43 ` [ 13/40] mwifiex: correct sleep delay counter Greg Kroah-Hartman
2013-03-12 22:43 ` [ 14/40] ath9k: fix RSSI dummy marker value Greg Kroah-Hartman
2013-03-12 22:43 ` [ 15/40] ath9k_hw: improve reset reliability after errors Greg Kroah-Hartman
2013-03-12 22:43 ` [ 16/40] md: protect against crash upon fsync on ro array Greg Kroah-Hartman
2013-03-12 22:43 ` [ 17/40] md: fix two bugs when attempting to resize RAID0 array Greg Kroah-Hartman
2013-03-12 22:43 ` [ 18/40] md: raid0: fix error return from create_stripe_zones Greg Kroah-Hartman
2013-03-12 22:43 ` [ 19/40] hwmon: (sht15) Check return value of regulator_enable() Greg Kroah-Hartman
2013-03-12 22:43 ` Greg Kroah-Hartman [this message]
2013-03-12 22:43 ` [ 21/40] hwmon: (pmbus/ltc2978) Use detected chip ID to select supported functionality Greg Kroah-Hartman
2013-03-12 22:43 ` [ 22/40] drm/radeon: add primary dac adj quirk for R200 board Greg Kroah-Hartman
2013-03-12 22:43 ` [ 23/40] ARM: 7663/1: perf: fix ARMv7 EVTYPE_MASK to include NSH bit Greg Kroah-Hartman
2013-03-12 22:43 ` [ 24/40] ALSA: ice1712: Initialize card->private_data properly Greg Kroah-Hartman
2013-03-12 22:43 ` [ 25/40] ALSA: vmaster: Fix slave change notification Greg Kroah-Hartman
2013-03-12 22:43 ` [ 26/40] e1000e: fix pci-device enable-counter balance Greg Kroah-Hartman
2013-03-12 22:43 ` [ 27/40] HID: logitech-dj: do not directly call hid_output_raw_report() during probe Greg Kroah-Hartman
2013-03-12 22:43 ` [ 28/40] xen/pat: Disable PAT using pat_enabled value Greg Kroah-Hartman
2013-03-12 22:43 ` [ 29/40] crypto: user - fix info leaks in report API Greg Kroah-Hartman
2013-03-12 22:43 ` [ 30/40] keys: fix race with concurrent install_user_keyrings() Greg Kroah-Hartman
2013-03-12 22:43 ` [ 31/40] Fix: compat_rw_copy_check_uvector() misuse in aio, readv, writev, and security keys Greg Kroah-Hartman
2013-03-12 22:43 ` [ 32/40] vfs: fix pipe counter breakage Greg Kroah-Hartman
2013-03-12 22:43 ` [ 33/40] rtc: rtc-mv: Add support for clk to avoid lockups Greg Kroah-Hartman
2013-03-12 23:08 ` Jason Cooper
2013-03-12 23:15 ` Greg Kroah-Hartman
2013-03-12 22:43 ` [ 34/40] Fix memory leak in cpufreq stats Greg Kroah-Hartman
2013-03-12 22:43 ` [ 35/40] ftrace: Update the kconfig for DYNAMIC_FTRACE Greg Kroah-Hartman
2013-03-12 22:43 ` [ 36/40] dmi_scan: fix missing check for _DMI_ signature in smbios_present() Greg Kroah-Hartman
2013-03-12 22:43 ` [ 37/40] USB: Dont use EHCI port sempahore for USB 3.0 hubs Greg Kroah-Hartman
2013-03-12 22:43 ` [ 38/40] USB: Prepare for refactoring by adding extra udev checks Greg Kroah-Hartman
2013-03-12 22:44 ` [ 39/40] USB: Rip out recursive call on warm port reset Greg Kroah-Hartman
2013-03-12 22:44 ` [ 40/40] Revert "ALSA: hda - hdmi: Make jacks phantom, if theyre not detectable" Greg Kroah-Hartman
2013-03-13 3:57 ` [ 00/40] 3.4.36-stable review Shuah Khan
2013-03-14 13:39 ` Satoru Takeuchi
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=20130312223213.680319637@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=stable@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;
as well as URLs for NNTP newsgroup(s).