aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/kernel/acpi.c54
-rw-r--r--arch/ia64/kernel/mca.c2
-rw-r--r--arch/ia64/kernel/topology.c7
-rw-r--r--include/asm-ia64/acpi.h9
-rw-r--r--include/linux/acpi.h5
5 files changed, 75 insertions, 2 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 72dfd9e7de0f..1c118b72df3c 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -11,6 +11,7 @@
11 * Copyright (C) 2001 Jenna Hall <jenna.s.hall@intel.com> 11 * Copyright (C) 2001 Jenna Hall <jenna.s.hall@intel.com>
12 * Copyright (C) 2001 Takayoshi Kochi <t-kochi@bq.jp.nec.com> 12 * Copyright (C) 2001 Takayoshi Kochi <t-kochi@bq.jp.nec.com>
13 * Copyright (C) 2002 Erich Focht <efocht@ess.nec.de> 13 * Copyright (C) 2002 Erich Focht <efocht@ess.nec.de>
14 * Copyright (C) 2004 Ashok Raj <ashok.raj@intel.com>
14 * 15 *
15 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 * 17 *
@@ -67,6 +68,11 @@ EXPORT_SYMBOL(pm_power_off);
67unsigned char acpi_kbd_controller_present = 1; 68unsigned char acpi_kbd_controller_present = 1;
68unsigned char acpi_legacy_devices; 69unsigned char acpi_legacy_devices;
69 70
71static unsigned int __initdata acpi_madt_rev;
72
73unsigned int acpi_cpei_override;
74unsigned int acpi_cpei_phys_cpuid;
75
70#define MAX_SAPICS 256 76#define MAX_SAPICS 256
71u16 ia64_acpiid_to_sapicid[MAX_SAPICS] = 77u16 ia64_acpiid_to_sapicid[MAX_SAPICS] =
72 { [0 ... MAX_SAPICS - 1] = -1 }; 78 { [0 ... MAX_SAPICS - 1] = -1 };
@@ -267,10 +273,56 @@ acpi_parse_plat_int_src (
267 (plintsrc->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); 273 (plintsrc->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
268 274
269 platform_intr_list[plintsrc->type] = vector; 275 platform_intr_list[plintsrc->type] = vector;
276 if (acpi_madt_rev > 1) {
277 acpi_cpei_override = plintsrc->plint_flags.cpei_override_flag;
278 }
279
280 /*
281 * Save the physical id, so we can check when its being removed
282 */
283 acpi_cpei_phys_cpuid = ((plintsrc->id << 8) | (plintsrc->eid)) & 0xffff;
284
270 return 0; 285 return 0;
271} 286}
272 287
273 288
289unsigned int can_cpei_retarget(void)
290{
291 extern int cpe_vector;
292
293 /*
294 * Only if CPEI is supported and the override flag
295 * is present, otherwise return that its re-targettable
296 * if we are in polling mode.
297 */
298 if (cpe_vector > 0 && !acpi_cpei_override)
299 return 0;
300 else
301 return 1;
302}
303
304unsigned int is_cpu_cpei_target(unsigned int cpu)
305{
306 unsigned int logical_id;
307
308 logical_id = cpu_logical_id(acpi_cpei_phys_cpuid);
309
310 if (logical_id == cpu)
311 return 1;
312 else
313 return 0;
314}
315
316void set_cpei_target_cpu(unsigned int cpu)
317{
318 acpi_cpei_phys_cpuid = cpu_physical_id(cpu);
319}
320
321unsigned int get_cpei_target_cpu(void)
322{
323 return acpi_cpei_phys_cpuid;
324}
325
274static int __init 326static int __init
275acpi_parse_int_src_ovr ( 327acpi_parse_int_src_ovr (
276 acpi_table_entry_header *header, const unsigned long end) 328 acpi_table_entry_header *header, const unsigned long end)
@@ -328,6 +380,8 @@ acpi_parse_madt (unsigned long phys_addr, unsigned long size)
328 380
329 acpi_madt = (struct acpi_table_madt *) __va(phys_addr); 381 acpi_madt = (struct acpi_table_madt *) __va(phys_addr);
330 382
383 acpi_madt_rev = acpi_madt->header.revision;
384
331 /* remember the value for reference after free_initmem() */ 385 /* remember the value for reference after free_initmem() */
332#ifdef CONFIG_ITANIUM 386#ifdef CONFIG_ITANIUM
333 has_8259 = 1; /* Firmware on old Itanium systems is broken */ 387 has_8259 = 1; /* Firmware on old Itanium systems is broken */
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 736e328b5e61..4ebbf3974381 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -271,7 +271,7 @@ ia64_mca_log_sal_error_record(int sal_info_type)
271 271
272#ifdef CONFIG_ACPI 272#ifdef CONFIG_ACPI
273 273
274static int cpe_vector = -1; 274int cpe_vector = -1;
275 275
276static irqreturn_t 276static irqreturn_t
277ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs) 277ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs)
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index f1aafd4c05f9..d8030f3bd865 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -36,6 +36,13 @@ int arch_register_cpu(int num)
36 parent = &sysfs_nodes[cpu_to_node(num)]; 36 parent = &sysfs_nodes[cpu_to_node(num)];
37#endif /* CONFIG_NUMA */ 37#endif /* CONFIG_NUMA */
38 38
39 /*
40 * If CPEI cannot be re-targetted, and this is
41 * CPEI target, then dont create the control file
42 */
43 if (!can_cpei_retarget() && is_cpu_cpei_target(num))
44 sysfs_cpus[num].cpu.no_control = 1;
45
39 return register_cpu(&sysfs_cpus[num].cpu, num, parent); 46 return register_cpu(&sysfs_cpus[num].cpu, num, parent);
40} 47}
41 48
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
index 6a26a977f253..4c06d455139c 100644
--- a/include/asm-ia64/acpi.h
+++ b/include/asm-ia64/acpi.h
@@ -98,6 +98,15 @@ const char *acpi_get_sysname (void);
98int acpi_request_vector (u32 int_type); 98int acpi_request_vector (u32 int_type);
99int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); 99int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
100 100
101/*
102 * Record the cpei override flag and current logical cpu. This is
103 * useful for CPU removal.
104 */
105extern unsigned int can_cpei_retarget(void);
106extern unsigned int is_cpu_cpei_target(unsigned int cpu);
107extern void set_cpei_target_cpu(unsigned int cpu);
108extern unsigned int get_cpei_target_cpu(void);
109
101#ifdef CONFIG_ACPI_NUMA 110#ifdef CONFIG_ACPI_NUMA
102/* Proximity bitmap length; _PXM is at most 255 (8 bit)*/ 111/* Proximity bitmap length; _PXM is at most 255 (8 bit)*/
103#define MAX_PXM_DOMAINS (256) 112#define MAX_PXM_DOMAINS (256)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index b123cc08773d..70b3c52b75d7 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -206,7 +206,10 @@ struct acpi_table_plat_int_src {
206 u8 eid; 206 u8 eid;
207 u8 iosapic_vector; 207 u8 iosapic_vector;
208 u32 global_irq; 208 u32 global_irq;
209 u32 reserved; 209 struct {
210 u32 cpei_override_flag:1;
211 u32 reserved:31;
212 } plint_flags;
210} __attribute__ ((packed)); 213} __attribute__ ((packed));
211 214
212enum acpi_interrupt_id { 215enum acpi_interrupt_id {