From owner-freebsd-acpi@FreeBSD.ORG Sat Sep 8 18:05:45 2007 Return-Path: Delivered-To: acpi@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3DB116A419 for ; Sat, 8 Sep 2007 18:05:45 +0000 (UTC) (envelope-from yousif@alumni.jmu.edu) Received: from coruscant.far-far-away.us (coruscant.far-far-away.us [70.91.196.65]) by mx1.freebsd.org (Postfix) with SMTP id 4C19E13C46B for ; Sat, 8 Sep 2007 18:05:45 +0000 (UTC) (envelope-from yousif@alumni.jmu.edu) Received: (qmail 99465 invoked from network); 8 Sep 2007 13:34:36 -0400 Received: from alderaan.far-far-away.us (HELO ?192.168.0.4?) (192.168.0.4) by coruscant.far-far-away.us with SMTP; 8 Sep 2007 13:34:36 -0400 From: Yousif Hassan To: Nate Lawson In-Reply-To: <46E0777A.8070901@root.org> References: <46E0777A.8070901@root.org> Content-Type: text/plain Date: Sat, 08 Sep 2007 13:39:14 -0400 Message-Id: <1189273154.1805.15.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: acpi@FreeBSD.ORG Subject: Re: PATCH: ecng for 6.x and 7.x X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: yousif@alumni.jmu.edu List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2007 18:05:45 -0000 Since you asked for testers on Compaqs, I tried this out on my Compaq nx6110 under 6.2. W/ this laptop, battery status was always close to correct before, but it does appear that your patch improves things somewhat - I no longer get 95-99% full being reported when the battery is actually at 100% (don't know if that's a coincidence or an intended benefit). Also, the "time remaining" calculations appear to be slightly more accurate, so this is great. This patch does not fix the errors of: acpi0: on motherboard acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR acpi_bus_number: can't get _ADR (these have never given me too much grief) but that probably wasn't the purpose of this patch either. ;) I don't think that it added any new error msgs. Obviously, suspend/resume and hibernate are still woefully broken on this laptop (as is noted in the PRs), so I didn't try those again. I have not tried 7.x (CURRENT) on this laptop either. If suspend/resume gets implemented with the new ACPI code in 7.x I will certainly be motivated to upgrade. On Thu, 2007-09-06 at 14:56 -0700, 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 > _______________________________________________ > freebsd-acpi@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-acpi > To unsubscribe, send any mail to "freebsd-acpi-unsubscribe@freebsd.org"