Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154178
b: refs/heads/master
c: 7b768f0
h: refs/heads/master
v: v3
  • Loading branch information
Pallipadi, Venkatesh authored and Len Brown committed Jun 20, 2009
1 parent 7ae1e08 commit be46ab7
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 115 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e275cc4e8e20f82740bf40ae2f5695e9e35ff09
refs/heads/master: 7b768f07dce463a054c9dd84862d15ccc3d2b712
12 changes: 12 additions & 0 deletions trunk/arch/ia64/kernel/acpi-processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,15 @@ void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
}

EXPORT_SYMBOL(arch_acpi_processor_init_pdc);

void arch_acpi_processor_cleanup_pdc(struct acpi_processor *pr)
{
if (pr->pdc) {
kfree(pr->pdc->pointer->buffer.pointer);
kfree(pr->pdc->pointer);
kfree(pr->pdc);
pr->pdc = NULL;
}
}

EXPORT_SYMBOL(arch_acpi_processor_cleanup_pdc);
1 change: 0 additions & 1 deletion trunk/arch/x86/include/asm/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate)

#else /* !CONFIG_ACPI */

#define acpi_disabled 1
#define acpi_lapic 0
#define acpi_ioapic 0
static inline void acpi_noirq_set(void) { }
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/x86/include/asm/pci_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ extern int __init pcibios_init(void);
extern int __init pci_mmcfg_arch_init(void);
extern void __init pci_mmcfg_arch_free(void);

extern struct acpi_mcfg_allocation *pci_mmcfg_config;
extern int pci_mmcfg_config_num;

/*
* AMD Fam10h CPUs are buggy, and cannot access MMIO config space
* on their northbrige except through the * %eax register. As such, you MUST
Expand Down
80 changes: 79 additions & 1 deletion trunk/arch/x86/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@

static int __initdata acpi_force = 0;
u32 acpi_rsdt_forced;
int acpi_disabled;
#ifdef CONFIG_ACPI
int acpi_disabled = 0;
#else
int acpi_disabled = 1;
#endif
EXPORT_SYMBOL(acpi_disabled);

#ifdef CONFIG_X86_64
Expand Down Expand Up @@ -117,6 +121,72 @@ void __init __acpi_unmap_table(char *map, unsigned long size)
early_iounmap(map, size);
}

#ifdef CONFIG_PCI_MMCONFIG

static int acpi_mcfg_64bit_base_addr __initdata = FALSE;

/* The physical address of the MMCONFIG aperture. Set from ACPI tables. */
struct acpi_mcfg_allocation *pci_mmcfg_config;
int pci_mmcfg_config_num;

static int __init acpi_mcfg_oem_check(struct acpi_table_mcfg *mcfg)
{
if (!strcmp(mcfg->header.oem_id, "SGI"))
acpi_mcfg_64bit_base_addr = TRUE;

return 0;
}

int __init acpi_parse_mcfg(struct acpi_table_header *header)
{
struct acpi_table_mcfg *mcfg;
unsigned long i;
int config_size;

if (!header)
return -EINVAL;

mcfg = (struct acpi_table_mcfg *)header;

/* how many config structures do we have */
pci_mmcfg_config_num = 0;
i = header->length - sizeof(struct acpi_table_mcfg);
while (i >= sizeof(struct acpi_mcfg_allocation)) {
++pci_mmcfg_config_num;
i -= sizeof(struct acpi_mcfg_allocation);
};
if (pci_mmcfg_config_num == 0) {
printk(KERN_ERR PREFIX "MMCONFIG has no entries\n");
return -ENODEV;
}

config_size = pci_mmcfg_config_num * sizeof(*pci_mmcfg_config);
pci_mmcfg_config = kmalloc(config_size, GFP_KERNEL);
if (!pci_mmcfg_config) {
printk(KERN_WARNING PREFIX
"No memory for MCFG config tables\n");
return -ENOMEM;
}

memcpy(pci_mmcfg_config, &mcfg[1], config_size);

acpi_mcfg_oem_check(mcfg);

for (i = 0; i < pci_mmcfg_config_num; ++i) {
if ((pci_mmcfg_config[i].address > 0xFFFFFFFF) &&
!acpi_mcfg_64bit_base_addr) {
printk(KERN_ERR PREFIX
"MMCONFIG not in low 4GB of memory\n");
kfree(pci_mmcfg_config);
pci_mmcfg_config_num = 0;
return -ENODEV;
}
}

return 0;
}
#endif /* CONFIG_PCI_MMCONFIG */

