From owner-acpi-jp@jp.freebsd.org  Wed Jan  3 04:19:27 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id EAA20663;
	Wed, 3 Jan 2001 04:19:27 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from opium.mbsi.ca (opium.mbsi.ca [198.168.101.1])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id EAA20658
	for <acpi-jp@jp.freebsd.org>; Wed, 3 Jan 2001 04:19:25 +0900 (JST)
	(envelope-from marc@opium.mbsi.ca)
Received: (from marc@localhost)
	by opium.mbsi.ca (8.11.1/8.11.1) id f02JHdD11115;
	Tue, 2 Jan 2001 14:17:39 -0500 (EST)
Date: Tue, 2 Jan 2001 14:17:38 -0500
From: Marc Boucher <marc@mbsi.ca>
To: "Adam J. Richter" <adam@yggdrasil.com>
Cc: takawata@shidahara1.planet.sci.kobe-u.ac.jp, peter@netplex.com.au,
        msmith@freebsd.org, acpi-jp@jp.freebsd.org, fudge_factor@hotmail.com,
        acme@conectiva.com.br
Message-ID: <20010102141738.A11097@opium.mbsi.ca>
References: <20010102021341.A3451@baldur.yggdrasil.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.12i
In-Reply-To: <20010102021341.A3451@baldur.yggdrasil.com>; from adam@yggdrasil.com on Tue, Jan 02, 2001 at 02:13:41AM -0800
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: acpi-jp 1016
Subject: [acpi-jp 1016] Re: [Acpi] Patch(?): Peter Wemm's Sony Vaio ACPI fix simplified and adapted to linux-2.4.0-prerelease
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: marc@mbsi.ca

Hi Adam, folks,

Unfortunately this patch didn't fix the hang at initialization
(in EC0_BAT1's _STA method) on my Vaio PCG-Z505LS.

Regards,
Marc

On Tue, Jan 02, 2001 at 02:13:41AM -0800, Adam J. Richter wrote:
> 
> 	Many thanks to Peter Wemm for fixing the ACPI hangs that
> occurred on some Sony Vaio computers and to Takanori Watanabe for
> his help and forwarding Peter's patch to me.
> 
> 	I have simplified Peter Wemm's patch so that it does
> not need a new variable, a switch statement or a new goto target,
> and I have made the change to linux-2.4.0-prerelease and verified
> that it makes acpi work again on my Sony PictureBook PCG-1VN
> (the Transmeta version), at least to the extent that it does not
> hang at initialization and it shuts down the power when requested.
> 
> 	I think that Peter's debugging print message changes are
> not related to the Linux version, so the *BSD crowd should probably
> still apply those separately.  As for the changes that are reflected
> in this Linux patch, I recommend that *BSD people consider applying
> an adaptation of these changes to the *BSD sources, as they are
> substantially simpler.
> 
> -- 
> Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
> adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
> +1 408 261-6630         | g g d r a s i l   United States of America
> fax +1 408 261-6631      "Free Software For The Rest Of Us."

> --- linux-2.4.0-prerelease/drivers/acpi/interpreter/amfldio.c	Fri Dec 29 14:07:21 2000
> +++ linux/drivers/acpi/interpreter/amfldio.c	Tue Jan  2 02:00:04 2001
> @@ -391,9 +391,6 @@
>  
>  	merged_value = field_value;
>  
> -	/* Check if update rule needs to be applied (not if mask is all ones) */
> -
> -
>  	/* Decode the update rule */
>  
>  	switch (obj_desc->field.update_rule)
> @@ -402,12 +399,19 @@
>  	case UPDATE_PRESERVE:
>  
>  		/*
> -		 * Read the current contents of the byte/word/dword containing
> -		 * the field, and merge with the new field value.
> +	  	 * Check if update rule needs to be applied (not if mask
> +		 * is all ones).  If so, read the current contents of
> +		 * the byte/word/dword containing the field, and merge
> +		 * with the new field value.
>  		 */
> -		status = acpi_aml_read_field_data (obj_desc, this_field_byte_offset,
> +
> +
> +		if (((1UL << bit_granularity)-1) & ~mask) {
> +			status = acpi_aml_read_field_data (obj_desc,
> +				   this_field_byte_offset,
>  				   bit_granularity, &current_value);
> -		merged_value |= (current_value & ~mask);
> +			merged_value |= (current_value & ~mask);
> +		}
>  		break;
>  
>  

