evgpe.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. /******************************************************************************
  2. *
  3. * Module Name: evgpe - General Purpose Event handling and dispatch
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2010, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #include <acpi/acpi.h>
  43. #include "accommon.h"
  44. #include "acevents.h"
  45. #include "acnamesp.h"
  46. #define _COMPONENT ACPI_EVENTS
  47. ACPI_MODULE_NAME("evgpe")
  48. /* Local prototypes */
  49. static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context);
  50. /*******************************************************************************
  51. *
  52. * FUNCTION: acpi_ev_update_gpe_enable_masks
  53. *
  54. * PARAMETERS: gpe_event_info - GPE to update
  55. *
  56. * RETURN: Status
  57. *
  58. * DESCRIPTION: Updates GPE register enable masks based upon whether there are
  59. * references (either wake or run) to this GPE
  60. *
  61. ******************************************************************************/
  62. acpi_status
  63. acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info)
  64. {
  65. struct acpi_gpe_register_info *gpe_register_info;
  66. u8 register_bit;
  67. ACPI_FUNCTION_TRACE(ev_update_gpe_enable_masks);
  68. gpe_register_info = gpe_event_info->register_info;
  69. if (!gpe_register_info) {
  70. return_ACPI_STATUS(AE_NOT_EXIST);
  71. }
  72. register_bit = (u8)
  73. (1 <<
  74. (gpe_event_info->gpe_number - gpe_register_info->base_gpe_number));
  75. /* Clear the wake/run bits up front */
  76. ACPI_CLEAR_BIT(gpe_register_info->enable_for_wake, register_bit);
  77. ACPI_CLEAR_BIT(gpe_register_info->enable_for_run, register_bit);
  78. /* Set the mask bits only if there are references to this GPE */
  79. if (gpe_event_info->runtime_count) {
  80. ACPI_SET_BIT(gpe_register_info->enable_for_run, register_bit);
  81. }
  82. if (gpe_event_info->wakeup_count) {
  83. ACPI_SET_BIT(gpe_register_info->enable_for_wake, register_bit);
  84. }
  85. return_ACPI_STATUS(AE_OK);
  86. }
  87. /*******************************************************************************
  88. *
  89. * FUNCTION: acpi_ev_enable_gpe
  90. *
  91. * PARAMETERS: gpe_event_info - GPE to enable
  92. *
  93. * RETURN: Status
  94. *
  95. * DESCRIPTION: Hardware-enable a GPE. Always enables the GPE, regardless
  96. * of type or number of references.
  97. *
  98. * Note: The GPE lock should be already acquired when this function is called.
  99. *
  100. ******************************************************************************/
  101. acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
  102. {
  103. acpi_status status;
  104. ACPI_FUNCTION_TRACE(ev_enable_gpe);
  105. /*
  106. * We will only allow a GPE to be enabled if it has either an
  107. * associated method (_Lxx/_Exx) or a handler. Otherwise, the
  108. * GPE will be immediately disabled by acpi_ev_gpe_dispatch the
  109. * first time it fires.
  110. */
  111. if (!(gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK)) {
  112. return_ACPI_STATUS(AE_NO_HANDLER);
  113. }
  114. /* Ensure the HW enable masks are current */
  115. status = acpi_ev_update_gpe_enable_masks(gpe_event_info);
  116. if (ACPI_FAILURE(status)) {
  117. return_ACPI_STATUS(status);
  118. }
  119. /* Clear the GPE (of stale events) */
  120. status = acpi_hw_clear_gpe(gpe_event_info);
  121. if (ACPI_FAILURE(status)) {
  122. return_ACPI_STATUS(status);
  123. }
  124. /* Enable the requested GPE */
  125. status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
  126. return_ACPI_STATUS(status);
  127. }
  128. /*******************************************************************************
  129. *
  130. * FUNCTION: acpi_ev_disable_gpe
  131. *
  132. * PARAMETERS: gpe_event_info - GPE to disable
  133. *
  134. * RETURN: Status
  135. *
  136. * DESCRIPTION: Hardware-disable a GPE. Always disables the requested GPE,
  137. * regardless of the type or number of references.
  138. *
  139. * Note: The GPE lock should be already acquired when this function is called.
  140. *
  141. ******************************************************************************/
  142. acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
  143. {
  144. acpi_status status;
  145. ACPI_FUNCTION_TRACE(ev_disable_gpe);
  146. /*
  147. * Note: Always disable the GPE, even if we think that that it is already
  148. * disabled. It is possible that the AML or some other code has enabled
  149. * the GPE behind our back.
  150. */
  151. /* Ensure the HW enable masks are current */
  152. status = acpi_ev_update_gpe_enable_masks(gpe_event_info);
  153. if (ACPI_FAILURE(status)) {
  154. return_ACPI_STATUS(status);
  155. }
  156. /*
  157. * Always H/W disable this GPE, even if we don't know the GPE type.
  158. * Simply clear the enable bit for this particular GPE, but do not
  159. * write out the current GPE enable mask since this may inadvertently
  160. * enable GPEs too early. An example is a rogue GPE that has arrived
  161. * during ACPICA initialization - possibly because AML or other code
  162. * has enabled the GPE.
  163. */
  164. status = acpi_hw_low_disable_gpe(gpe_event_info);
  165. return_ACPI_STATUS(status);
  166. }
  167. /*******************************************************************************
  168. *
  169. * FUNCTION: acpi_ev_low_get_gpe_info
  170. *
  171. * PARAMETERS: gpe_number - Raw GPE number
  172. * gpe_block - A GPE info block
  173. *
  174. * RETURN: A GPE event_info struct. NULL if not a valid GPE (The gpe_number
  175. * is not within the specified GPE block)
  176. *
  177. * DESCRIPTION: Returns the event_info struct associated with this GPE. This is
  178. * the low-level implementation of ev_get_gpe_event_info.
  179. *
  180. ******************************************************************************/
  181. struct acpi_gpe_event_info *acpi_ev_low_get_gpe_info(u32 gpe_number,
  182. struct acpi_gpe_block_info
  183. *gpe_block)
  184. {
  185. u32 gpe_index;
  186. /*
  187. * Validate that the gpe_number is within the specified gpe_block.
  188. * (Two steps)
  189. */
  190. if (!gpe_block || (gpe_number < gpe_block->block_base_number)) {
  191. return (NULL);
  192. }
  193. gpe_index = gpe_number - gpe_block->block_base_number;
  194. if (gpe_index >= gpe_block->gpe_count) {
  195. return (NULL);
  196. }
  197. return (&gpe_block->event_info[gpe_index]);
  198. }
  199. /*******************************************************************************
  200. *
  201. * FUNCTION: acpi_ev_get_gpe_event_info
  202. *
  203. * PARAMETERS: gpe_device - Device node. NULL for GPE0/GPE1
  204. * gpe_number - Raw GPE number
  205. *
  206. * RETURN: A GPE event_info struct. NULL if not a valid GPE
  207. *
  208. * DESCRIPTION: Returns the event_info struct associated with this GPE.
  209. * Validates the gpe_block and the gpe_number
  210. *
  211. * Should be called only when the GPE lists are semaphore locked
  212. * and not subject to change.
  213. *
  214. ******************************************************************************/
  215. struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
  216. u32 gpe_number)
  217. {
  218. union acpi_operand_object *obj_desc;
  219. struct acpi_gpe_event_info *gpe_info;
  220. u32 i;
  221. ACPI_FUNCTION_ENTRY();
  222. /* A NULL gpe_device means use the FADT-defined GPE block(s) */
  223. if (!gpe_device) {
  224. /* Examine GPE Block 0 and 1 (These blocks are permanent) */
  225. for (i = 0; i < ACPI_MAX_GPE_BLOCKS; i++) {
  226. gpe_info = acpi_ev_low_get_gpe_info(gpe_number,
  227. acpi_gbl_gpe_fadt_blocks
  228. [i]);
  229. if (gpe_info) {
  230. return (gpe_info);
  231. }
  232. }
  233. /* The gpe_number was not in the range of either FADT GPE block */
  234. return (NULL);
  235. }
  236. /* A Non-NULL gpe_device means this is a GPE Block Device */
  237. obj_desc = acpi_ns_get_attached_object((struct acpi_namespace_node *)
  238. gpe_device);
  239. if (!obj_desc || !obj_desc->device.gpe_block) {
  240. return (NULL);
  241. }
  242. return (acpi_ev_low_get_gpe_info
  243. (gpe_number, obj_desc->device.gpe_block));
  244. }
  245. /*******************************************************************************
  246. *
  247. * FUNCTION: acpi_ev_gpe_detect
  248. *
  249. * PARAMETERS: gpe_xrupt_list - Interrupt block for this interrupt.
  250. * Can have multiple GPE blocks attached.
  251. *
  252. * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
  253. *
  254. * DESCRIPTION: Detect if any GP events have occurred. This function is
  255. * executed at interrupt level.
  256. *
  257. ******************************************************************************/
  258. u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
  259. {
  260. acpi_status status;
  261. struct acpi_gpe_block_info *gpe_block;
  262. struct acpi_gpe_register_info *gpe_register_info;
  263. u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
  264. u8 enabled_status_byte;
  265. u32 status_reg;
  266. u32 enable_reg;
  267. acpi_cpu_flags flags;
  268. u32 i;
  269. u32 j;
  270. ACPI_FUNCTION_NAME(ev_gpe_detect);
  271. /* Check for the case where there are no GPEs */
  272. if (!gpe_xrupt_list) {
  273. return (int_status);
  274. }
  275. /*
  276. * We need to obtain the GPE lock for both the data structs and registers
  277. * Note: Not necessary to obtain the hardware lock, since the GPE
  278. * registers are owned by the gpe_lock.
  279. */
  280. flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
  281. /* Examine all GPE blocks attached to this interrupt level */
  282. gpe_block = gpe_xrupt_list->gpe_block_list_head;
  283. while (gpe_block) {
  284. /*
  285. * Read all of the 8-bit GPE status and enable registers in this GPE
  286. * block, saving all of them. Find all currently active GP events.
  287. */
  288. for (i = 0; i < gpe_block->register_count; i++) {
  289. /* Get the next status/enable pair */
  290. gpe_register_info = &gpe_block->register_info[i];
  291. /* Read the Status Register */
  292. status =
  293. acpi_hw_read(&status_reg,
  294. &gpe_register_info->status_address);
  295. if (ACPI_FAILURE(status)) {
  296. goto unlock_and_exit;
  297. }
  298. /* Read the Enable Register */
  299. status =
  300. acpi_hw_read(&enable_reg,
  301. &gpe_register_info->enable_address);
  302. if (ACPI_FAILURE(status)) {
  303. goto unlock_and_exit;
  304. }
  305. ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS,
  306. "Read GPE Register at GPE%X: Status=%02X, Enable=%02X\n",
  307. gpe_register_info->base_gpe_number,
  308. status_reg, enable_reg));
  309. /* Check if there is anything active at all in this register */
  310. enabled_status_byte = (u8) (status_reg & enable_reg);
  311. if (!enabled_status_byte) {
  312. /* No active GPEs in this register, move on */
  313. continue;
  314. }
  315. /* Now look at the individual GPEs in this byte register */
  316. for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
  317. /* Examine one GPE bit */
  318. if (enabled_status_byte & (1 << j)) {
  319. /*
  320. * Found an active GPE. Dispatch the event to a handler
  321. * or method.
  322. */
  323. int_status |=
  324. acpi_ev_gpe_dispatch(&gpe_block->
  325. event_info[((acpi_size) i * ACPI_GPE_REGISTER_WIDTH) + j], j + gpe_register_info->base_gpe_number);
  326. }
  327. }
  328. }
  329. gpe_block = gpe_block->next;
  330. }
  331. unlock_and_exit:
  332. acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
  333. return (int_status);
  334. }
  335. /*******************************************************************************
  336. *
  337. * FUNCTION: acpi_ev_asynch_execute_gpe_method
  338. *
  339. * PARAMETERS: Context (gpe_event_info) - Info for this GPE
  340. *
  341. * RETURN: None
  342. *
  343. * DESCRIPTION: Perform the actual execution of a GPE control method. This
  344. * function is called from an invocation of acpi_os_execute and
  345. * therefore does NOT execute at interrupt level - so that
  346. * the control method itself is not executed in the context of
  347. * an interrupt handler.
  348. *
  349. ******************************************************************************/
  350. static void acpi_ev_asynch_enable_gpe(void *context);
  351. static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
  352. {
  353. struct acpi_gpe_event_info *gpe_event_info = (void *)context;
  354. acpi_status status;
  355. struct acpi_gpe_event_info local_gpe_event_info;
  356. struct acpi_evaluate_info *info;
  357. ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method);
  358. status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
  359. if (ACPI_FAILURE(status)) {
  360. return_VOID;
  361. }
  362. /* Must revalidate the gpe_number/gpe_block */
  363. if (!acpi_ev_valid_gpe_event(gpe_event_info)) {
  364. status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
  365. return_VOID;
  366. }
  367. /* Update the GPE register masks for return to enabled state */
  368. (void)acpi_ev_update_gpe_enable_masks(gpe_event_info);
  369. /*
  370. * Take a snapshot of the GPE info for this level - we copy the info to
  371. * prevent a race condition with remove_handler/remove_block.
  372. */
  373. ACPI_MEMCPY(&local_gpe_event_info, gpe_event_info,
  374. sizeof(struct acpi_gpe_event_info));
  375. status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
  376. if (ACPI_FAILURE(status)) {
  377. return_VOID;
  378. }
  379. /*
  380. * Must check for control method type dispatch one more time to avoid a
  381. * race with ev_gpe_install_handler
  382. */
  383. if ((local_gpe_event_info.flags & ACPI_GPE_DISPATCH_MASK) ==
  384. ACPI_GPE_DISPATCH_METHOD) {
  385. /* Allocate the evaluation information block */
  386. info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
  387. if (!info) {
  388. status = AE_NO_MEMORY;
  389. } else {
  390. /*
  391. * Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the _Lxx/_Exx
  392. * control method that corresponds to this GPE
  393. */
  394. info->prefix_node =
  395. local_gpe_event_info.dispatch.method_node;
  396. info->flags = ACPI_IGNORE_RETURN_VALUE;
  397. status = acpi_ns_evaluate(info);
  398. ACPI_FREE(info);
  399. }
  400. if (ACPI_FAILURE(status)) {
  401. ACPI_EXCEPTION((AE_INFO, status,
  402. "while evaluating GPE method [%4.4s]",
  403. acpi_ut_get_node_name
  404. (local_gpe_event_info.dispatch.
  405. method_node)));
  406. }
  407. }
  408. /* Defer enabling of GPE until all notify handlers are done */
  409. acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_asynch_enable_gpe,
  410. gpe_event_info);
  411. return_VOID;
  412. }
  413. static void acpi_ev_asynch_enable_gpe(void *context)
  414. {
  415. struct acpi_gpe_event_info *gpe_event_info = context;
  416. acpi_status status;
  417. if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
  418. ACPI_GPE_LEVEL_TRIGGERED) {
  419. /*
  420. * GPE is level-triggered, we clear the GPE status bit after handling
  421. * the event.
  422. */
  423. status = acpi_hw_clear_gpe(gpe_event_info);
  424. if (ACPI_FAILURE(status)) {
  425. return_VOID;
  426. }
  427. }
  428. /* Enable this GPE */
  429. (void)acpi_hw_write_gpe_enable_reg(gpe_event_info);
  430. return_VOID;
  431. }
  432. /*******************************************************************************
  433. *
  434. * FUNCTION: acpi_ev_gpe_dispatch
  435. *
  436. * PARAMETERS: gpe_event_info - Info for this GPE
  437. * gpe_number - Number relative to the parent GPE block
  438. *
  439. * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
  440. *
  441. * DESCRIPTION: Dispatch a General Purpose Event to either a function (e.g. EC)
  442. * or method (e.g. _Lxx/_Exx) handler.
  443. *
  444. * This function executes at interrupt level.
  445. *
  446. ******************************************************************************/
  447. u32
  448. acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
  449. {
  450. acpi_status status;
  451. ACPI_FUNCTION_TRACE(ev_gpe_dispatch);
  452. acpi_os_gpe_count(gpe_number);
  453. /*
  454. * If edge-triggered, clear the GPE status bit now. Note that
  455. * level-triggered events are cleared after the GPE is serviced.
  456. */
  457. if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
  458. ACPI_GPE_EDGE_TRIGGERED) {
  459. status = acpi_hw_clear_gpe(gpe_event_info);
  460. if (ACPI_FAILURE(status)) {
  461. ACPI_EXCEPTION((AE_INFO, status,
  462. "Unable to clear GPE[0x%2X]",
  463. gpe_number));
  464. return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
  465. }
  466. }
  467. /*
  468. * Dispatch the GPE to either an installed handler, or the control method
  469. * associated with this GPE (_Lxx or _Exx). If a handler exists, we invoke
  470. * it and do not attempt to run the method. If there is neither a handler
  471. * nor a method, we disable this GPE to prevent further such pointless
  472. * events from firing.
  473. */
  474. switch (gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) {
  475. case ACPI_GPE_DISPATCH_HANDLER:
  476. /*
  477. * Invoke the installed handler (at interrupt level)
  478. * Ignore return status for now.
  479. * TBD: leave GPE disabled on error?
  480. */
  481. (void)gpe_event_info->dispatch.handler->address(gpe_event_info->
  482. dispatch.
  483. handler->
  484. context);
  485. /* It is now safe to clear level-triggered events. */
  486. if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
  487. ACPI_GPE_LEVEL_TRIGGERED) {
  488. status = acpi_hw_clear_gpe(gpe_event_info);
  489. if (ACPI_FAILURE(status)) {
  490. ACPI_EXCEPTION((AE_INFO, status,
  491. "Unable to clear GPE[0x%2X]",
  492. gpe_number));
  493. return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
  494. }
  495. }
  496. break;
  497. case ACPI_GPE_DISPATCH_METHOD:
  498. /*
  499. * Disable the GPE, so it doesn't keep firing before the method has a
  500. * chance to run (it runs asynchronously with interrupts enabled).
  501. */
  502. status = acpi_ev_disable_gpe(gpe_event_info);
  503. if (ACPI_FAILURE(status)) {
  504. ACPI_EXCEPTION((AE_INFO, status,
  505. "Unable to disable GPE[0x%2X]",
  506. gpe_number));
  507. return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
  508. }
  509. /*
  510. * Execute the method associated with the GPE
  511. * NOTE: Level-triggered GPEs are cleared after the method completes.
  512. */
  513. status = acpi_os_execute(OSL_GPE_HANDLER,
  514. acpi_ev_asynch_execute_gpe_method,
  515. gpe_event_info);
  516. if (ACPI_FAILURE(status)) {
  517. ACPI_EXCEPTION((AE_INFO, status,
  518. "Unable to queue handler for GPE[0x%2X] - event disabled",
  519. gpe_number));
  520. }
  521. break;
  522. default:
  523. /*
  524. * No handler or method to run!
  525. * 03/2010: This case should no longer be possible. We will not allow
  526. * a GPE to be enabled if it has no handler or method.
  527. */
  528. ACPI_ERROR((AE_INFO,
  529. "No handler or method for GPE[0x%2X], disabling event",
  530. gpe_number));
  531. /*
  532. * Disable the GPE. The GPE will remain disabled a handler
  533. * is installed or ACPICA is restarted.
  534. */
  535. status = acpi_ev_disable_gpe(gpe_event_info);
  536. if (ACPI_FAILURE(status)) {
  537. ACPI_EXCEPTION((AE_INFO, status,
  538. "Unable to disable GPE[0x%2X]",
  539. gpe_number));
  540. return_UINT32(ACPI_INTERRUPT_NOT_HANDLED);
  541. }
  542. break;
  543. }
  544. return_UINT32(ACPI_INTERRUPT_HANDLED);
  545. }