]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ACPI / EC: Don't count a SCI interrupt as a false one
authorFeng Tang <feng.tang@intel.com>
Mon, 22 Oct 2012 23:30:12 +0000 (01:30 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 22 Oct 2012 23:30:12 +0000 (01:30 +0200)
Currently when advance_transaction() is called in EC interrupt handler,
if there is nothing driver can do with the interrupt, it will be taken
as a false one.

But this is not always true, as there may be a SCI EC interrupt fired
during normal read/write operation, which should not be counted as a
false one. This patch fixes the problem.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/ec.c

index 8f8b644bba8d1ca833744965abba9075b2cd38db..354007d490d1268a6e97cee38ba48fd36c1922f7 100644 (file)
@@ -198,9 +198,13 @@ static void advance_transaction(struct acpi_ec *ec, u8 status)
                t->done = true;
        goto unlock;
 err:
-       /* false interrupt, state didn't change */
-       if (in_interrupt())
+       /*
+        * If SCI bit is set, then don't think it's a false IRQ
+        * otherwise will take a not handled IRQ as a false one.
+        */
+       if (in_interrupt() && !(status & ACPI_EC_FLAG_SCI))
                ++t->irq_count;
+
 unlock:
        spin_unlock_irqrestore(&ec->lock, flags);
 }