From: Greg Kroah-Hartman Date: Tue, 25 Sep 2012 21:04:58 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.0.44~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=350f346ba338b24a47267515f478fdc3f69df7c3;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: hwmon-ads7871-add-name-sysfs-attribute.patch hwmon-fam15h_power-tweak-runavg_range-on-resume.patch --- diff --git a/queue-3.0/hwmon-ads7871-add-name-sysfs-attribute.patch b/queue-3.0/hwmon-ads7871-add-name-sysfs-attribute.patch new file mode 100644 index 00000000000..236a7ecf9b9 --- /dev/null +++ b/queue-3.0/hwmon-ads7871-add-name-sysfs-attribute.patch @@ -0,0 +1,54 @@ +From 4e21f4eaa49f78d3e977e316514c941053871c76 Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Tue, 11 Sep 2012 13:39:08 -0700 +Subject: hwmon: (ads7871) Add 'name' sysfs attribute + +From: Guenter Roeck + +commit 4e21f4eaa49f78d3e977e316514c941053871c76 upstream. + +The 'name' sysfs attribute is mandatory for hwmon devices, but was missing +in this driver. + +Cc: Paul Thomas +Signed-off-by: Guenter Roeck +Acked-by: Jean Delvare +Acked-by: Paul Thomas +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hwmon/ads7871.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/hwmon/ads7871.c ++++ b/drivers/hwmon/ads7871.c +@@ -133,6 +133,12 @@ static ssize_t show_voltage(struct devic + } + } + ++static ssize_t ads7871_show_name(struct device *dev, ++ struct device_attribute *devattr, char *buf) ++{ ++ return sprintf(buf, "%s\n", to_spi_device(dev)->modalias); ++} ++ + static SENSOR_DEVICE_ATTR(in0_input, S_IRUGO, show_voltage, NULL, 0); + static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, show_voltage, NULL, 1); + static SENSOR_DEVICE_ATTR(in2_input, S_IRUGO, show_voltage, NULL, 2); +@@ -142,6 +148,8 @@ static SENSOR_DEVICE_ATTR(in5_input, S_I + static SENSOR_DEVICE_ATTR(in6_input, S_IRUGO, show_voltage, NULL, 6); + static SENSOR_DEVICE_ATTR(in7_input, S_IRUGO, show_voltage, NULL, 7); + ++static DEVICE_ATTR(name, S_IRUGO, ads7871_show_name, NULL); ++ + static struct attribute *ads7871_attributes[] = { + &sensor_dev_attr_in0_input.dev_attr.attr, + &sensor_dev_attr_in1_input.dev_attr.attr, +@@ -151,6 +159,7 @@ static struct attribute *ads7871_attribu + &sensor_dev_attr_in5_input.dev_attr.attr, + &sensor_dev_attr_in6_input.dev_attr.attr, + &sensor_dev_attr_in7_input.dev_attr.attr, ++ &dev_attr_name.attr, + NULL + }; + diff --git a/queue-3.0/hwmon-fam15h_power-tweak-runavg_range-on-resume.patch b/queue-3.0/hwmon-fam15h_power-tweak-runavg_range-on-resume.patch new file mode 100644 index 00000000000..4956a293f25 --- /dev/null +++ b/queue-3.0/hwmon-fam15h_power-tweak-runavg_range-on-resume.patch @@ -0,0 +1,67 @@ +From 5f0ecb907deb1e6f28071ee3bd568903b9da1be4 Mon Sep 17 00:00:00 2001 +From: Andreas Herrmann +Date: Sun, 23 Sep 2012 20:27:32 +0200 +Subject: hwmon: (fam15h_power) Tweak runavg_range on resume + +From: Andreas Herrmann + +commit 5f0ecb907deb1e6f28071ee3bd568903b9da1be4 upstream. + +The quirk introduced with commit +00250ec90963b7ef6678438888f3244985ecde14 (hwmon: fam15h_power: fix +bogus values with current BIOSes) is not only required during driver +load but also when system resumes from suspend. The BIOS might set the +previously recommended (but unsuitable) initilization value for the +running average range register during resume. + +Signed-off-by: Andreas Herrmann +Tested-by: Andreas Hartmann +Signed-off-by: Jean Delvare +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hwmon/fam15h_power.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +--- a/drivers/hwmon/fam15h_power.c ++++ b/drivers/hwmon/fam15h_power.c +@@ -128,12 +128,12 @@ static bool __devinit fam15h_power_is_in + * counter saturations resulting in bogus power readings. + * We correct this value ourselves to cope with older BIOSes. + */ +-static DEFINE_PCI_DEVICE_TABLE(affected_device) = { ++static const struct pci_device_id affected_device[] = { + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) }, + { 0 } + }; + +-static void __devinit tweak_runavg_range(struct pci_dev *pdev) ++static void tweak_runavg_range(struct pci_dev *pdev) + { + u32 val; + +@@ -157,6 +157,16 @@ static void __devinit tweak_runavg_range + REG_TDP_RUNNING_AVERAGE, val); + } + ++#ifdef CONFIG_PM ++static int fam15h_power_resume(struct pci_dev *pdev) ++{ ++ tweak_runavg_range(pdev); ++ return 0; ++} ++#else ++#define fam15h_power_resume NULL ++#endif ++ + static void __devinit fam15h_power_init_data(struct pci_dev *f4, + struct fam15h_power_data *data) + { +@@ -255,6 +265,7 @@ static struct pci_driver fam15h_power_dr + .id_table = fam15h_power_id_table, + .probe = fam15h_power_probe, + .remove = __devexit_p(fam15h_power_remove), ++ .resume = fam15h_power_resume, + }; + + static int __init fam15h_power_init(void) diff --git a/queue-3.0/series b/queue-3.0/series index 7a8ce514031..4ac90dbdea0 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -49,3 +49,5 @@ can-mcp251x-avoid-repeated-frame-bug.patch mm-ia64-fix-a-memory-block-size-bug.patch memory-hotplug-fix-section-info-double-registration-bug.patch xen-boot-disable-numa-for-pv-guests.patch +hwmon-fam15h_power-tweak-runavg_range-on-resume.patch +hwmon-ads7871-add-name-sysfs-attribute.patch