#ifdef CONFIG_X86_LOCAL_APIC
static int __init acpi_parse_madt(struct acpi_table_header *table)
{
Expand Down Expand Up @@ -1497,6 +1567,14 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Workstation W8000"),
},
},
{
.callback = force_acpi_ht,
.ident = "ASUS P4B266",
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
DMI_MATCH(DMI_BOARD_NAME, "P4B266"),
},
},
{
.callback = force_acpi_ht,
.ident = "ASUS P2B-DS",
Expand Down
13 changes: 13 additions & 0 deletions trunk/arch/x86/kernel/acpi/processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
return;
}


/* Initialize _PDC data based on the CPU vendor */
void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
{
Expand All @@ -85,3 +86,15 @@ void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
}

EXPORT_SYMBOL(arch_acpi_processor_init_pdc);

void arch_acpi_processor_cleanup_pdc(struct acpi_processor *pr)
{
if (pr->pdc) {
kfree(pr->pdc->pointer->buffer.pointer);
kfree(pr->pdc->pointer);
kfree(pr->pdc);
pr->pdc = NULL;
}
}

EXPORT_SYMBOL(arch_acpi_processor_cleanup_pdc);
65 changes: 1 addition & 64 deletions trunk/arch/x86/pci/mmconfig-shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,69 +523,6 @@ static void __init pci_mmcfg_reject_broken(int early)

static int __initdata known_bridge;

static int acpi_mcfg_64bit_base_addr __initdata = FALSE;

/* The physical address of the MMCONFIG aperture. Set from ACPI tables. */
struct acpi_mcfg_allocation *pci_mmcfg_config;
int pci_mmcfg_config_num;

static int __init acpi_mcfg_oem_check(struct acpi_table_mcfg *mcfg)
{
if (!strcmp(mcfg->header.oem_id, "SGI"))
acpi_mcfg_64bit_base_addr = TRUE;

return 0;
}

static int __init pci_parse_mcfg(struct acpi_table_header *header)
{
struct acpi_table_mcfg *mcfg;
unsigned long i;
int config_size;

if (!header)
return -EINVAL;

mcfg = (struct acpi_table_mcfg *)header;

/* how many config structures do we have */
pci_mmcfg_config_num = 0;
i = header->length - sizeof(struct acpi_table_mcfg);
while (i >= sizeof(struct acpi_mcfg_allocation)) {
++pci_mmcfg_config_num;
i -= sizeof(struct acpi_mcfg_allocation);
};
if (pci_mmcfg_config_num == 0) {
printk(KERN_ERR PREFIX "MMCONFIG has no entries\n");
return -ENODEV;
}

config_size = pci_mmcfg_config_num * sizeof(*pci_mmcfg_config);
pci_mmcfg_config = kmalloc(config_size, GFP_KERNEL);
if (!pci_mmcfg_config) {
printk(KERN_WARNING PREFIX
"No memory for MCFG config tables\n");
return -ENOMEM;
}

memcpy(pci_mmcfg_config, &mcfg[1], config_size);

acpi_mcfg_oem_check(mcfg);

for (i = 0; i < pci_mmcfg_config_num; ++i) {
if ((pci_mmcfg_config[i].address > 0xFFFFFFFF) &&
!acpi_mcfg_64bit_base_addr) {
printk(KERN_ERR PREFIX
"MMCONFIG not in low 4GB of memory\n");
kfree(pci_mmcfg_config);
pci_mmcfg_config_num = 0;
return -ENODEV;
}
}

return 0;
}

static void __init __pci_mmcfg_init(int early)
{
/* MMCONFIG disabled */
Expand All @@ -606,7 +543,7 @@ static void __init __pci_mmcfg_init(int early)
}

if (!known_bridge)
acpi_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg);
acpi_table_parse(ACPI_SIG_MCFG, acpi_parse_mcfg);

pci_mmcfg_reject_broken(early);

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/acpi/processor_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,8 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
/* _PDC call should be done before doing anything else (if reqd.). */
arch_acpi_processor_init_pdc(pr);
acpi_processor_set_pdc(pr);
arch_acpi_processor_cleanup_pdc(pr);

