PATCH: ecng for 6.x and 7.x

Kevin Foo kevin.foo at zaidibrahim.com
Fri Sep 14 07:03:54 PDT 2007


Hi Nate,

I have tested the patch, ecng-6c.diff, on Compaq Presario V3417AU laptop and ran all 4 tests. Here are the outputs:

Test 1 : no tunables set
http://bsd.ipv6.la/v3417au/dmesg-V3417AU-BATT.txt
http://bsd.ipv6.la/v3417au/sysctl-V3417AU-BATT.txt

Error :
NONE working properly



Test 2 : debug.acpi.ec.burst="1"
http://bsd.ipv6.la/v3417au/dmesg-V3417AU-BATT-ec.burst-1.txt
http://bsd.ipv6.la/v3417au/sysctl-V3417AU-BATT-ec.burst-1.txt

Error :
acpi_ec0: <Embedded Controller: GPE 0x1> port 0x62,0x66 on acpi0
acpi_ec0: EcRead: failed waiting to get data
    ACPI-0501: *** Error: Handler for [EmbeddedControl] returned AE_NO_HARDWARE_RESPONSE
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_._REG] (Node 0xc887ca20), AE_NO_HARDWARE_RESPONSE
acpi_ec0: can't install address space handler for \\_SB_.PCI0.EC0_ - AE_NO_HARDWARE_RESPONSE
acpi_ec0: EcRead: failed waiting to get data
    ACPI-0501: *** Error: Handler for [EmbeddedControl] returned AE_NO_HARDWARE_RESPONSE
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_._REG] (Node 0xc887ca20), AE_NO_HARDWARE_RESPONSE
device_attach: acpi_ec0 attach returned 6
battery0: battery initialization start
    ACPI-0356: *** Error: Region EmbeddedControl(3) has no handler
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0acpi_acad0: acline initialization start
_.GBST] (Node 0xc88c7020), AE_NOT_EXIST
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_.BAT0._BST] (Node 0xc88c6d00), AE_NOT_EXIST
battery0: error fetching current battery status -- AE_NOT_EXIST
    ACPI-0356: *** Error: Region EmbeddedControl(3) has no handler
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_.GBIF] (Node 0xc88c7040), AE_NOT_EXIST
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_.BAT0._BIF] (Node 0xc88c6d20), AE_NOT_EXIST
battery0: error fetching current battery info -- AE_NOT_EXIST



Test 3 : debug.acpi.ec.polled="1"
http://bsd.ipv6.la/v3417au/dmesg-V3417AU-BATT-ec.polled-1.txt
http://bsd.ipv6.la/v3417au/sysctl-V3417AU-BATT-ec.polled-1.txt

Error :
acpi_ec0: <Embedded Controller: GPE 0x1> port 0x62,0x66 on acpi0
battery0: battery initialization start
acpi_acad0: acline initialization start
acpi_ec0: EcRead: failed waiting to get data
    ACPI-0501: *** Error: Handler for [EmbeddedControl] returned AE_NO_HARDWARE_RESPONSE
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_.GBST] (Node 0xc88c7020), AE_NO_HARDWARE_RESPONSE
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_.BAT0._BST] (Node 0xc88c6d00), AE_NO_HARDWARE_RESPONSE
battery0: error fetching current battery status -- AE_NO_HARDWARE_RESPONSE
acpi_ec0: EcRead: failed waiting to get data
    ACPI-0501: *** Error: Handler for [EmbeddedControl] returned AE_NO_HARDWARE_RESPONSE
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_.GBIF] (Node 0xc88c7040), AE_NO_HARDWARE_RESPONSE
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_.BAT0._BIF] (Node 0xc88c6d20), AE_NO_HARDWARE_RESPONSE
battery0: error fetching current battery info -- AE_NO_HARDWARE_RESPONSE



Test 4 : both ="1"
http://bsd.ipv6.la/v3417au/dmesg-V3417AU-BATT-both-1.txt
http://bsd.ipv6.la/v3417au/sysctl-V3417AU-BATT-both-1.txt

Error :
acpi_ec0: <Embedded Controller: GPE 0x1> port 0x62,0x66 on acpi0
acpi_ec0: EcRead: failed waiting to get data
    ACPI-0501: *** Error: Handler for [EmbeddedControl] returned AE_NO_HARDWARE_RESPONSE
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_._REG] (Node 0xc887ca40), AE_NO_HARDWARE_RESPONSE
acpi_ec0: can't install address space handler for \\_SB_.PCI0.EC0_ - AE_NO_HARDWARE_RESPONSE
acpi_ec0: EcRead: failed waiting to get data
    ACPI-0501: *** Error: Handler for [EmbeddedControl] returned AE_NO_HARDWARE_RESPONSE
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_._REG] (Node 0xc887ca40), AE_NO_HARDWARE_RESPONSE
device_attach: acpi_ec0 attach returned 6
battery0: battery initialization start
    ACPI-0356: *** Error: Region EmbeddedControl(3)acpi_acad0: acline initialization start
 has no handler
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_.GBST] (Node 0xc88c8040), AE_NOT_EXIST
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_.BAT0._BST] (Node 0xc88c7d20), AE_NOT_EXIST
battery0: error fetching current battery status -- AE_NOT_EXIST
    ACPI-0356: *** Error: Region EmbeddedControl(3) has no handler
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_.GBIF] (Node 0xc88c8060), AE_NOT_EXIST
    ACPI-1304: *** Error: Method execution failed [\\_SB_.PCI0.EC0_.BAT0._BIF] (Node 0xc88c7d40), AE_NOT_EXIST
