Revision tags: release/7.1.0_cvs, release/7.1.0, release/6.4.0_cvs, release/6.4.0, release/7.0.0_cvs, release/7.0.0, release/6.3.0_cvs, release/6.3.0 |
|
#
69d3f896 |
| 08-Nov-2007 |
Nate Lawson <njl@FreeBSD.org> |
Whitespace only.
|
#
68fb6c48 |
| 25-Oct-2007 |
Takanori Watanabe <takawata@FreeBSD.org> |
More style nit. Pointed out by: njl.
|
#
1de5ce99 |
| 25-Oct-2007 |
Takanori Watanabe <takawata@FreeBSD.org> |
Fix variable name to be clear what it means.
|
#
0bfeaded |
| 25-Oct-2007 |
Takanori Watanabe <takawata@FreeBSD.org> |
Turn EC into poll mode before device_resume invoked .
|
#
83dcc133 |
| 24-Sep-2007 |
Nate Lawson <njl@FreeBSD.org> |
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
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, shutdown, 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 could be unreliable. There's not much more we can do about this until interrupts are enabled during boot. - In the above case, we also do one final check if the interrupt-driven mode gets a timeout. If the status is complete, it will force the system back into polled mode since interrupt mode doesn't work. For polled mode during boot, if the status appears to be already complete before beginning the check loop, it waits 10 us before actually checking the status, just in case the EC is really slow and hasn't gotten to work on the new request yet. - 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 decrease 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) - Allow KTR module-only builds for ease of testing
Thanks to jkim and Alexey Starikovskiy for helpful discussions and testing.
Approved by: re MFC after: 2 weeks
show more ...
|
#
70fa7bc0 |
| 15-Jun-2007 |
Nate Lawson <njl@FreeBSD.org> |
Convert magic to a uintptr_t. This should get rid of some warnings on gcc4.
|
#
35440dd3 |
| 02-Jun-2007 |
Nate Lawson <njl@FreeBSD.org> |
AcpiAcquireGlobalLock() can sometimes sleep if the mutex is contested. The global lock is a memory region shared with the BIOS and thus has some strange behavior like the fact that the sleep is 1 ms
AcpiAcquireGlobalLock() can sometimes sleep if the mutex is contested. The global lock is a memory region shared with the BIOS and thus has some strange behavior like the fact that the sleep is 1 ms max. We use standard mutexes to synchronize with the SCI so acquiring the global lock after locking the mutex resulted in a witness warning.
To deal with this for now, acquire the global lock before all other locks, similar to Giant. This should fix the witness "sleeping with mutex held" issue on boot that occurred after the last ACPI-CA import. In the future, we hope to move to the new mutex interface in ACPI-CA instead of the pseudo-semaphore version we have now.
Reviewed by: jkim
show more ...
|
#
4e7f640d |
| 01-Apr-2007 |
John Baldwin <jhb@FreeBSD.org> |
Optimize sx locks to use simple atomic operations for the common cases of obtaining and releasing shared and exclusive locks. The algorithms for manipulating the lock cookie are very similar to that
Optimize sx locks to use simple atomic operations for the common cases of obtaining and releasing shared and exclusive locks. The algorithms for manipulating the lock cookie are very similar to that rwlocks. This patch also adds support for exclusive locks using the same algorithm as mutexes.
A new sx_init_flags() function has been added so that optional flags can be specified to alter a given locks behavior. The flags include SX_DUPOK, SX_NOWITNESS, SX_NOPROFILE, and SX_QUITE which are all identical in nature to the similar flags for mutexes.
Adaptive spinning on select locks may be enabled by enabling the ADAPTIVE_SX kernel option. Only locks initialized with the SX_ADAPTIVESPIN flag via sx_init_flags() will adaptively spin.
The common cases for sx_slock(), sx_sunlock(), sx_xlock(), and sx_xunlock() are now performed inline in non-debug kernels. As a result, <sys/sx.h> now requires <sys/lock.h> to be included prior to <sys/sx.h>.
The new kernel option SX_NOINLINE can be used to disable the aforementioned inlining in non-debug kernels.
The size of struct sx has changed, so the kernel ABI is probably greatly disturbed.
MFC after: 1 month Submitted by: attilio Tested by: kris, pjd
show more ...
|
#
2be4e471 |
| 22-Mar-2007 |
Jung-uk Kim <jkim@FreeBSD.org> |
Catch up with ACPI-CA 20070320 import.
|
#
6e141df2 |
| 20-Mar-2007 |
Nate Lawson <njl@FreeBSD.org> |
If we got an OBE/IBF event, we failed to re-enable the GPE. This would cause the EC to stop handling future events because the GPE stayed masked. Set a flag when queueing a GPE handler since it will
If we got an OBE/IBF event, we failed to re-enable the GPE. This would cause the EC to stop handling future events because the GPE stayed masked. Set a flag when queueing a GPE handler since it will ultimately re-enable the GPE. In all other cases, re-enable it ourselves. I reworked the patch from the submitter.
Submitted by: Rong-en Fan <grafan@gmail.com>
show more ...
|
#
675e5627 |
| 18-Mar-2007 |
Nate Lawson <njl@FreeBSD.org> |
Disable burst mode by default. Testing has shown that while it works on most systems, it causes the EC not to respond for some Acer and Compaq/HP laptops. This is the default value for Linux also.
Disable burst mode by default. Testing has shown that while it works on most systems, it causes the EC not to respond for some Acer and Compaq/HP laptops. This is the default value for Linux also. For systems that need it, burst mode can be enabled via the tunable/sysctl: debug.acpi.ec.burst="1"
show more ...
|
#
ef2374f7 |
| 27-Feb-2007 |
Nate Lawson <njl@FreeBSD.org> |
Rework EC I/O approach. Implement burst mode, including proper handling of case where it asynchronously exits burst mode on its own. Handle different values of hz in sleep loop. Provide more debug
Rework EC I/O approach. Implement burst mode, including proper handling of case where it asynchronously exits burst mode on its own. Handle different values of hz in sleep loop. Provide more debugging options to tune EC behavior. These tunables/sysctls may be temporary and are not for user access if the EC is working properly. Burst mode is now on by default for testing and the poll interval has been increased from 100 to 500 us and total timeout from 100 to 500 ms.
Hopefully this should be the first step of addressing reports of timeout errors during battery or thermal access, especially on HP/Compaq laptops. It is reasonably stable and should not cause a loss of functionality or performance on systems that were previously working. Testing shows an increase of responsiveness by ~75% on one system.
PR: kern/98171
show more ...
|
Revision tags: release/6.2.0_cvs, release/6.2.0, release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0 |
|
#
31bef809 |
| 06-Dec-2005 |
Nate Lawson <njl@FreeBSD.org> |
Revert two changes I was testing regarding polling delay.
|
#
c4a9fa45 |
| 06-Dec-2005 |
Nate Lawson <njl@FreeBSD.org> |
Add KTR support and move some performance debugging variables in the EC to KTR. We're reusing the KTR_DEV level.
|
Revision tags: release/6.0.0_cvs, release/6.0.0 |
|
#
2a191126 |
| 11-Sep-2005 |
David E. O'Brien <obrien@FreeBSD.org> |
Canonize the include of acpi.h.
|
#
a6761eb3 |
| 13-May-2005 |
Nate Lawson <njl@FreeBSD.org> |
If there is a problem during probe, be sure to free up any resources allocated for it. The normal exit case handles this correctly so we use it as well for errors.
Submitted by: pjd Obtained from:
If there is a problem during probe, be sure to free up any resources allocated for it. The normal exit case handles this correctly so we use it as well for errors.
Submitted by: pjd Obtained from: Coverity Prevent
show more ...
|
Revision tags: release/5.4.0_cvs, release/5.4.0 |
|
#
b3919c8d |
| 14-Apr-2005 |
Mark Santcroos <marks@FreeBSD.org> |
Use AcpiUtStrupr() instead of strupr() as the latter will disappear in future versions of acpica.
MFC after: 2 weeks
|
#
e33bea8d |
| 20-Mar-2005 |
Nate Lawson <njl@FreeBSD.org> |
Add the acpi_ec_read and write methods. This allows an external driver (like an EC/SMbus controller) to access the EC address space. Access is synchronized by the EcLock/Unlock routines in EcSpaceH
Add the acpi_ec_read and write methods. This allows an external driver (like an EC/SMbus controller) to access the EC address space. Access is synchronized by the EcLock/Unlock routines in EcSpaceHandler().
Tested by: Hans Petter Selasky
show more ...
|
#
1395b555 |
| 22-Feb-2005 |
Nate Lawson <njl@FreeBSD.org> |
Since the GPE handler is directly called by ACPI-CA and it may have unknown locks held, specify the ACPI_ISR flag to keep it from acquiring any more mutexes (which could potentially sleep.) This sho
Since the GPE handler is directly called by ACPI-CA and it may have unknown locks held, specify the ACPI_ISR flag to keep it from acquiring any more mutexes (which could potentially sleep.) This should fix "could sleep" warning messages on the following path:
msleep() AcpiOsWaitSemaphore() AcpiUtAcquireMutex() AcpiDisableGpe() EcGpeHandler() AcpiEvGpeDispatch() AcpiEvGpeDetect() AcpiEvGpeDetect() AcpiEvSciXruptHandler()
show more ...
|
Revision tags: release/4.11.0_cvs, release/4.11.0 |
|
#
098ca2bd |
| 06-Jan-2005 |
Warner Losh <imp@FreeBSD.org> |
Start each of the license/copyright comments with /*-, minor shuffle of lines
|
#
d05fa56b |
| 27-Dec-2004 |
Nate Lawson <njl@FreeBSD.org> |
Remove trailing whitespace.
|
Revision tags: release/5.3.0_cvs, release/5.3.0 |
|
#
f4b7de15 |
| 13-Aug-2004 |
Nate Lawson <njl@FreeBSD.org> |
MPSAFE locking
* Use the common serialization macros instead of rolling our own. * Increase the coverage of the lock in EcSpaceHandler() to cover the entire loop to avoid dropping the lock when re
MPSAFE locking
* Use the common serialization macros instead of rolling our own. * Increase the coverage of the lock in EcSpaceHandler() to cover the entire loop to avoid dropping the lock when reading more than one byte.
show more ...
|
#
5a66986d |
| 02-Jul-2004 |
Nate Lawson <njl@FreeBSD.org> |
Remove duplicate FreeBSD id.
|
#
99eb9c8b |
| 02-Jul-2004 |
Nate Lawson <njl@FreeBSD.org> |
Get rid of the strict aliasing error by retrieving the ECDT via a table header pointer and then casting it to the ecdt pointer. This fixes the -O2 build. I'm unsure what changed recently to reveal
Get rid of the strict aliasing error by retrieving the ECDT via a table header pointer and then casting it to the ecdt pointer. This fixes the -O2 build. I'm unsure what changed recently to reveal this error since this code has been unchanged for months.
show more ...
|
#
b0eefa38 |
| 01-Jul-2004 |
Nate Lawson <njl@FreeBSD.org> |
Rework the code that waits for a response from the EC. Use an sx lock instead of a mutex so we do not unblock it in msleep(). If we do this, another event could occur, resetting the status register
Rework the code that waits for a response from the EC. Use an sx lock instead of a mutex so we do not unblock it in msleep(). If we do this, another event could occur, resetting the status register since reads reset it. While I'm here, remove the backoff approach. Instead, sleep in 10 ms chunks for up to the configured timeout using either DELAY (if we aren't booted yet) or tsleep.
Help from: dillon Tested by: Andrew Thompson andy AT fud.org.nz
show more ...
|