New acpi_ec.c

From: Ted Lindgreen <ted_at_tednet.nl>
Date: Wed, 26 Sep 2007 11:26:24 +0200
Hi,

The file /usr/src/sys/dev/acpica/acpi_ec.c has been updated recently.
This broke my patch (about which I have posted earlier this year
(around March) to let my Acer 3623 behave properly.

I append a new patch, which can be applied to the new acpi_ec.c.

To recap the problem and the hack that I found to fix it:
- It appears that the EC of my Acer 3623 does not like to be
  polled for status to soon after writing a command to it.
- The error message AE_NO_HARDWARE_RESPONSE is output in enormous
  amounts, and commands like apm(8) fail.
- With a delay of 2500 the amount of AE_NO_HARDWARE_RESPONSE messages
  drops significantly, and apm(8) works.
- With a delay of 3000 no more AE_NO_HARDWARE_RESPONSE messages appear,
  and everything works flawlessly.

regards,
-- ted

PS. the patch:

In /boot/loader.conf I have:
  debug.acpi.ec.burst="1"
  debug.acpi.ec.waitbeforepoll="3000"

and the change in acpi_ec.c:

--- acpi_ec.c	2007-09-26 11:18:27.000000000 +0200
+++ acpi_ec.c.org	2007-09-24 18:59:06.000000000 +0200
_at__at_ -193,10 +193,6 _at__at_
 TUNABLE_INT("debug.acpi.ec.timeout", &ec_timeout);
 SYSCTL_INT(_debug_acpi_ec, OID_AUTO, timeout, CTLFLAG_RW, &ec_timeout,
     EC_TIMEOUT, "Total time spent waiting for a response (poll+sleep)");
-static int	ec_waitbeforepoll = 0;
-TUNABLE_INT("debug.acpi.ec.waitbeforepoll", &ec_waitbeforepoll);
-SYSCTL_INT(_debug_acpi_ec, OID_AUTO, waitbeforepoll, CTLFLAG_RW, &ec_waitbeforepoll,
-    0, "Wait before starting to poll");
 
 static ACPI_STATUS
 EcLock(struct acpi_ec_softc *sc)
_at__at_ -806,10 +802,6 _at__at_
     if (cold || rebooting || ec_polled_mode) {
 	static int	once;
 
-      /* Some EC's just need enough time before they can be polled */
-      if (ec_waitbeforepoll > 0)
-		AcpiOsStall(ec_waitbeforepoll);
-      else {
 	if (EcCheckStatus(sc, "pre-check", Event) == AE_OK) {
 	    if (!once) {
 		device_printf(sc->ec_dev,
_at__at_ -818,7 +810,6 _at__at_
 	    }
 	    AcpiOsStall(10);
 	}
-      }
     }
 
     /* Wait for event by polling or GPE (interrupt). */
Received on Wed Sep 26 2007 - 07:26:30 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:18 UTC