Re: [PATCH]: ACPI Cleanup :Initialize EC global lock based on the return status

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

 



On Tue, 2008-11-04 at 16:05 +0800, Alexey Starikovskiy wrote:
> NAK
Will you please describe the detailed reason?

In the bug 11917 the regression is related with the following commit:
    >commit 27663c5855b10af9ec67bc7dfba001426ba21222
    >Author: Matthew Wilcox <willy@xxxxxxxxxxxxxxx>
    >Date:   Fri Oct 10 02:22:59 2008 -0400
    >ACPI: Change acpi_evaluate_integer to support 64-bit on 32-bit
kernels

    But IMO the main reason is that EC driver misuses the Linux-ACPI
utility interface.(acpi_evaluate_integer).  
    It will be better to determine whether the return value of ACPI
object is effective according to the return status. In such case the
code still can work well even after the Linux-ACPI utility interface is
changed again.
     
    
> Zhao Yakui wrote:
> > Subject: ACPI: Cleanup :Initialize EC global lock based on the return status
> > From: Zhao Yakui <yakui.zhao@xxxxxxxxx>
> > 
> > Initialize the EC global lock based on the returned value of _GLK object.
> > Only when AE_OK is returned by the acpi_evaluate_integer, the EC global lock
> > will be assigned based on the return value of _GLK object.Otherwise it means
> > that there is no _GLK object and the global lock won't be required when EC
> > is accessed.
> > If the return value of _GLK object is not zero, it means that GLobal lock
> > will be required when EC is accessed.
> > If the return value of _GLK object is zero, it means that GLobal lock
> > won't be required when EC is accessed.
> > 
> > Signed-off-by: Zhao Yakui <yakui.zhao@xxxxxxxxx>
> > cc: Alexey Starikovskiy <astarikovskiy@xxxxxxx>
> > cc: Alan Jenkins <alan-jenkins@xxxxxxxxxxxxxx>
> > 
> > ---
> >  drivers/acpi/ec.c |   24 ++++++++++++++++++++++--
> >  1 file changed, 22 insertions(+), 2 deletions(-)
> > 
> > Index: linux-2.6/drivers/acpi/ec.c
> > ===================================================================
> > --- linux-2.6.orig/drivers/acpi/ec.c
> > +++ linux-2.6/drivers/acpi/ec.c
> > @@ -752,8 +752,28 @@ ec_parse_device(acpi_handle handle, u32 
> >  	ec->gpe = tmp;
> >  	/* Use the global lock for all EC transactions? */
> >  	tmp = 0;
> > -	acpi_evaluate_integer(handle, "_GLK", NULL, &tmp);
> > -	ec->global_lock = tmp;
> > +	/*
> > +	 * Only when AE_OK is returned by acpi_evaluate_interger,
> > +	 * the ec->global_lock will be assigned based on the returned
> > +	 * value by _GLK. Otherwise it means that there is no _GLK object
> > +	 * and global lock won't be required when EC is accessed.
> > +	 * If the return value of _GLK object is not zero, it means that
> > +	 * global lock will be required when EC is accessed.
> > +	 * If the return value of _GLK object is zero, it means that
> > +	 * global lock won't be required when EC is accessed.
> > +	 */
> > +	status = acpi_evaluate_integer(handle, "_GLK", NULL, &tmp);
> > +	if (ACPI_SUCCESS(status)) {
> > +		/*
> > +		 * If the return value is not zero, it means that global lock
> > +		 * is required when EC is accessed
> > +		 */
> > +		if (tmp)
> > +			ec->global_lock = 1;
> > +		else
> > +			ec->global_lock = 0;
> > +	} else
> > +		ec->global_lock = 0;
> >  	ec->handle = handle;
> >  	return AE_CTRL_TERMINATE;
> >  }
> > 
> > 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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