Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233311
b: refs/heads/master
c: 884b821
h: refs/heads/master
i:
  233309: 3e3030d
  233307: d6cb193
  233303: 5e4dfc3
  233295: c8dce64
  233279: 44f0aa9
v: v3
  • Loading branch information
Rafael J. Wysocki committed Feb 8, 2011
1 parent 97236ee commit 939e60f
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 44 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ed764e7ca042dbf4cc1c7f4e12cd842c7789f133
refs/heads/master: 884b821fa27a5e3714d4871976d3e7c3abfa0d1b
49 changes: 23 additions & 26 deletions trunk/drivers/acpi/acpica/evxfgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,40 +212,37 @@ acpi_setup_gpe_for_wake(acpi_handle wake_device,
return_ACPI_STATUS(AE_BAD_PARAMETER);
}

flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);

/* Ensure that we have a valid GPE number */
/* Validate wake_device is of type Device */

gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
if (!gpe_event_info) {
goto unlock_and_exit;
device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device);
if (device_node->type != ACPI_TYPE_DEVICE) {
return_ACPI_STATUS(AE_BAD_PARAMETER);
}

/*
* 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) && (wake_device != ACPI_ROOT_OBJECT)) {
flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);

/* Validate wake_device is of type Device */
/* Ensure that we have a valid GPE number */

device_node = ACPI_CAST_PTR(struct acpi_namespace_node,
wake_device);
if (device_node->type != ACPI_TYPE_DEVICE) {
goto unlock_and_exit;
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_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;
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);
}
Expand Down
25 changes: 18 additions & 7 deletions trunk/drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
Expand All @@ -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) {
Expand All @@ -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;
}
Expand Down
5 changes: 0 additions & 5 deletions trunk/drivers/acpi/video_detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ 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;
Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/acpi/wakeup.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,8 @@ 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)) {
/* Button GPEs are supposed to be always enabled. */
acpi_enable_gpe(dev->wakeup.gpe_device,
dev->wakeup.gpe_number);
if (device_can_wakeup(&dev->dev))
device_set_wakeup_enable(&dev->dev, true);
}
}
mutex_unlock(&acpi_device_lock);
return 0;
Expand Down

0 comments on commit 939e60f

Please sign in to comment.