mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Merge commit 'v2.6.38' into x86/mm
Conflicts: arch/x86/mm/numa_64.c Merge reason: Resolve the conflict, update the branch to .38. Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
commit
8460b3e5bc
810 changed files with 8447 additions and 6214 deletions
|
|
@ -416,10 +416,15 @@ struct acpi_gpe_handler_info {
|
|||
u8 originally_enabled; /* True if GPE was originally enabled */
|
||||
};
|
||||
|
||||
struct acpi_gpe_notify_object {
|
||||
struct acpi_namespace_node *node;
|
||||
struct acpi_gpe_notify_object *next;
|
||||
};
|
||||
|
||||
union acpi_gpe_dispatch_info {
|
||||
struct acpi_namespace_node *method_node; /* Method node for this GPE level */
|
||||
struct acpi_gpe_handler_info *handler; /* Installed GPE handler */
|
||||
struct acpi_namespace_node *device_node; /* Parent _PRW device for implicit notify */
|
||||
struct acpi_gpe_notify_object device; /* List of _PRW devices for implicit notify */
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -457,6 +457,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
|
|||
acpi_status status;
|
||||
struct acpi_gpe_event_info *local_gpe_event_info;
|
||||
struct acpi_evaluate_info *info;
|
||||
struct acpi_gpe_notify_object *notify_object;
|
||||
|
||||
ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method);
|
||||
|
||||
|
|
@ -508,10 +509,18 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
|
|||
* from this thread -- because handlers may in turn run other
|
||||
* control methods.
|
||||
*/
|
||||
status =
|
||||
acpi_ev_queue_notify_request(local_gpe_event_info->dispatch.
|
||||
device_node,
|
||||
ACPI_NOTIFY_DEVICE_WAKE);
|
||||
status = acpi_ev_queue_notify_request(
|
||||
local_gpe_event_info->dispatch.device.node,
|
||||
ACPI_NOTIFY_DEVICE_WAKE);
|
||||
|
||||
notify_object = local_gpe_event_info->dispatch.device.next;
|
||||
while (ACPI_SUCCESS(status) && notify_object) {
|
||||
status = acpi_ev_queue_notify_request(
|
||||
notify_object->node,
|
||||
ACPI_NOTIFY_DEVICE_WAKE);
|
||||
notify_object = notify_object->next;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ACPI_GPE_DISPATCH_METHOD:
|
||||
|
|
|
|||
|
|
@ -198,7 +198,9 @@ acpi_setup_gpe_for_wake(acpi_handle wake_device,
|
|||
acpi_status status = AE_BAD_PARAMETER;
|
||||
struct acpi_gpe_event_info *gpe_event_info;
|
||||
struct acpi_namespace_node *device_node;
|
||||
struct acpi_gpe_notify_object *notify_object;
|
||||
acpi_cpu_flags flags;
|
||||
u8 gpe_dispatch_mask;
|
||||
|
||||
ACPI_FUNCTION_TRACE(acpi_setup_gpe_for_wake);
|
||||
|
||||
|
|
@ -212,37 +214,62 @@ acpi_setup_gpe_for_wake(acpi_handle wake_device,
|
|||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* Validate wake_device is of type Device */
|
||||
|
||||
device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device);
|
||||
if (device_node->type != ACPI_TYPE_DEVICE) {
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
|
||||
|
||||
/* Ensure that we have a valid GPE number */
|
||||
|
||||
gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
|
||||
if (gpe_event_info) {
|
||||
/*
|
||||
* If there is no method or handler for this GPE, then the
|
||||
* wake_device will be notified whenever this GPE fires (aka
|
||||
* "implicit notify") Note: The GPE is assumed to be
|
||||
* level-triggered (for windows compatibility).
|
||||
*/
|
||||
if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
|
||||
ACPI_GPE_DISPATCH_NONE) {
|
||||
gpe_event_info->flags =
|
||||
(ACPI_GPE_DISPATCH_NOTIFY |
|
||||
ACPI_GPE_LEVEL_TRIGGERED);
|
||||
gpe_event_info->dispatch.device_node = device_node;
|
||||
}
|
||||
|
||||
gpe_event_info->flags |= ACPI_GPE_CAN_WAKE;
|
||||
status = AE_OK;
|
||||
if (!gpe_event_info) {
|
||||
goto unlock_and_exit;
|
||||
}
|
||||
|
||||
if (wake_device == ACPI_ROOT_OBJECT) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is no method or handler for this GPE, then the
|
||||
* wake_device will be notified whenever this GPE fires (aka
|
||||
* "implicit notify") Note: The GPE is assumed to be
|
||||
* level-triggered (for windows compatibility).
|
||||
*/
|
||||
gpe_dispatch_mask = gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK;
|
||||
if (gpe_dispatch_mask != ACPI_GPE_DISPATCH_NONE
|
||||
&& gpe_dispatch_mask != ACPI_GPE_DISPATCH_NOTIFY) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Validate wake_device is of type Device */
|
||||
|
||||
device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device);
|
||||
if (device_node->type != ACPI_TYPE_DEVICE) {
|
||||
goto unlock_and_exit;
|
||||
}
|
||||
|
||||
if (gpe_dispatch_mask == ACPI_GPE_DISPATCH_NONE) {
|
||||
gpe_event_info->flags = (ACPI_GPE_DISPATCH_NOTIFY |
|
||||
ACPI_GPE_LEVEL_TRIGGERED);
|
||||
gpe_event_info->dispatch.device.node = device_node;
|
||||
gpe_event_info->dispatch.device.next = NULL;
|
||||
} else {
|
||||
/* There are multiple devices to notify implicitly. */
|
||||
|
||||
notify_object = ACPI_ALLOCATE_ZEROED(sizeof(*notify_object));
|
||||
if (!notify_object) {
|
||||
status = AE_NO_MEMORY;
|
||||
goto unlock_and_exit;
|
||||
}
|
||||
|
||||
notify_object->node = device_node;
|
||||
notify_object->next = gpe_event_info->dispatch.device.next;
|
||||
gpe_event_info->dispatch.device.next = notify_object;
|
||||
}
|
||||
|
||||
out:
|
||||
gpe_event_info->flags |= ACPI_GPE_CAN_WAKE;
|
||||
status = AE_OK;
|
||||
|
||||
unlock_and_exit:
|
||||
acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
|
|||
size_t count, loff_t *ppos)
|
||||
{
|
||||
static char *buf;
|
||||
static int uncopied_bytes;
|
||||
static u32 max_size;
|
||||
static u32 uncopied_bytes;
|
||||
|
||||
struct acpi_table_header table;
|
||||
acpi_status status;
|
||||
|
||||
|
|
@ -37,19 +39,24 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
|
|||
if (copy_from_user(&table, user_buf,
|
||||
sizeof(struct acpi_table_header)))
|
||||
return -EFAULT;
|
||||
uncopied_bytes = table.length;
|
||||
buf = kzalloc(uncopied_bytes, GFP_KERNEL);
|
||||
uncopied_bytes = max_size = table.length;
|
||||
buf = kzalloc(max_size, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (uncopied_bytes < count) {
|
||||
kfree(buf);
|
||||
if (buf == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
if ((*ppos > max_size) ||
|
||||
(*ppos + count > max_size) ||
|
||||
(*ppos + count < count) ||
|
||||
(count > uncopied_bytes))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (copy_from_user(buf + (*ppos), user_buf, count)) {
|
||||
kfree(buf);
|
||||
buf = NULL;
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
|
|
@ -59,6 +66,7 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
|
|||
if (!uncopied_bytes) {
|
||||
status = acpi_install_method(buf);
|
||||
kfree(buf);
|
||||
buf = NULL;
|
||||
if (ACPI_FAILURE(status))
|
||||
return -EINVAL;
|
||||
add_taint(TAINT_OVERRIDDEN_ACPI_TABLE);
|
||||
|
|
|
|||
|
|
@ -636,17 +636,21 @@ EXPORT_SYMBOL(acpi_os_write_port);
|
|||
acpi_status
|
||||
acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
|
||||
{
|
||||
u32 dummy;
|
||||
void __iomem *virt_addr;
|
||||
int size = width / 8, unmap = 0;
|
||||
unsigned int size = width / 8;
|
||||
bool unmap = false;
|
||||
u32 dummy;
|
||||
|
||||
rcu_read_lock();
|
||||
virt_addr = acpi_map_vaddr_lookup(phys_addr, size);
|
||||
rcu_read_unlock();
|
||||
if (!virt_addr) {
|
||||
rcu_read_unlock();
|
||||
virt_addr = acpi_os_ioremap(phys_addr, size);
|
||||
unmap = 1;
|
||||
if (!virt_addr)
|
||||
return AE_BAD_ADDRESS;
|
||||
unmap = true;
|
||||
}
|
||||
|
||||
if (!value)
|
||||
value = &dummy;
|
||||
|
||||
|
|
@ -666,6 +670,8 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
|
|||
|
||||
if (unmap)
|
||||
iounmap(virt_addr);
|
||||
else
|
||||
rcu_read_unlock();
|
||||
|
||||
return AE_OK;
|
||||
}
|
||||
|
|
@ -674,14 +680,17 @@ acpi_status
|
|||
acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
|
||||
{
|
||||
void __iomem *virt_addr;
|
||||
int size = width / 8, unmap = 0;
|
||||
unsigned int size = width / 8;
|
||||
bool unmap = false;
|
||||
|
||||
rcu_read_lock();
|
||||
virt_addr = acpi_map_vaddr_lookup(phys_addr, size);
|
||||
rcu_read_unlock();
|
||||
if (!virt_addr) {
|
||||
rcu_read_unlock();
|
||||
virt_addr = acpi_os_ioremap(phys_addr, size);
|
||||
unmap = 1;
|
||||
if (!virt_addr)
|
||||
return AE_BAD_ADDRESS;
|
||||
unmap = true;
|
||||
}
|
||||
|
||||
switch (width) {
|
||||
|
|
@ -700,6 +709,8 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
|
|||
|
||||
if (unmap)
|
||||
iounmap(virt_addr);
|
||||
else
|
||||
rcu_read_unlock();
|
||||
|
||||
return AE_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,6 +82,11 @@ long acpi_is_video_device(struct acpi_device *device)
|
|||
if (!device)
|
||||
return 0;
|
||||
|
||||
/* Is this device able to support video switching ? */
|
||||
if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy)) ||
|
||||
ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy)))
|
||||
video_caps |= ACPI_VIDEO_OUTPUT_SWITCHING;
|
||||
|
||||
/* Is this device able to retrieve a video ROM ? */
|
||||
if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy)))
|
||||
video_caps |= ACPI_VIDEO_ROM_AVAILABLE;
|
||||
|
|
|
|||
|
|
@ -86,8 +86,12 @@ int __init acpi_wakeup_device_init(void)
|
|||
struct acpi_device *dev = container_of(node,
|
||||
struct acpi_device,
|
||||
wakeup_list);
|
||||
if (device_can_wakeup(&dev->dev))
|
||||
if (device_can_wakeup(&dev->dev)) {
|
||||
/* Button GPEs are supposed to be always enabled. */
|
||||
acpi_enable_gpe(dev->wakeup.gpe_device,
|
||||
dev->wakeup.gpe_number);
|
||||
device_set_wakeup_enable(&dev->dev, true);
|
||||
}
|
||||
}
|
||||
mutex_unlock(&acpi_device_lock);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue