aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/acpica/evxfgpe.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index cb534faf5369..82e5c146bdd4 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -126,11 +126,19 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number)
126 126
127 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); 127 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
128 128
129 /* Ensure that we have a valid GPE number */ 129 /*
130 130 * Ensure that we have a valid GPE number and that there is some way
131 * of handling the GPE (handler or a GPE method). In other words, we
132 * won't allow a valid GPE to be enabled if there is no way to handle it.
133 */
131 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); 134 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
132 if (gpe_event_info) { 135 if (gpe_event_info) {
133 status = acpi_ev_add_gpe_reference(gpe_event_info); 136 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) !=
137 ACPI_GPE_DISPATCH_NONE) {
138 status = acpi_ev_add_gpe_reference(gpe_event_info);
139 } else {
140 status = AE_NO_HANDLER;
141 }
134 } 142 }
135 143
136 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 144 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);