cvs commit: src/sys/dev/acpica acpi_ec.c src/sys/modules/acpi/acpi Makefile

Nate Lawson njl at
Mon Sep 24 09:59:07 PDT 2007

njl         2007-09-24 16:59:06 UTC

  FreeBSD src repository

  Modified files:
    sys/dev/acpica       acpi_ec.c 
    sys/modules/acpi/acpi Makefile 
  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"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
  Revision  Changes    Path
  1.76      +190 -305  src/sys/dev/acpica/acpi_ec.c
  1.19      +3 -0      src/sys/modules/acpi/acpi/Makefile

More information about the cvs-src mailing list