]> Pileus Git - ~andy/linux/commitdiff
ACPI: EC: Restore udelay in poll mode
authorAlexey Starikovskiy <astarikovskiy@suse.de>
Fri, 21 Mar 2008 14:06:57 +0000 (17:06 +0300)
committerLen Brown <len.brown@intel.com>
Tue, 25 Mar 2008 00:47:35 +0000 (20:47 -0400)
This fixes keyboard event handling on some systems.

Note that this delay was thought unnecessary, and removed
from linux-2.6.20 with 50c1e1138cb94f6aca0f8555777edbcefe0324e2
'ACPI: ec: Drop udelay() from poll mode. Loop by reading status field instead.'

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/ec.c

index 7222a18a03198d0bc70121d1246dc27af1d0629e..828c75292cf69f7bbfe12f1f333c2351cdc3c415 100644 (file)
@@ -73,6 +73,7 @@ enum ec_event {
 
 #define ACPI_EC_DELAY          500     /* Wait 500ms max. during EC ops */
 #define ACPI_EC_UDELAY_GLK     1000    /* Wait 1ms max. to get global lock */
+#define ACPI_EC_UDELAY         100     /* Wait 100us before polling EC again */
 
 enum {
        EC_FLAGS_WAIT_GPE = 0,          /* Don't check status until GPE arrives */
@@ -227,6 +228,7 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
                while (time_before(jiffies, delay)) {
                        if (acpi_ec_check_status(ec, event))
                                goto end;
+                       udelay(ACPI_EC_UDELAY);
                }
        }
        pr_err(PREFIX "acpi_ec_wait timeout,"