ACPI: EC: Add wait for irq storm
authorAlexey Starikovskiy <astarikovskiy@suse.de>
Wed, 30 Dec 2009 12:53:10 +0000 (15:53 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 25 Jan 2010 18:49:36 +0000 (10:49 -0800)
commit 54070101f86ca9a6e9ba243c999d144721ec3db7 upstream.

Merge of poll and irq modes accelerated EC transaction, so
that keyboard starts to suffer again. Add msleep(1) into
transaction path for the storm to allow keyboard controller
to do its job.

Reference: http://bugzilla.kernel.org/show_bug.cgi?id=14747

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Cc: François Valenduc <francois.valenduc@tvcablenet.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/acpi/ec.c

index 8aea2f4fe593e83ec245c81050fad0e29df1a461..f1670e0ef9bb7fb7836ee30af5769bb9430f6f50 100644 (file)
@@ -259,7 +259,6 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
                clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
        spin_unlock_irqrestore(&ec->curr_lock, tmp);
        ret = ec_poll(ec);
-       pr_debug(PREFIX "transaction end\n");
        spin_lock_irqsave(&ec->curr_lock, tmp);
        ec->curr = NULL;
        spin_unlock_irqrestore(&ec->curr_lock, tmp);
@@ -316,6 +315,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
        /* check if we received SCI during transaction */
        ec_check_sci_sync(ec, acpi_ec_read_status(ec));
        if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) {
+               msleep(1);
                /* it is safe to enable GPE outside of transaction */
                acpi_enable_gpe(NULL, ec->gpe);
        } else if (t->irq_count > ACPI_EC_STORM_THRESHOLD) {
@@ -323,6 +323,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
                        "transactions will use polling mode\n");
                set_bit(EC_FLAGS_GPE_STORM, &ec->flags);
        }
+       pr_debug(PREFIX "transaction end\n");
 end:
        if (ec->global_lock)
                acpi_release_global_lock(glk);