Commit f0b364a1 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq

* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] Make acpi-cpufreq unsticky again.
  [CPUFREQ] longhaul: remove duplicated code.
  [CPUFREQ] Longhaul - Disable arbiter CLE266
  [CPUFREQ] Fix section mismatch warning
  [CPUFREQ] Fix cut-n-paste bug in suspend printk
parents 5a73fdc5 bfeeb0f5
...@@ -396,13 +396,13 @@ static int acpi_cpufreq_early_init_acpi(void) ...@@ -396,13 +396,13 @@ static int acpi_cpufreq_early_init_acpi(void)
*/ */
static int bios_with_sw_any_bug; static int bios_with_sw_any_bug;
static int __init sw_any_bug_found(struct dmi_system_id *d) static int sw_any_bug_found(struct dmi_system_id *d)
{ {
bios_with_sw_any_bug = 1; bios_with_sw_any_bug = 1;
return 0; return 0;
} }
static struct dmi_system_id __initdata sw_any_bug_dmi_table[] = { static struct dmi_system_id sw_any_bug_dmi_table[] = {
{ {
.callback = sw_any_bug_found, .callback = sw_any_bug_found,
.ident = "Supermicro Server X6DLP", .ident = "Supermicro Server X6DLP",
...@@ -597,7 +597,6 @@ static struct cpufreq_driver acpi_cpufreq_driver = { ...@@ -597,7 +597,6 @@ static struct cpufreq_driver acpi_cpufreq_driver = {
.name = "acpi-cpufreq", .name = "acpi-cpufreq",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.attr = acpi_cpufreq_attr, .attr = acpi_cpufreq_attr,
.flags = CPUFREQ_STICKY,
}; };
......
...@@ -178,11 +178,17 @@ static void do_powersaver(int cx_address, unsigned int clock_ratio_index) ...@@ -178,11 +178,17 @@ static void do_powersaver(int cx_address, unsigned int clock_ratio_index)
safe_halt(); safe_halt();
/* Change frequency on next halt or sleep */ /* Change frequency on next halt or sleep */
wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);
if (port22_en) {
ACPI_FLUSH_CPU_CACHE();
/* Invoke C1 */
halt();
} else {
ACPI_FLUSH_CPU_CACHE(); ACPI_FLUSH_CPU_CACHE();
/* Invoke C3 */ /* Invoke C3 */
inb(cx_address); inb(cx_address);
/* Dummy op - must do something useless after P_LVL3 read */ /* Dummy op - must do something useless after P_LVL3 read */
t = inl(acpi_fadt.xpm_tmr_blk.address); t = inl(acpi_fadt.xpm_tmr_blk.address);
}
/* Disable bus ratio bit */ /* Disable bus ratio bit */
local_irq_disable(); local_irq_disable();
...@@ -567,16 +573,23 @@ static acpi_status longhaul_walk_callback(acpi_handle obj_handle, ...@@ -567,16 +573,23 @@ static acpi_status longhaul_walk_callback(acpi_handle obj_handle,
static int enable_arbiter_disable(void) static int enable_arbiter_disable(void)
{ {
struct pci_dev *dev; struct pci_dev *dev;
int reg;
u8 pci_cmd; u8 pci_cmd;
/* Find PLE133 host bridge */ /* Find PLE133 host bridge */
reg = 0x78;
dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8601_0, NULL); dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8601_0, NULL);
/* Find CLE266 host bridge */
if (dev == NULL) {
reg = 0x76;
dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_862X_0, NULL);
}
if (dev != NULL) { if (dev != NULL) {
/* Enable access to port 0x22 */ /* Enable access to port 0x22 */
pci_read_config_byte(dev, 0x78, &pci_cmd); pci_read_config_byte(dev, reg, &pci_cmd);
if ( !(pci_cmd & 1<<7) ) { if ( !(pci_cmd & 1<<7) ) {
pci_cmd |= 1<<7; pci_cmd |= 1<<7;
pci_write_config_byte(dev, 0x78, pci_cmd); pci_write_config_byte(dev, reg, pci_cmd);
} }
return 1; return 1;
} }
...@@ -680,19 +693,24 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy) ...@@ -680,19 +693,24 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
if (longhaul_version == TYPE_POWERSAVER) { if (longhaul_version == TYPE_POWERSAVER) {
/* Check ACPI support for C3 state */ /* Check ACPI support for C3 state */
cx = &pr->power.states[ACPI_STATE_C3]; cx = &pr->power.states[ACPI_STATE_C3];
if (cx->address == 0 || if (cx->address > 0 &&
(cx->latency > 1000 && ignore_latency == 0) ) (cx->latency <= 1000 || ignore_latency != 0) ) {
goto err_acpi; goto print_support_type;
}
} else { }
/* Check ACPI support for bus master arbiter disable */ /* Check ACPI support for bus master arbiter disable */
if (!pr->flags.bm_control) { if (!pr->flags.bm_control) {
if (!enable_arbiter_disable()) { if (enable_arbiter_disable()) {
printk(KERN_ERR PFX "No ACPI support. No VT8601 host bridge. Aborting.\n");
return -ENODEV;
} else
port22_en = 1; port22_en = 1;
} else {
goto err_acpi;
}
} }
print_support_type:
if (!port22_en) {
printk (KERN_INFO PFX "Using ACPI support.\n");
} else {
printk (KERN_INFO PFX "Using northbridge support.\n");
} }
ret = longhaul_get_ranges(); ret = longhaul_get_ranges();
...@@ -716,7 +734,7 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy) ...@@ -716,7 +734,7 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
return 0; return 0;
err_acpi: err_acpi:
printk(KERN_ERR PFX "No ACPI support for CPU frequency changes.\n"); printk(KERN_ERR PFX "No ACPI support. No VT8601 or VT8623 northbridge. Aborting.\n");
return -ENODEV; return -ENODEV;
} }
......
...@@ -386,7 +386,7 @@ static int centrino_cpu_early_init_acpi(void) ...@@ -386,7 +386,7 @@ static int centrino_cpu_early_init_acpi(void)
* than OS intended it to run at. Detect it and handle it cleanly. * than OS intended it to run at. Detect it and handle it cleanly.
*/ */
static int bios_with_sw_any_bug; static int bios_with_sw_any_bug;
static int __init sw_any_bug_found(struct dmi_system_id *d) static int sw_any_bug_found(struct dmi_system_id *d)
{ {
bios_with_sw_any_bug = 1; bios_with_sw_any_bug = 1;
return 0; return 0;
......
...@@ -994,7 +994,7 @@ static int cpufreq_suspend(struct sys_device * sysdev, pm_message_t pmsg) ...@@ -994,7 +994,7 @@ static int cpufreq_suspend(struct sys_device * sysdev, pm_message_t pmsg)
unsigned int cur_freq = 0; unsigned int cur_freq = 0;
struct cpufreq_policy *cpu_policy; struct cpufreq_policy *cpu_policy;
dprintk("resuming cpu %u\n", cpu); dprintk("suspending cpu %u\n", cpu);
if (!cpu_online(cpu)) if (!cpu_online(cpu))
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment