linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: Len Brown <lenb@kernel.org>, Len Brown <len.brown@intel.com>,
	linux-acpi@vger.kernel.org
Cc: Alexey Starikovskiy <astarikovskiy@suse.de>,
	Thomas Renninger <trenn@suse.de>,
	Bob Moore <robert.moore@intel.com>,
	Feng Tang <feng.tang@intel.com>
Subject: [RFC PATCH 5/5] ACPI: EC: Don't count a SCI interrupt as a false one
Date: Tue, 11 Sep 2012 21:10:22 +0800	[thread overview]
Message-ID: <1347369022-10176-5-git-send-email-feng.tang@intel.com> (raw)
In-Reply-To: <1347369022-10176-1-git-send-email-feng.tang@intel.com>

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>
---
 drivers/acpi/ec.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 5fc6a55..2afba5b 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -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);
 }
-- 
1.7.1


      parent reply	other threads:[~2012-09-11 13:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11 13:10 [PATCH 1/5] ACPI: EC: Make the GPE storm threshold a module parameter Feng Tang
2012-09-11 13:10 ` [PATCH 2/5] ACPI: EC: Cleanup the member name for spinlock/mutex in struct acpi_ec Feng Tang
2012-09-11 13:10 ` [PATCH 3/5] ACPI: EC: Add more debug info and trivial code cleanup Feng Tang
2012-09-11 13:10 ` [PATCH 4/5] ACPI: Remove the useless check in osl.c Feng Tang
2012-09-11 13:10 ` Feng Tang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1347369022-10176-5-git-send-email-feng.tang@intel.com \
    --to=feng.tang@intel.com \
    --cc=astarikovskiy@suse.de \
    --cc=len.brown@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=robert.moore@intel.com \
    --cc=trenn@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).