aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/evxfgpe.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-03-14 00:15:13 -0400
committerDave Airlie <airlied@redhat.com>2011-03-14 00:15:13 -0400
commit34db18abd376b2075c760c38f0b861aed379415d (patch)
treec4174e39a2f445f17c25ab206d45c66217bbbf85 /drivers/acpi/acpica/evxfgpe.c
parente73f88af66fcc50083fae4b7e1c39b469179a97a (diff)
parent47ae63e0c2e5fdb582d471dc906eb29be94c732f (diff)
Merge remote branch 'intel/drm-intel-next' of ../drm-next into drm-core-next
* 'intel/drm-intel-next' of ../drm-next: (755 commits) drm/i915: Only wait on a pending flip if we intend to write to the buffer drm/i915/dp: Sanity check eDP existence drm/i915: Rebind the buffer if its alignment constraints changes with tiling drm/i915: Disable GPU semaphores by default drm/i915: Do not overflow the MMADDR write FIFO Revert "drm/i915: fix corruptions on i8xx due to relaxed fencing" drm/i915: Don't save/restore hardware status page address register drm/i915: don't store the reg value for HWS_PGA drm/i915: fix memory corruption with GM965 and >4GB RAM Linux 2.6.38-rc7 Revert "TPM: Long default timeout fix" drm/i915: Re-enable GPU semaphores for SandyBridge mobile drm/i915: Replace vblank PM QoS with "Interrupt-Based AGPBUSY#" Revert "drm/i915: Use PM QoS to prevent C-State starvation of gen3 GPU" drm/i915: Allow relocation deltas outside of target bo drm/i915: Silence an innocuous compiler warning for an unused variable fs/block_dev.c: fix new kernel-doc warning ACPI: Fix build for CONFIG_NET unset mm: <asm-generic/pgtable.h> must include <linux/mm_types.h> x86: Use u32 instead of long to set reset vector back to 0 ... Conflicts: drivers/gpu/drm/i915/i915_gem.c
Diffstat (limited to 'drivers/acpi/acpica/evxfgpe.c')
-rw-r--r--drivers/acpi/acpica/evxfgpe.c49
1 files changed, 26 insertions, 23 deletions
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index e9562a7cb2f9..3b20a3401b64 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -212,37 +212,40 @@ acpi_setup_gpe_for_wake(acpi_handle wake_device,
212 return_ACPI_STATUS(AE_BAD_PARAMETER); 212 return_ACPI_STATUS(AE_BAD_PARAMETER);
213 } 213 }
214 214
215 /* Validate wake_device is of type Device */
216
217 device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device);
218 if (device_node->type != ACPI_TYPE_DEVICE) {
219 return_ACPI_STATUS(AE_BAD_PARAMETER);
220 }
221
222 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); 215 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
223 216
224 /* Ensure that we have a valid GPE number */ 217 /* Ensure that we have a valid GPE number */
225 218
226 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); 219 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
227 if (gpe_event_info) { 220 if (!gpe_event_info) {
228 /* 221 goto unlock_and_exit;
229 * If there is no method or handler for this GPE, then the 222 }
230 * wake_device will be notified whenever this GPE fires (aka 223
231 * "implicit notify") Note: The GPE is assumed to be 224 /*
232 * level-triggered (for windows compatibility). 225 * If there is no method or handler for this GPE, then the
233 */ 226 * wake_device will be notified whenever this GPE fires (aka
234 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 227 * "implicit notify") Note: The GPE is assumed to be
235 ACPI_GPE_DISPATCH_NONE) { 228 * level-triggered (for windows compatibility).
236 gpe_event_info->flags = 229 */
237 (ACPI_GPE_DISPATCH_NOTIFY | 230 if (((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
238 ACPI_GPE_LEVEL_TRIGGERED); 231 ACPI_GPE_DISPATCH_NONE) && (wake_device != ACPI_ROOT_OBJECT)) {
239 gpe_event_info->dispatch.device_node = device_node;
240 }
241 232
242 gpe_event_info->flags |= ACPI_GPE_CAN_WAKE; 233 /* Validate wake_device is of type Device */
243 status = AE_OK; 234
235 device_node = ACPI_CAST_PTR(struct acpi_namespace_node,
236 wake_device);
237 if (device_node->type != ACPI_TYPE_DEVICE) {
238 goto unlock_and_exit;
239 }
240 gpe_event_info->flags = (ACPI_GPE_DISPATCH_NOTIFY |
241 ACPI_GPE_LEVEL_TRIGGERED);
242 gpe_event_info->dispatch.device_node = device_node;
244 } 243 }
245 244
245 gpe_event_info->flags |= ACPI_GPE_CAN_WAKE;
246 status = AE_OK;
247
248 unlock_and_exit:
246 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 249 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
247 return_ACPI_STATUS(status); 250 return_ACPI_STATUS(status);
248} 251}