Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/lenb/linux-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Jul 12, 2005
2 parents 55ee3b8 + 5028770 commit 3f603ed
Show file tree
Hide file tree
Showing 198 changed files with 7,755 additions and 5,428 deletions.
35 changes: 35 additions & 0 deletions Documentation/acpi-hotkey.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
driver/acpi/hotkey.c implement:
1. /proc/acpi/hotkey/event_config
(event based hotkey or event config interface):
a. add a event based hotkey(event) :
echo "0:bus::action:method:num:num" > event_config

b. delete a event based hotkey(event):
echo "1:::::num:num" > event_config

c. modify a event based hotkey(event):
echo "2:bus::action:method:num:num" > event_config

2. /proc/acpi/hotkey/poll_config
(polling based hotkey or event config interface):
a.add a polling based hotkey(event) :
echo "0:bus:method:action:method:num" > poll_config
this adding command will create a proc file
/proc/acpi/hotkey/method, which is used to get
result of polling.

b.delete a polling based hotkey(event):
echo "1:::::num" > event_config

c.modify a polling based hotkey(event):
echo "2:bus:method:action:method:num" > poll_config

3./proc/acpi/hotkey/action
(interface to call aml method associated with a
specific hotkey(event))
echo "event_num:event_type:event_argument" >
/proc/acpi/hotkey/action.
The result of the execution of this aml method is
attached to /proc/acpi/hotkey/poll_method, which is dnyamically
created. Please use command "cat /proc/acpi/hotkey/polling_method"
to retrieve it.
2 changes: 1 addition & 1 deletion arch/frv/mb93090-mb00/pci-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void __init pcibios_fixup_irqs(void)
}
}

void __init pcibios_penalize_isa_irq(int irq)
void __init pcibios_penalize_isa_irq(int irq, int active)
{
}

Expand Down
4 changes: 4 additions & 0 deletions arch/i386/kernel/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ obj-$(CONFIG_ACPI_BOOT) := boot.o
obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o
obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o

ifneq ($(CONFIG_ACPI_PROCESSOR),)
obj-y += cstate.o
endif

103 changes: 103 additions & 0 deletions arch/i386/kernel/acpi/cstate.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* arch/i386/kernel/acpi/cstate.c
*
* Copyright (C) 2005 Intel Corporation
* Venkatesh Pallipadi <[email protected]>
* - Added _PDC for SMP C-states on Intel CPUs
*/

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/acpi.h>

#include <acpi/processor.h>
#include <asm/acpi.h>

static void acpi_processor_power_init_intel_pdc(struct acpi_processor_power
*pow)
{
struct acpi_object_list *obj_list;
union acpi_object *obj;
u32 *buf;

/* allocate and initialize pdc. It will be used later. */
obj_list = kmalloc(sizeof(struct acpi_object_list), GFP_KERNEL);
if (!obj_list) {
printk(KERN_ERR "Memory allocation error\n");
return;
}

obj = kmalloc(sizeof(union acpi_object), GFP_KERNEL);
if (!obj) {
printk(KERN_ERR "Memory allocation error\n");
kfree(obj_list);
return;
}

buf = kmalloc(12, GFP_KERNEL);
if (!buf) {
printk(KERN_ERR "Memory allocation error\n");
kfree(obj);
kfree(obj_list);
return;
}

buf[0] = ACPI_PDC_REVISION_ID;
buf[1] = 1;
buf[2] = ACPI_PDC_C_CAPABILITY_SMP;

obj->type = ACPI_TYPE_BUFFER;
obj->buffer.length = 12;
obj->buffer.pointer = (u8 *) buf;
obj_list->count = 1;
obj_list->pointer = obj;
pow->pdc = obj_list;

return;
}

/* Initialize _PDC data based on the CPU vendor */
void acpi_processor_power_init_pdc(struct acpi_processor_power *pow,
unsigned int cpu)
{
struct cpuinfo_x86 *c = cpu_data + cpu;

pow->pdc = NULL;
if (c->x86_vendor == X86_VENDOR_INTEL)
acpi_processor_power_init_intel_pdc(pow);

return;
}

