Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 08 Sep 2007 13:39:14 -0400
From:      Yousif Hassan <yousif@alumni.jmu.edu>
To:        Nate Lawson <nate@root.org>
Cc:        acpi@FreeBSD.ORG
Subject:   Re: PATCH: ecng for 6.x and 7.x
Message-ID:  <1189273154.1805.15.camel@localhost>
In-Reply-To: <46E0777A.8070901@root.org>
References:  <46E0777A.8070901@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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: <HP 099C> 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"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1189273154.1805.15.camel>