@@ -444,12 +444,19 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
444444 return (AE_OK );
445445}
446446
447+ struct acpi_gpe_block_status_context {
448+ struct acpi_gpe_register_info * gpe_skip_register_info ;
449+ u8 gpe_skip_mask ;
450+ u8 retval ;
451+ };
452+
447453/******************************************************************************
448454 *
449455 * FUNCTION: acpi_hw_get_gpe_block_status
450456 *
451457 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
452458 * gpe_block - Gpe Block info
459+ * context - GPE list walk context data
453460 *
454461 * RETURN: Success
455462 *
@@ -460,12 +467,13 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
460467static acpi_status
461468acpi_hw_get_gpe_block_status (struct acpi_gpe_xrupt_info * gpe_xrupt_info ,
462469 struct acpi_gpe_block_info * gpe_block ,
463- void * ret_ptr )
470+ void * context )
464471{
472+ struct acpi_gpe_block_status_context * c = context ;
465473 struct acpi_gpe_register_info * gpe_register_info ;
466474 u64 in_enable , in_status ;
467475 acpi_status status ;
468- u8 * ret = ret_ptr ;
476+ u8 ret_mask ;
469477 u32 i ;
470478
471479 /* Examine each GPE Register within the block */
@@ -485,7 +493,11 @@ acpi_hw_get_gpe_block_status(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
485493 continue ;
486494 }
487495
488- * ret |= in_enable & in_status ;
496+ ret_mask = in_enable & in_status ;
497+ if (ret_mask && c -> gpe_skip_register_info == gpe_register_info ) {
498+ ret_mask &= ~c -> gpe_skip_mask ;
499+ }
500+ c -> retval |= ret_mask ;
489501 }
490502
491503 return (AE_OK );
@@ -561,24 +573,41 @@ acpi_status acpi_hw_enable_all_wakeup_gpes(void)
561573 *
562574 * FUNCTION: acpi_hw_check_all_gpes
563575 *
564- * PARAMETERS: None
576+ * PARAMETERS: gpe_skip_device - GPE devoce of the GPE to skip
577+ * gpe_skip_number - Number of the GPE to skip
565578 *
566579 * RETURN: Combined status of all GPEs
567580 *
568- * DESCRIPTION: Check all enabled GPEs in all GPE blocks and return TRUE if the
581+ * DESCRIPTION: Check all enabled GPEs in all GPE blocks, except for the one
582+ * represented by the "skip" arguments, and return TRUE if the
569583 * status bit is set for at least one of them of FALSE otherwise.
570584 *
571585 ******************************************************************************/
572586
573- u8 acpi_hw_check_all_gpes (void )
587+ u8 acpi_hw_check_all_gpes (acpi_handle gpe_skip_device , u32 gpe_skip_number )
574588{
575- u8 ret = 0 ;
589+ struct acpi_gpe_block_status_context context = {
590+ .gpe_skip_register_info = NULL ,
591+ .retval = 0 ,
592+ };
593+ struct acpi_gpe_event_info * gpe_event_info ;
594+ acpi_cpu_flags flags ;
576595
577596 ACPI_FUNCTION_TRACE (acpi_hw_check_all_gpes );
578597
579- (void )acpi_ev_walk_gpe_list (acpi_hw_get_gpe_block_status , & ret );
598+ flags = acpi_os_acquire_lock (acpi_gbl_gpe_lock );
599+
600+ gpe_event_info = acpi_ev_get_gpe_event_info (gpe_skip_device ,
601+ gpe_skip_number );
602+ if (gpe_event_info ) {
603+ context .gpe_skip_register_info = gpe_event_info -> register_info ;
604+ context .gpe_skip_mask = acpi_hw_get_gpe_register_bit (gpe_event_info );
605+ }
606+
607+ acpi_os_release_lock (acpi_gbl_gpe_lock , flags );
580608
581- return (ret != 0 );
609+ (void )acpi_ev_walk_gpe_list (acpi_hw_get_gpe_block_status , & context );
610+ return (context .retval != 0 );
582611}
583612
584613#endif /* !ACPI_REDUCED_HARDWARE */
0 commit comments