EXPORT_SYMBOL(acpi_processor_power_init_pdc);

/*
* Initialize bm_flags based on the CPU cache properties
* On SMP it depends on cache configuration
* - When cache is not shared among all CPUs, we flush cache
* before entering C3.
* - When cache is shared among all CPUs, we use bm_check
* mechanism as in UP case
*
* This routine is called only after all the CPUs are online
*/
void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
unsigned int cpu)
{
struct cpuinfo_x86 *c = cpu_data + cpu;

flags->bm_check = 0;
if (num_online_cpus() == 1)
flags->bm_check = 1;
else if (c->x86_vendor == X86_VENDOR_INTEL) {
/*
* Today all CPUs that support C3 share cache.
* TBD: This needs to look at cache shared map, once
* multi-core detection patch makes to the base.
*/
flags->bm_check = 1;
}
}

EXPORT_SYMBOL(acpi_processor_power_init_bm_check);
5 changes: 3 additions & 2 deletions arch/i386/kernel/acpi/wakeup.S
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ wakeup_code:
movw %ax,%fs
movw $0x0e00 + 'i', %fs:(0x12)

# need a gdt
lgdt real_save_gdt - wakeup_code
# need a gdt -- use lgdtl to force 32-bit operands, in case
# the GDT is located past 16 megabytes.
lgdtl real_save_gdt - wakeup_code

movl real_save_cr0 - wakeup_code, %eax
movl %eax, %cr0
Expand Down
2 changes: 1 addition & 1 deletion arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
arg0.buffer.pointer = (u8 *) arg0_buf;
arg0_buf[0] = ACPI_PDC_REVISION_ID;
arg0_buf[1] = 1;
arg0_buf[2] = ACPI_PDC_EST_CAPABILITY_SMP | ACPI_PDC_EST_CAPABILITY_MSR;
arg0_buf[2] = ACPI_PDC_EST_CAPABILITY_SMP_MSR;

p.pdc = &arg_list;

Expand Down
16 changes: 10 additions & 6 deletions arch/i386/pci/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,24 +1051,28 @@ static int __init pcibios_irq_init(void)
subsys_initcall(pcibios_irq_init);


static void pirq_penalize_isa_irq(int irq)
static void pirq_penalize_isa_irq(int irq, int active)
{
/*
* If any ISAPnP device reports an IRQ in its list of possible
* IRQ's, we try to avoid assigning it to PCI devices.
*/
if (irq < 16)
pirq_penalty[irq] += 100;
if (irq < 16) {
if (active)
pirq_penalty[irq] += 1000;
else
pirq_penalty[irq] += 100;
}
}

void pcibios_penalize_isa_irq(int irq)
void pcibios_penalize_isa_irq(int irq, int active)
{
#ifdef CONFIG_ACPI_PCI
if (!acpi_noirq)
acpi_penalize_isa_irq(irq);
acpi_penalize_isa_irq(irq, active);
else
#endif
pirq_penalize_isa_irq(irq);
pirq_penalize_isa_irq(irq, active);
}

static int pirq_enable_irq(struct pci_dev *dev)
Expand Down
2 changes: 1 addition & 1 deletion arch/i386/pci/visws.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; }

int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq;

void __init pcibios_penalize_isa_irq(int irq) {}
void __init pcibios_penalize_isa_irq(int irq, int active) {}


unsigned int pci_bus0, pci_bus1;
Expand Down
54 changes: 54 additions & 0 deletions arch/ia64/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Copyright (C) 2001 Jenna Hall <[email protected]>
* Copyright (C) 2001 Takayoshi Kochi <[email protected]>
* Copyright (C) 2002 Erich Focht <[email protected]>
* Copyright (C) 2004 Ashok Raj <[email protected]>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
Expand Down Expand Up @@ -67,6 +68,11 @@ EXPORT_SYMBOL(pm_power_off);
unsigned char acpi_kbd_controller_present = 1;
unsigned char acpi_legacy_devices;