battery0: error fetching current battery info -- AE_NOT_EXIST


I also uploaded acpidump for the said unit at http://bsd.ipv6.la/v3417au/compaq-presario-V3417AU.asl for your perusal.

Please let me know if you need further tests on Compaq Presario V3417AU. Thanks for the work.

-- 
Warm regards,
Kevin Foo

Key fingerprint : 4B23 FC1C E50B 9693 CCDD  2A7D A048 E909 8924 9BDD
Public key : http://keyserver.linux.it/pks/lookup?op=get&search=0x89249BDD



On Friday 07 September 2007, Nate Lawson wrote:
> I've done some major rework on the EC driver.  This should help with
> various problems, including timeouts while checking battery status or
> temperature.  The attached patches are for 6.x and 7.x.  Please test and
> let me know if you get any new errors on dmesg or if it fixes things for
> you (especially HP/Compaq laptop owners).
> 
> If you still have problems, try setting each of these tunables
> individually and then both together (i.e., in /boot/loader.conf).  Note
> that this will be four (4) test runs total, so don't just set both and
> say it doesn't work.
> 
> debug.acpi.ec.burst="1"
> debug.acpi.ec.polled="1"
> 
> I've tested both patches on a Panasonic Y4 and UnnamedOEM laptop, no
> problems in either regular or burst mode.
> 
> 
> Commit message:
> Rewrite the EC driver event model.  The main goal is to avoid
> polling/interrupt-driven fallback and instead use polling only during
> boot and pure interrupt-driven mode after boot.  Polled mode could be
> relegated completely to a legacy role if we could enable interrupts
> during boot.  Polled mode can be forced after boot by setting
> debug.acpi.ec.polled="1", i.e. if there are timeouts.
> 
> - Use polling only during boot or if requested by the user.  Otherwise,
> use a generation count of GPEs, incremented atomically.  This prevents
> an old status value from being used if the EC is really slow and the
> same condition (i.e. multiple IBEs for a write transaction) is being
> checked.
> - Check for and run the query handler directly if the SCI bit is set in
> the status register during boot.  Previously, the query handler wouldn't
> run until interrupts were finally enabled late in boot.
> - During boot and after starting a command, check if the event appears
> to already have occurred before we even start waiting.  If so, it's
> possible the EC is very slow and we might accept an old status value.
>  Print a warning in this case.  Once we've booted, interrupt-driven mode
> should work just fine but polled mode will be unreliable.  There's not
> much more we can do about this until interrupts are enabled during boot.
> - Hold the sx lock over the entire query handler, since the GPE handler
> no longer grabs any lock
> - Use upper-case hex for the _Qxx method
> - Use device_printf for errors, don't hide them under verbose
> - Increase default total timeout to 750 ms and polling interval to 5 us.
> - Don't pass the status value via the softc.  Just read it directly.
> - Remove the mutex. We use the sx lock for transaction serialization
> with the query handler.
> - Remove the Intel copyright notice as no code of theirs was ever
> present in this file (verified against rev 1.1)
> 
> 
> -Nate
> 
*****************************Internet Email Confidentiality Footer ***************************** 

Legal Privilege & Confidentiality 
---------------------------------------------------------------------------------------------------------------------------------------------------------------

This email contains privileged and/or confidential information.  If you are not the intended recipient (or responsible for delivery of the message to such person) or if you have inadvertently received this email, you should destroy or delete this message and notify the sender by reply email accordingly. If you or your employer do not consent to using Internet email for messages of this kind please advise immediately by sending an email to the sender of this message .  All opinions, conclusions and other information in this message that do not relate to the official business of Zaid Ibrahim & Co shall be understood as neither given nor endorsed by Zaid Ibrahim & Co. Our company accepts no liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing.  

Caveat 
-------------------------------------------------------------------------------------------------------------------------------------------------------------WARNING: Computer viruses can be transmitted via email, and you should check this email and any attachments for the presence of viruses. Zaid Ibrahim & Co accepts no liability for any damage caused by any virus transmitted by this email. Our employees are expressly required not to make defamatory statements nor infringe or authorise any infringement of copyright or any other legal right via any communications. Any such communication is contrary to our company policy and outside the scope of the employment of said individual. We will not be liable for such communication. 




More information about the freebsd-acpi mailing list