1f04e8f501
* Always use polled mode. The intr approach did not work for many controllers and required the hw.acpi.ec.event_driven workaround. * 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. Wait 50 ms max instead of 10. Most ECs respond in < 5 us (50 us when heavily loaded). However, some time out occasionally even with a 10 ms timeout. For delays past 1 ms, use msleep instead of DELAY to give SCI interrupts a chance to occur. * Add EcCommand to send a command and wait for the appropriate event. * The hw.acpi.ec.event_driven tunable is no longer applicable and has been removed. Ideas from: Linux