public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Nate Lawson <nate-Y6VGUYTwhu0@public.gmane.org>
To: "Moore, Robert" <robert.moore-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Ducrot Bruno <ducrot-kk6yZipjEM5g9hUCZPvPmw@public.gmane.org>,
	"Grover,
	Andrew" <andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	Robert Vollmert <rvollmert-lists-hi6Y0CQ0nG0@public.gmane.org>,
	Mads Paulin <paulin-/w0Os/Ss2Sh/SzgSGea1oA@public.gmane.org>
Subject: RE: [buggy index field handling] [patch]
Date: Fri, 26 Sep 2003 10:08:37 -0700 (PDT)	[thread overview]
Message-ID: <20030926100737.Q64952@root.org> (raw)
In-Reply-To: <D3A3AA459175A44CB5326F26DA7A189C1C3D88-sBd4vmA9Se58QrAoInS571DQ4js95KgL@public.gmane.org>

No, that is not the right patch.  The better one is at the bottom of my
email, by Robert Vollmert.

-Nate

On Tue, 23 Sep 2003, Moore, Robert wrote:
> Is this the final patch?  If so, we will integrate it into the ACPI CA
> core
> Bob
>
> -----Original Message-----
> From: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> [mailto:acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Ducrot
> Bruno
> Sent: Monday, September 22, 2003 10:19 AM
> To: Grover, Andrew
> Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org; Robert Vollmert; Mads Paulin
> Subject: [ACPI] [buggy index field handling] [patch]
>
> Hi Andy,
>
> There is a funny bug in acpi/executer/exfldio.c::acpi_ex_field_datum_io
> When the field come from an indexed one, we read all the time from the
> address obj_desc->index_field.value
> Unfortunately, this is wrong, since the correct address is
> obviously &obj_desc->index_field.value + field_datum_byte_offset
>
> --- linux-2.6.0-test5/drivers/acpi/executer/exfldio.c	2003/09/22
> 17:09:20	1.1
> +++ linux-2.6.0-test5/drivers/acpi/executer/exfldio.c	2003/09/22
> 17:10:11
> @@ -425,7 +425,7 @@
>  		/* Write the index value to the index_register (itself a
> region_field) */
>
>  		status = acpi_ex_insert_into_field
> (obj_desc->index_field.index_obj,
> -				 &obj_desc->index_field.value,
> +				 &obj_desc->index_field.value +
> field_datum_byte_offset,
>  				 sizeof (obj_desc->index_field.value));
>  		if (ACPI_FAILURE (status)) {
>  			return_ACPI_STATUS (status);

Here's a patch.

--- exfldio.c.orig	2003-09-22 18:22:09.000000000 +0200
+++ exfldio.c	2003-09-22 19:16:11.000000000 +0200
@@ -346,6 +346,7 @@
 {
 	acpi_status                     status;
 	acpi_integer                    local_value;
+	acpi_integer                    index_field_value;


 	ACPI_FUNCTION_TRACE_U32 ("ex_field_datum_io", field_datum_byte_offset);
@@ -448,18 +449,22 @@

 	case ACPI_TYPE_LOCAL_INDEX_FIELD:

+		/* Compute index value to access the current datum */
+
+		index_field_value = (acpi_integer) obj_desc->index_field.value
+			+ field_datum_byte_offset;

 		/* Ensure that the index_value is not beyond the capacity of the register */

 		if (acpi_ex_register_overflow (obj_desc->index_field.index_obj,
-				  (acpi_integer) obj_desc->index_field.value)) {
+					       index_field_value)) {
 			return_ACPI_STATUS (AE_AML_REGISTER_LIMIT);
 		}

 		/* Write the index value to the index_register (itself a region_field) */

 		status = acpi_ex_insert_into_field (obj_desc->index_field.index_obj,
-				 &obj_desc->index_field.value,
+				 &index_field_value,
 				 sizeof (obj_desc->index_field.value));
 		if (ACPI_FAILURE (status)) {
 			return_ACPI_STATUS (status);




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

  parent reply	other threads:[~2003-09-26 17:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-23 17:27 [buggy index field handling] [patch] Moore, Robert
     [not found] ` <D3A3AA459175A44CB5326F26DA7A189C1C3D88-sBd4vmA9Se58QrAoInS571DQ4js95KgL@public.gmane.org>
2003-09-23 18:13   ` Ducrot Bruno
2003-09-26 17:08   ` Nate Lawson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-09-23 21:26 Moore, Robert
2003-09-22 17:18 Ducrot Bruno
     [not found] ` <20030922171847.GN11391-kk6yZipjEM5g9hUCZPvPmw@public.gmane.org>
2003-09-22 17:25   ` Ducrot Bruno
2003-09-22 17:36   ` Ducrot Bruno
     [not found]     ` <20030922173615.GP11391-kk6yZipjEM5g9hUCZPvPmw@public.gmane.org>
2003-09-22 18:02       ` Ducrot Bruno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030926100737.Q64952@root.org \
    --to=nate-y6vguytwhu0@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=ducrot-kk6yZipjEM5g9hUCZPvPmw@public.gmane.org \
    --cc=paulin-/w0Os/Ss2Sh/SzgSGea1oA@public.gmane.org \
    --cc=robert.moore-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=rvollmert-lists-hi6Y0CQ0nG0@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox