WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 2/3] Fix acpi_set_register

To: "Wei, Gang" <gang.wei@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 2/3] Fix acpi_set_register
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Wed, 03 Sep 2008 09:43:12 +0100
Cc:
Delivery-date: Wed, 03 Sep 2008 01:43:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <8FED46E8A9CA574792FC7AACAC38FE77018065240E@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AckNZ8FAkjXVCLOZRyun0P1uSubhuQAOVfvn
Thread-topic: [Xen-devel] [PATCH 2/3] Fix acpi_set_register
User-agent: Microsoft-Entourage/11.4.0.080122
acpi_set_register() is doing a read-modify-write of PM2_CONTROL. It's only
safe to skip the read if the modification is going to obliterate all old
bits. Is the read really that expensive (and equally, in patch 3, is the
write of ARB_DIS really that expensive)?

 -- Keir

On 3/9/08 02:52, "Wei, Gang" <gang.wei@xxxxxxxxx> wrote:

> ACPI: Remove a redundant call to acpi_hw_register_read().
> 
> Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>
> 
> diff -r fc0b0c64246d xen/drivers/acpi/hwregs.c
> --- a/xen/drivers/acpi/hwregs.c Thu Aug 21 16:15:30 2008 +0800
> +++ b/xen/drivers/acpi/hwregs.c Mon Aug 25 15:24:32 2008 +0800
> @@ -238,12 +238,6 @@ acpi_status acpi_set_register(u32 regist
>                 break;
> 
>         case ACPI_REGISTER_PM2_CONTROL:
> -
> -               status = acpi_hw_register_read(ACPI_REGISTER_PM2_CONTROL,
> -                                              &register_value);
> -               if (ACPI_FAILURE(status)) {
> -                       goto unlock_and_exit;
> -               }
> 
>                 ACPI_DEBUG_PRINT((ACPI_DB_IO,
>                                   "PM2 control: Read %X from %8.8X%8.8X\n",
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel