From patchwork Tue Oct 30 01:52:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feng Tang X-Patchwork-Id: 1660491 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 7590EDFABE for ; Mon, 29 Oct 2012 01:54:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756268Ab2J2ByB (ORCPT ); Sun, 28 Oct 2012 21:54:01 -0400 Received: from mga09.intel.com ([134.134.136.24]:32579 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756205Ab2J2ByA (ORCPT ); Sun, 28 Oct 2012 21:54:00 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 28 Oct 2012 18:53:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,668,1344236400"; d="scan'208";a="233853430" Received: from feng-snb.sh.intel.com ([10.239.67.49]) by orsmga002.jf.intel.com with ESMTP; 28 Oct 2012 18:53:59 -0700 From: Feng Tang To: Len Brown , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org Cc: Feng Tang Subject: [PATCH 4/4] ACPI: EC: Don't count a SCI interrupt as a false one Date: Tue, 30 Oct 2012 09:52:41 +0800 Message-Id: <1351561961-23821-4-git-send-email-feng.tang@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351561961-23821-1-git-send-email-feng.tang@intel.com> References: <1351561961-23821-1-git-send-email-feng.tang@intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 --- drivers/acpi/ec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index f272880..6bdea02 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); }