Re: [RFC] [PATCH] ACPI :Remove the EC space handler explicitly when failing in _REG object

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

 



On Fri, 2008-11-28 at 16:08 +0800, Alexey Starikovskiy wrote:
> Zhao Yakui wrote:
> > On Thu, 2008-11-27 at 17:42 +0800, Alexey Starikovskiy wrote:
> >> Zhao Yakui wrote:
> >>> On Thu, 2008-11-27 at 04:03 +0800, Alexey Starikovskiy wrote:
> >>>> This is hardly a "fix", you just disable EC on this machine... Famous 
> >>> Yes. This can't fix the issue on the box of bug11884. 
> >>> But in theory if the incorrect status is returned by
> >>> acpi_install_address_space_handler, the EC space handler should be
> >>> removed explicitly. Right? In such case the EC device will be disabled
> >>> on this box. 
> >> Wrong. If any function is allowed to fail, you should not call counter function
> >> to recover -- you don't call free() on failed malloc(), you don't call close() on
> >> failed open().
> > 
> > In the function of acpi_install_address_space_handler the following two
> > steps are done in ACPCA:
> >    a. Install the space handler for one operation region. This space
> > handler is applied for the same type operation region of every device.
> >    b. run the _REG object for all the operation regions using the space
> > id. It will enumerate the ACPI namespace to execute the _REG object for
> > the same operation region
> Unregister space handler will do all these things in opposite order, thus calling 
> failed _REG object once again, causing more damage.
Uninstall the space handler will do the above things in opposite order.
First the _REG object will be called(The second argument of _REG is
zero) and then the space handler will be removed. 
    For the EC device. When the _REG object is called, it can be used to
indicate whether the EC operation region is enabled or disabled. 
     If the second argument of _REG object is one, it indicates that the
EC operation region is accessible. And the flag in AML code will be set
to one.
     If the second argument of _REG object is zero, it indicates that
the EC operation region is not accessible. And the flag in AML code will
be set to zero again.
    In such case if the failed _REG object is not called again, the EC
flag in AML code indicates that the EC operation is accessible. But the
EC device is not initialized properly. It will be inconsistent.

    Will you please describe the damage in detail if the failed _REG is
called again?   
> >
> You have address space identifier in this function, so if you want your 
> workaround to be "only for EC", check it. 
Of course it can also be workaround by checking the space id in the
function of acpi_install_address_space_handler. But on most laptops
there is no issue of failed _REG object. And it is not appropriate that
such workaround source code is added in ACPICA for so rare case.
Maybe it is convenient that the workaround is added in EC driver for so
rare case. 
Thanks.
> > And it is also unreasonable that the space handler is removed for the
> > same type operation region of all the devices only because OS fails in
> > _REG object of one device.
> > If you have better method to fix such issue, please write it. 
> Yakui, why should I complete all your jobs?
> 
> Alex.

--
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