Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: hwmon: (k8temp) Bypass core swapping on single-core processors hwmon: (i5k_amb) Fix sysfs attribute for lockdep hwmon: (k10temp) Do not blacklist known working CPU models
This commit is contained in:
commit
d94b20497b
3 changed files with 19 additions and 3 deletions
|
@ -289,6 +289,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
|
|||
iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
|
||||
iattr->s_attr.dev_attr.show = show_label;
|
||||
iattr->s_attr.index = k;
|
||||
sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
|
||||
res = device_create_file(&pdev->dev,
|
||||
&iattr->s_attr.dev_attr);
|
||||
if (res)
|
||||
|
@ -303,6 +304,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
|
|||
iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
|
||||
iattr->s_attr.dev_attr.show = show_amb_temp;
|
||||
iattr->s_attr.index = k;
|
||||
sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
|
||||
res = device_create_file(&pdev->dev,
|
||||
&iattr->s_attr.dev_attr);
|
||||
if (res)
|
||||
|
@ -318,6 +320,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
|
|||
iattr->s_attr.dev_attr.show = show_amb_min;
|
||||
iattr->s_attr.dev_attr.store = store_amb_min;
|
||||
iattr->s_attr.index = k;
|
||||
sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
|
||||
res = device_create_file(&pdev->dev,
|
||||
&iattr->s_attr.dev_attr);
|
||||
if (res)
|
||||
|
@ -333,6 +336,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
|
|||
iattr->s_attr.dev_attr.show = show_amb_mid;
|
||||
iattr->s_attr.dev_attr.store = store_amb_mid;
|
||||
iattr->s_attr.index = k;
|
||||
sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
|
||||
res = device_create_file(&pdev->dev,
|
||||
&iattr->s_attr.dev_attr);
|
||||
if (res)
|
||||
|
@ -348,6 +352,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
|
|||
iattr->s_attr.dev_attr.show = show_amb_max;
|
||||
iattr->s_attr.dev_attr.store = store_amb_max;
|
||||
iattr->s_attr.index = k;
|
||||
sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
|
||||
res = device_create_file(&pdev->dev,
|
||||
&iattr->s_attr.dev_attr);
|
||||
if (res)
|
||||
|
@ -362,6 +367,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
|
|||
iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
|
||||
iattr->s_attr.dev_attr.show = show_amb_alarm;
|
||||
iattr->s_attr.index = k;
|
||||
sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
|
||||
res = device_create_file(&pdev->dev,
|
||||
&iattr->s_attr.dev_attr);
|
||||
if (res)
|
||||
|
|
|
@ -112,11 +112,21 @@ static bool __devinit has_erratum_319(struct pci_dev *pdev)
|
|||
if (pkg_type != CPUID_PKGTYPE_AM2R2_AM3)
|
||||
return false;
|
||||
|
||||
/* Differentiate between AM2+ (bad) and AM3 (good) */
|
||||
/* DDR3 memory implies socket AM3, which is good */
|
||||
pci_bus_read_config_dword(pdev->bus,
|
||||
PCI_DEVFN(PCI_SLOT(pdev->devfn), 2),
|
||||
REG_DCT0_CONFIG_HIGH, ®_dram_cfg);
|
||||
return !(reg_dram_cfg & DDR3_MODE);
|
||||
if (reg_dram_cfg & DDR3_MODE)
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Unfortunately it is possible to run a socket AM3 CPU with DDR2
|
||||
* memory. We blacklist all the cores which do exist in socket AM2+
|
||||
* format. It still isn't perfect, as RB-C2 cores exist in both AM2+
|
||||
* and AM3 formats, but that's the best we can do.
|
||||
*/
|
||||
return boot_cpu_data.x86_model < 4 ||
|
||||
(boot_cpu_data.x86_model == 4 && boot_cpu_data.x86_mask <= 2);
|
||||
}
|
||||
|
||||
static int __devinit k10temp_probe(struct pci_dev *pdev,
|
||||
|
|
|
@ -120,7 +120,7 @@ static ssize_t show_temp(struct device *dev,
|
|||
int temp;
|
||||
struct k8temp_data *data = k8temp_update_device(dev);
|
||||
|
||||
if (data->swap_core_select)
|
||||
if (data->swap_core_select && (data->sensorsp & SEL_CORE))
|
||||
core = core ? 0 : 1;
|
||||
|
||||
temp = TEMP_FROM_REG(data->temp[core][place]) + data->temp_offset;
|
||||
|
|
Loading…
Reference in a new issue