Commit da547d77 authored by Len Brown's avatar Len Brown

Merge trivial low-risk suspend hotkey bugzilla-5918 into release

......@@ -889,6 +889,12 @@ M: rdunlap@xenotime.net
T: git http://tali.admingilde.org/git/linux-docbook.git
S: Maintained
DOCKING STATION DRIVER
P: Kristen Carlson Accardi
M: kristen.c.accardi@intel.com
L: linux-acpi@vger.kernel.org
S: Maintained
DOUBLETALK DRIVER
P: James R. Van Zandt
M: jrv@vanzandt.mv.com
......
......@@ -59,7 +59,7 @@ static inline int gsi_irq_sharing(int gsi) { return gsi; }
#define BAD_MADT_ENTRY(entry, end) ( \
(!entry) || (unsigned long)entry + sizeof(*entry) > end || \
((acpi_table_entry_header *)entry)->length != sizeof(*entry))
((acpi_table_entry_header *)entry)->length < sizeof(*entry))
#define PREFIX "ACPI: "
......
......@@ -292,7 +292,10 @@ ENTRY(do_suspend_lowlevel)
pushl $3
call acpi_enter_sleep_state
addl $4, %esp
ret
# In case of S3 failure, we'll emerge here. Jump
# to ret_point to recover
jmp ret_point
.p2align 4,,7
ret_point:
call restore_registers
......
......@@ -55,7 +55,7 @@
#define BAD_MADT_ENTRY(entry, end) ( \
(!entry) || (unsigned long)entry + sizeof(*entry) > end || \
((acpi_table_entry_header *)entry)->length != sizeof(*entry))
((acpi_table_entry_header *)entry)->length < sizeof(*entry))
#define PREFIX "ACPI: "
......
......@@ -285,6 +285,8 @@ static int __init acpi_ac_init(void)
{
int result;
if (acpi_disabled)
return -ENODEV;
acpi_ac_dir = acpi_lock_ac_dir();
if (!acpi_ac_dir)
......
......@@ -484,10 +484,8 @@ acpi_memory_register_notify_handler(acpi_handle handle,
status = is_memory_device(handle);
if (ACPI_FAILURE(status)){
ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
if (ACPI_FAILURE(status))
return AE_OK; /* continue */
}
status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
acpi_memory_device_notify, NULL);
......@@ -503,10 +501,8 @@ acpi_memory_deregister_notify_handler(acpi_handle handle,
status = is_memory_device(handle);
if (ACPI_FAILURE(status)){
ACPI_EXCEPTION((AE_INFO, status, "handle is no memory device"));
if (ACPI_FAILURE(status))
return AE_OK; /* continue */
}
status = acpi_remove_notify_handler(handle,
ACPI_SYSTEM_NOTIFY,
......
......@@ -757,6 +757,9 @@ static int __init acpi_battery_init(void)
{
int result;
if (acpi_disabled)
return -ENODEV;
acpi_battery_dir = acpi_lock_battery_dir();
if (!acpi_battery_dir)
return -ENODEV;
......
......@@ -25,6 +25,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/sched.h>
#include <linux/pm.h>
......@@ -68,7 +69,8 @@ int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
if (ACPI_FAILURE(status) || !*device) {
ACPI_EXCEPTION((AE_INFO, status, "No context for object [%p]", handle));
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
handle));
return -ENODEV;
}
......@@ -192,7 +194,7 @@ int acpi_bus_set_power(acpi_handle handle, int state)
/* Make sure this is a valid target state */
if (!device->flags.power_manageable) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device `[%s]' is not power manageable",
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device `[%s]' is not power manageable\n",
device->kobj.name));
return -ENODEV;
}
......@@ -738,7 +740,10 @@ static int __init acpi_init(void)
return -ENODEV;
}
firmware_register(&acpi_subsys);
result = firmware_register(&acpi_subsys);
if (result < 0)
printk(KERN_WARNING "%s: firmware_register error: %d\n",
__FUNCTION__, result);
result = acpi_bus_init();
......
This diff is collapsed.
......@@ -330,7 +330,7 @@ static int acpi_ec_hc_add(struct acpi_device *device)
status = acpi_evaluate_integer(ec_hc->handle, "_EC", NULL, &val);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error obtaining _EC\n"));
kfree(ec_hc->smbus);
kfree(ec_hc);
kfree(smbus);
return -EIO;
}
......
......@@ -746,6 +746,16 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n",
handle, units, timeout));
/*
* This can be called during resume with interrupts off.
* Like boot-time, we should be single threaded and will
* always get the lock if we try -- timeout or not.
* If this doesn't succeed, then we will oops courtesy of
* might_sleep() in down().
*/
if (!down_trylock(sem))
return AE_OK;
switch (timeout) {
/*
* No Wait:
......
......@@ -1714,6 +1714,9 @@ static int __init acpi_sbs_init(void)
{
int result = 0;
if (acpi_disabled)
return -ENODEV;
init_MUTEX(&sbs_sem);
if (capacity_mode != DEF_CAPACITY_UNIT
......
......@@ -4,6 +4,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/acpi.h>
#include <acpi/acpi_drivers.h>
......@@ -113,6 +114,8 @@ static struct kset acpi_namespace_kset = {
static void acpi_device_register(struct acpi_device *device,
struct acpi_device *parent)
{
int err;
/*
* Linkage
* -------
......@@ -138,7 +141,10 @@ static void acpi_device_register(struct acpi_device *device,
device->kobj.parent = &parent->kobj;
device->kobj.ktype = &ktype_acpi_ns;
device->kobj.kset = &acpi_namespace_kset;
kobject_register(&device->kobj);
err = kobject_register(&device->kobj);
if (err < 0)
printk(KERN_WARNING "%s: kobject_register error: %d\n",
__FUNCTION__, err);
create_sysfs_device_files(device);
}
......@@ -1450,7 +1456,9 @@ static int __init acpi_scan_init(void)
if (acpi_disabled)
return 0;
kset_register(&acpi_namespace_kset);
result = kset_register(&acpi_namespace_kset);
if (result < 0)
printk(KERN_ERR PREFIX "kset_register error: %d\n", result);
result = bus_register(&acpi_bus_type);
if (result) {
......
......@@ -262,7 +262,7 @@ acpi_evaluate_integer(acpi_handle handle,
if (!data)
return AE_BAD_PARAMETER;
element = kmalloc(sizeof(union acpi_object), GFP_KERNEL);
element = kmalloc(sizeof(union acpi_object), irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL);
if (!element)
return AE_NO_MEMORY;
......
......@@ -76,7 +76,7 @@ config HOTPLUG_PCI_IBM
config HOTPLUG_PCI_ACPI
tristate "ACPI PCI Hotplug driver"
depends on ACPI_DOCK && HOTPLUG_PCI
depends on (!ACPI_DOCK && ACPI && HOTPLUG_PCI) || (ACPI_DOCK && HOTPLUG_PCI)
help
Say Y here if you have a system that supports PCI Hotplug using
ACPI.
......
......@@ -1518,6 +1518,63 @@ static void __devinit quirk_netmos(struct pci_dev *dev)
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID, quirk_netmos);
static void __devinit quirk_e100_interrupt(struct pci_dev *dev)
{
u16 command;
u32 bar;
u8 __iomem *csr;
u8 cmd_hi;
switch (dev->device) {
/* PCI IDs taken from drivers/net/e100.c */
case 0x1029:
case 0x1030 ... 0x1034:
case 0x1038 ... 0x103E:
case 0x1050 ... 0x1057:
case 0x1059:
case 0x1064 ... 0x106B:
case 0x1091 ... 0x1095:
case 0x1209:
case 0x1229:
case 0x2449:
case 0x2459:
case 0x245D:
case 0x27DC:
break;
default:
return;
}
/*
* Some firmware hands off the e100 with interrupts enabled,
* which can cause a flood of interrupts if packets are
* received before the driver attaches to the device. So
* disable all e100 interrupts here. The driver will
* re-enable them when it's ready.
*/
pci_read_config_word(dev, PCI_COMMAND, &command);
pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &bar);
if (!(command & PCI_COMMAND_MEMORY) || !bar)
return;
csr = ioremap(bar, 8);
if (!csr) {
printk(KERN_WARNING "PCI: Can't map %s e100 registers\n",
pci_name(dev));
return;
}
cmd_hi = readb(csr + 3);
if (cmd_hi == 0) {
printk(KERN_WARNING "PCI: Firmware left %s e100 interrupts "
"enabled, disabling\n", pci_name(dev));
writeb(1, csr + 3);
}
iounmap(csr);
}
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_e100_interrupt);
static void __devinit fixup_rev1_53c810(struct pci_dev* dev)
{
......
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