diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-23 01:11:59 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-23 17:12:32 -0400 |
commit | b9ca3d7b513a9824dc97d5dc7c4eb9e30ab776b5 (patch) | |
tree | 4af951a2396a803ef29218f7933332c0a8a43396 /drivers/acpi/acpica/evxfgpe.c | |
parent | 7817e265233e4b216aad509fc003cf4face238b9 (diff) |
ACPICA: GPEs: Do not allow enable for GPEs that have no handler(s).
ACPICA commit 23b5a8542283af28c3a3a4e3f81096d6e2569faa
There is no point in enabling a GPE that has no handler or
GPE method. At worst, it can cause GPE floods.
Rafael Wysocki.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/evxfgpe.c')
-rw-r--r-- | drivers/acpi/acpica/evxfgpe.c | 14 |
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); |