static unsigned int __initdata acpi_madt_rev;

unsigned int acpi_cpei_override;
unsigned int acpi_cpei_phys_cpuid;

#define MAX_SAPICS 256
u16 ia64_acpiid_to_sapicid[MAX_SAPICS] =
{ [0 ... MAX_SAPICS - 1] = -1 };
Expand Down Expand Up @@ -265,10 +271,56 @@ acpi_parse_plat_int_src (
(plintsrc->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);

platform_intr_list[plintsrc->type] = vector;
if (acpi_madt_rev > 1) {
acpi_cpei_override = plintsrc->plint_flags.cpei_override_flag;
}

/*
* Save the physical id, so we can check when its being removed
*/
acpi_cpei_phys_cpuid = ((plintsrc->id << 8) | (plintsrc->eid)) & 0xffff;

return 0;
}


unsigned int can_cpei_retarget(void)
{
extern int cpe_vector;

/*
* Only if CPEI is supported and the override flag
* is present, otherwise return that its re-targettable
* if we are in polling mode.
*/
if (cpe_vector > 0 && !acpi_cpei_override)
return 0;
else
return 1;
}

unsigned int is_cpu_cpei_target(unsigned int cpu)
{
unsigned int logical_id;

logical_id = cpu_logical_id(acpi_cpei_phys_cpuid);

if (logical_id == cpu)
return 1;
else
return 0;
}

void set_cpei_target_cpu(unsigned int cpu)
{
acpi_cpei_phys_cpuid = cpu_physical_id(cpu);
}

unsigned int get_cpei_target_cpu(void)
{
return acpi_cpei_phys_cpuid;
}

static int __init
acpi_parse_int_src_ovr (
acpi_table_entry_header *header, const unsigned long end)
Expand Down Expand Up @@ -326,6 +378,8 @@ acpi_parse_madt (unsigned long phys_addr, unsigned long size)

acpi_madt = (struct acpi_table_madt *) __va(phys_addr);

acpi_madt_rev = acpi_madt->header.revision;

/* remember the value for reference after free_initmem() */
#ifdef CONFIG_ITANIUM
has_8259 = 1; /* Firmware on old Itanium systems is broken */
Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/kernel/mca.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ ia64_mca_log_sal_error_record(int sal_info_type)

#ifdef CONFIG_ACPI

static int cpe_vector = -1;
int cpe_vector = -1;

static irqreturn_t
ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs)
Expand Down
1 change: 1 addition & 0 deletions arch/ia64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ update_pal_halt_status(int status)
void
default_idle (void)
{
local_irq_enable();
while (!need_resched())
if (can_do_pal_halt)
safe_halt();
Expand Down
3 changes: 3 additions & 0 deletions arch/ia64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include <linux/serial_core.h>
#include <linux/efi.h>
#include <linux/initrd.h>
#include <linux/platform.h>
#include <linux/pm.h>

#include <asm/ia32.h>
#include <asm/machvec.h>
Expand Down Expand Up @@ -783,6 +785,7 @@ cpu_init (void)
/* size of physical stacked register partition plus 8 bytes: */
__get_cpu_var(ia64_phys_stacked_size_p8) = num_phys_stacked*8 + 8;
platform_cpu_init();
pm_idle = default_idle;
}

void
Expand Down
7 changes: 7 additions & 0 deletions arch/ia64/kernel/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ int arch_register_cpu(int num)
parent = &sysfs_nodes[cpu_to_node(num)];
#endif /* CONFIG_NUMA */

/*
* If CPEI cannot be re-targetted, and this is
* CPEI target, then dont create the control file
*/
if (!can_cpei_retarget() && is_cpu_cpei_target(num))
sysfs_cpus[num].cpu.no_control = 1;

return register_cpu(&sysfs_cpus[num].cpu, num, parent);
}

Expand Down
Loading

0 comments on commit 3f603ed

Please sign in to comment.