#ifdef CONFIG_CPU_FREQ
acpi_processor_ppc_has_changed(pr);
#endif
Expand Down
40 changes: 22 additions & 18 deletions trunk/drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static void acpi_safe_halt(void)
* are affected too. We pick the most conservative approach: we assume
* that the local APIC stops in both C2 and C3.
*/
static void lapic_timer_check_state(int state, struct acpi_processor *pr,
static void acpi_timer_check_state(int state, struct acpi_processor *pr,
struct acpi_processor_cx *cx)
{
struct acpi_processor_power *pwr = &pr->power;
Expand All @@ -162,7 +162,7 @@ static void lapic_timer_check_state(int state, struct acpi_processor *pr,
pr->power.timer_broadcast_on_state = state;
}

static void lapic_timer_propagate_broadcast(struct acpi_processor *pr)
static void acpi_propagate_timer_broadcast(struct acpi_processor *pr)
{
unsigned long reason;

Expand All @@ -173,7 +173,7 @@ static void lapic_timer_propagate_broadcast(struct acpi_processor *pr)
}

/* Power(C) State timer broadcast control */
static void lapic_timer_state_broadcast(struct acpi_processor *pr,
static void acpi_state_timer_broadcast(struct acpi_processor *pr,
struct acpi_processor_cx *cx,
int broadcast)
{
Expand All @@ -190,10 +190,10 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr,

#else

static void lapic_timer_check_state(int state, struct acpi_processor *pr,
static void acpi_timer_check_state(int state, struct acpi_processor *pr,
struct acpi_processor_cx *cstate) { }
static void lapic_timer_propagate_broadcast(struct acpi_processor *pr) { }
static void lapic_timer_state_broadcast(struct acpi_processor *pr,
static void acpi_propagate_timer_broadcast(struct acpi_processor *pr) { }
static void acpi_state_timer_broadcast(struct acpi_processor *pr,
struct acpi_processor_cx *cx,
int broadcast)
{
Expand Down Expand Up @@ -614,25 +614,29 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
switch (cx->type) {
case ACPI_STATE_C1:
cx->valid = 1;
acpi_timer_check_state(i, pr, cx);
break;

case ACPI_STATE_C2:
acpi_processor_power_verify_c2(cx);
if (cx->valid)
acpi_timer_check_state(i, pr, cx);
break;

case ACPI_STATE_C3:
acpi_processor_power_verify_c3(pr, cx);
if (cx->valid)
acpi_timer_check_state(i, pr, cx);
break;
}
if (!cx->valid)
continue;
if (cx->valid)
tsc_check_state(cx->type);

lapic_timer_check_state(i, pr, cx);
tsc_check_state(cx->type);
working++;
if (cx->valid)
working++;
}

lapic_timer_propagate_broadcast(pr);
acpi_propagate_timer_broadcast(pr);

return (working);
}
Expand Down Expand Up @@ -835,15 +839,15 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
return 0;
}

lapic_timer_state_broadcast(pr, cx, 1);
acpi_state_timer_broadcast(pr, cx, 1);
kt1 = ktime_get_real();
acpi_idle_do_entry(cx);
kt2 = ktime_get_real();
idle_time = ktime_to_us(ktime_sub(kt2, kt1));

local_irq_enable();
cx->usage++;
lapic_timer_state_broadcast(pr, cx, 0);
acpi_state_timer_broadcast(pr, cx, 0);

return idle_time;
}
Expand Down Expand Up @@ -888,7 +892,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
* Must be done before busmaster disable as we might need to
* access HPET !
*/
lapic_timer_state_broadcast(pr, cx, 1);
acpi_state_timer_broadcast(pr, cx, 1);

if (cx->type == ACPI_STATE_C3)
ACPI_FLUSH_CPU_CACHE();
Expand All @@ -910,7 +914,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,

cx->usage++;

lapic_timer_state_broadcast(pr, cx, 0);
acpi_state_timer_broadcast(pr, cx, 0);
cx->time += sleep_ticks;
return idle_time;
}
Expand Down Expand Up @@ -977,7 +981,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
* Must be done before busmaster disable as we might need to
* access HPET !
*/
lapic_timer_state_broadcast(pr, cx, 1);
acpi_state_timer_broadcast(pr, cx, 1);

kt1 = ktime_get_real();
/*
Expand Down Expand Up @@ -1022,7 +1026,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,

cx->usage++;

lapic_timer_state_broadcast(pr, cx, 0);
acpi_state_timer_broadcast(pr, cx, 0);
cx->time += sleep_ticks;
return idle_time;
}
Expand Down
Loading

0 comments on commit be46ab7

Please sign in to comment.