RE: [RFC PATCH] ACPICA: Improve GPE detect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



They are 8 enable bits per gpe_register.

So, may as well OR them together first and use a single compare.


-----Original Message-----
From: Rafael J. Wysocki [mailto:rjw@xxxxxxx] 
Sent: Friday, December 17, 2010 12:23 PM
To: Moore, Robert
Cc: Lin, Ming M; lenb; linux-acpi
Subject: Re: [RFC PATCH] ACPICA: Improve GPE detect

On Wednesday, December 15, 2010, Moore, Robert wrote:
> +			if (!gpe_register_info->enable_for_run &&
> +				!gpe_register_info->enable_for_wake) {
> 
> I would bitwise OR them together first
> 
> +			if (!(gpe_register_info->enable_for_run |
> +				gpe_register_info->enable_for_wake)) {

Well, I think a || would be a little better (they are treated as flags rather
than bit patterns everywhere else), but I generally agree.

The patch looks good apart from this.

Thanks,
Rafael


> -----Original Message-----
> From: Lin, Ming M 
> Sent: Wednesday, December 15, 2010 12:00 AM
> To: Rafael J. Wysocki
> Cc: lenb; Moore, Robert; linux-acpi
> Subject: [RFC PATCH] ACPICA: Improve GPE detect
> 
> Hi, Rafael
> 
> Currently, the ACPICA GPE interrupt handler reads all the GPE registers to
> detect which GPEs, if any, have fired. This is done on each and every SCI,
> since there is no way to know up front if any GPEs have been raised.
> 
> However, since ACPICA internally keeps a GPE enable mask for every GPE
> register, it may be possible to ignore any GPE registers whose internal
> GPE enable mask is zero. This would eliminate reading the status and enable
> registers for that particular GPE register pair.
> 
> http://www.acpica.org/bugzilla/show_bug.cgi?id=884
> 
> I have tested suspend/resume and it works OK.
> What do you think about below simple patch?
> 
> Thanks.
> ---
>  drivers/acpi/acpica/evgpe.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
> index 7c339d3..49fab43 100644
> --- a/drivers/acpi/acpica/evgpe.c
> +++ b/drivers/acpi/acpica/evgpe.c
> @@ -373,6 +373,14 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
>  
>  			gpe_register_info = &gpe_block->register_info[i];
>  
> +			if (!gpe_register_info->enable_for_run &&
> +				!gpe_register_info->enable_for_wake) {
> +
> +				/* Disabled for both "runtime" and "wakeup", move on */
> +
> +				continue;
> +			}
> +
>  			/* Read the Status Register */
>  
>  			status =
> 
> 
> 

ÿô.nlj·Ÿ®‰­†+%ŠË±é¥Šwÿº{.nlj·¥Š{±ý¶›¡Ü}©ž²ÆzÚj:+v‰¨þø®w¥þŠàÞ¨è&¢)ß«a¶Úÿûz¹ÞúŽŠÝjÿŠwèf



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux