PATCH - updated EC driver

Nate Lawson nate at
Tue Jul 8 22:08:55 PDT 2003

If you tested my previous acpi_ec.c patch (or even if you didn't), please
test the following one:

I will be committing this is in a few days if any problems that arise are
successfully addressed.  It fixes numerous races and the broken tsleep
approach in the current version.  Note that it does NOT have the
experimental burst mode support I had included in the last patch.  It
appears that burst mode is more difficult to handle than I have time for
and the actual time spent in DELAY is low (~1-5 us per transaction). There
is no special dmesg output to report with this, just make sure it doesn't
break things (or fixes things for you).



Rewrite much of the embedded controller driver.
* Always use polled mode.  The msleep approach did not work for many
  controllers and required a workaround on others.
* Only use an edge (not level) triggered GPE handler
* Add sc->ec_mtx for locking operations to a single EC.  There were
  many race conditions earlier between an SCI event and EcRead/Write.
* Use 1 ms as the global lock timeout
* Only acquire global lock if _GLK != 0
* Update EcWaitEvent to use an incremental backoff delay in its
  poll loop.  Only wait 1 ms max instead of 10.  Most ECs respond
  in < 5 us (50 us when heavily loaded).  10 ms had us holding the
  lock too long on a bad implementation.
* Add EcCommand to send a command and wait for the appropriate event.
* The tunable is no longer applicable and
  has been removed.

Ideas from:     Linux

More information about the freebsd-current mailing list