Subject: Re: Bogus ACPI battery information in recent current
To: None <current-users@netbsd.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: current-users
Date: 12/14/2007 15:24:52
--x+6KMIRAuhnl3hBn
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Dec 13, 2007 at 02:27:50PM -0700, Sverre Froyen wrote:
> Notice the "last full cap" and the "design cap" values.  There is also a very 
> noticable delay before the output appears.  With my latest good kernel 
> (4.99.40 from 6 Dec),  I get

How long is the delay approximately? I wonder whether this and the other
reports are related to the retry attempt after long timeouts.

Can you try the attached patch as well?

> I've attached the dmesg from 4.99.42, below.  I suspect a pertinent line is:
> 
> acpiec0 at acpi0 (EC, PNP0C09-0): ACPI Embedded Controller (disabled)

That's a red hering, acpiecdt0 replaces acpiec when found. Before it was
playing some interesting tricks.

Joerg

--x+6KMIRAuhnl3hBn
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="acpi_ec.c.diff"

Index: acpi_ec.c
===================================================================
RCS file: /data/repo/netbsd/src/sys/dev/acpi/acpi_ec.c,v
retrieving revision 1.44
diff -u -p -r1.44 acpi_ec.c
--- acpi_ec.c	9 Dec 2007 20:27:52 -0000	1.44
+++ acpi_ec.c	13 Dec 2007 23:08:09 -0000
@@ -537,7 +537,7 @@ retry:
 			delay(1);
 			acpiec_gpe_state_maschine(dv);
 		}
-	} else while (cv_timedwait(&sc->sc_cv, &sc->sc_mtx, hz)) {
+	} else while (cv_timedwait(&sc->sc_cv, &sc->sc_mtx, 5 * hz)) {
 		mutex_exit(&sc->sc_mtx);
 		AcpiClearGpe(sc->sc_gpeh, sc->sc_gpebit, ACPI_NOT_ISR);
 		mutex_enter(&sc->sc_mtx);
@@ -545,7 +545,7 @@ retry:
 			goto retry;
 		mutex_exit(&sc->sc_mtx);
 		acpiec_unlock(dv);
-		aprint_error_dev(dv, "command takes over 5sec...\n");
+		aprint_error_dev(dv, "command takes over 25 sec...\n");
 		return AE_ERROR;
 	}
 
@@ -583,7 +583,7 @@ retry:
 			delay(1);
 			acpiec_gpe_state_maschine(dv);
 		}
-	} else while (cv_timedwait(&sc->sc_cv, &sc->sc_mtx, hz)) {
+	} else while (cv_timedwait(&sc->sc_cv, &sc->sc_mtx, 5 * hz)) {
 		mutex_exit(&sc->sc_mtx);
 		AcpiClearGpe(sc->sc_gpeh, sc->sc_gpebit, ACPI_NOT_ISR);
 		mutex_enter(&sc->sc_mtx);
@@ -591,7 +591,7 @@ retry:
 			goto retry;
 		mutex_exit(&sc->sc_mtx);
 		acpiec_unlock(dv);
-		aprint_error_dev(dv, "command takes over 5sec...\n");
+		aprint_error_dev(dv, "command takes over 25 sec...\n");
 		return AE_ERROR;
 	}
 

--x+6KMIRAuhnl3hBn--