Commit 86768d2c authored by Len Brown's avatar Len Brown

Merge intel.com:/home/lenb/src/26-stable-dev

into intel.com:/home/lenb/src/26-latest-dev
parents c502825f 99e7a1d6
......@@ -791,9 +791,16 @@ static int __init acpi_irq_penalty_update(char *str, int used)
return 1;
}
/*
* We'd like PNP to call this routine for the
* single ISA_USED value for each legacy device.
* But instead it calls us with each POSSIBLE setting.
* There is no ISA_POSSIBLE weight, so we simply use
* the (small) PCI_USING penalty.
*/
void acpi_penalize_isa_irq(int irq)
{
acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED;
acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING;
}
/*
......
obj-y := poweroff.o
obj-$(CONFIG_ACPI_SLEEP) += main.o wakeup.o
obj-y := poweroff.o wakeup.o
obj-$(CONFIG_ACPI_SLEEP) += main.o
obj-$(CONFIG_ACPI_SLEEP_PROC_FS) += proc.o
EXTRA_CFLAGS += $(ACPI_CFLAGS)
......@@ -9,6 +9,7 @@
#include <linux/init.h>
#include <acpi/acpi_bus.h>
#include <linux/sched.h>
#include "sleep.h"
static void
acpi_power_off (void)
......@@ -16,6 +17,7 @@ acpi_power_off (void)
printk("%s called\n",__FUNCTION__);
/* Some SMP machines only can poweroff in boot CPU */
set_cpus_allowed(current, cpumask_of_cpu(0));
acpi_wakeup_gpe_poweroff_prepare();
acpi_enter_sleep_state_prep(ACPI_STATE_S5);
ACPI_DISABLE_IRQS();
acpi_enter_sleep_state(ACPI_STATE_S5);
......
......@@ -5,3 +5,4 @@ extern int acpi_suspend (u32 state);
extern void acpi_enable_wakeup_device_prep(u8 sleep_state);
extern void acpi_enable_wakeup_device(u8 sleep_state);
extern void acpi_disable_wakeup_device(u8 sleep_state);
extern void acpi_wakeup_gpe_poweroff_prepare(void);
/*
* wakeup.c - support wakeup devices
* Copyright (C) 2004 Li Shaohua <shaohua.li@intel.com>
*/
#include <linux/init.h>
......@@ -13,14 +14,16 @@
#define _COMPONENT ACPI_SYSTEM_COMPONENT
ACPI_MODULE_NAME ("wakeup_devices")
extern struct list_head acpi_wakeup_device_list;
extern spinlock_t acpi_device_lock;
#ifdef CONFIG_ACPI_SLEEP
/**
* acpi_enable_wakeup_device_prep - prepare wakeup devices
* @sleep_state: ACPI state
* Enable all wakup devices power if the devices' wakeup level
* is higher than requested sleep level
*/
extern struct list_head acpi_wakeup_device_list;
extern spinlock_t acpi_device_lock;
void
acpi_enable_wakeup_device_prep(
......@@ -179,3 +182,28 @@ static int __init acpi_wakeup_device_init(void)
}
late_initcall(acpi_wakeup_device_init);
#endif
/*
* Disable all wakeup GPEs before power off.
*
* Since acpi_enter_sleep_state() will disable all
* RUNTIME GPEs, we simply mark all GPES that
* are not enabled for wakeup from S5 as RUNTIME.
*/
void acpi_wakeup_gpe_poweroff_prepare(void)
{
struct list_head * node, * next;
list_for_each_safe(node, next, &acpi_wakeup_device_list) {
struct acpi_device * dev = container_of(node,
struct acpi_device, wakeup_list);
/* The GPE can wakeup system from S5, don't touch it */
if ((u32)dev->wakeup.sleep_state == ACPI_STATE_S5)
continue;
/* acpi_set_gpe_type will automatically disable GPE */
acpi_set_gpe_type(dev->wakeup.gpe_device,
dev->wakeup.gpe_number, ACPI_GPE_TYPE_RUNTIME);
}
}
......@@ -1370,7 +1370,7 @@ static int acpi_gpe_irq_setup(struct smi_info *info)
status = acpi_install_gpe_handler(NULL,
info->irq,
ACPI_GPE_LEVEL_TRIGGERED,
ipmi_acpi_gpe,
&ipmi_acpi_gpe,
info);
if (status != AE_OK) {
printk(KERN_WARNING
......@@ -1390,7 +1390,7 @@ static void acpi_gpe_irq_cleanup(struct smi_info *info)
if (!info->irq)
return;
acpi_remove_gpe_handler(NULL, info->irq, ipmi_acpi_gpe);
acpi_remove_gpe_handler(NULL, info->irq, &ipmi_acpi_gpe);
}
/*
......
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