From patchwork Sun May 3 15:33:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Tripathi X-Patchwork-Id: 6321041 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1F6D6BEEE1 for ; Sun, 3 May 2015 15:34:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 52AFA203AF for ; Sun, 3 May 2015 15:34:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6A338203A4 for ; Sun, 3 May 2015 15:34:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751107AbbECPek (ORCPT ); Sun, 3 May 2015 11:34:40 -0400 Received: from denmail01-v4020.amcc.com ([192.195.68.30]:59858 "EHLO denmail01.amcc.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750780AbbECPei (ORCPT ); Sun, 3 May 2015 11:34:38 -0400 Received: from apm.com (pnqlwv037.amcc.com [10.48.19.137]) by denmail01.amcc.com (8.13.8/8.13.8) with ESMTP id t43FY6Xc031694; Sun, 3 May 2015 09:34:07 -0600 Received: (from stripath@localhost) by apm.com (8.13.8/8.13.8/Submit) id t43FY6gf023509; Sun, 3 May 2015 21:04:06 +0530 From: Suman Tripathi To: olof@lixom.net, tj@kernel.org, arnd@arndb.de Cc: linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mlangsdo@redhat.com, jcm@redhat.com, patches@apm.com, Suman Tripathi Subject: [PATCH v3 1/2] libahci: Add support to handle HOST_IRQ_STAT as edge trigger latch. Date: Sun, 3 May 2015 21:03:39 +0530 Message-Id: <1430667220-23477-2-git-send-email-stripathi@apm.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1430667220-23477-1-git-send-email-stripathi@apm.com> References: <1430667220-23477-1-git-send-email-stripathi@apm.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds the support to handle HOST_IRQ_STAT as edge trigger latch. Signed-off-by: Suman Tripathi --- drivers/ata/ahci.h | 2 ++ drivers/ata/libahci.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) -- 1.8.2.1 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 71262e0..2df2237 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -238,6 +238,8 @@ enum { AHCI_HFLAG_MULTI_MSI = (1 << 16), /* multiple PCI MSIs */ AHCI_HFLAG_NO_DEVSLP = (1 << 17), /* no device sleep */ AHCI_HFLAG_NO_FBS = (1 << 18), /* no FBS */ + AHCI_HFLAG_EDGE_TRIG_IRQ = (1 << 19), /* HOST_IRQ_STAT behaves as + Edge Triggered */ /* ap->flags bits */ diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 61a9c07..0e7e8b4 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -1879,6 +1879,25 @@ static irqreturn_t ahci_single_irq_intr(int irq, void *dev_instance) */ writel(irq_stat, mmio + HOST_IRQ_STAT); + /* + * HOST_IRQ_STAT behaves as edge trigger latch. When HOST_IRQ_STAT + * detects a egde from PORT_IRQ_STAT, it happens to loose interrupts + * when interrupts are triggered from both ports. So handling of + * the residual interrupt is required. + */ + if (hpriv->flags & AHCI_HFLAG_EDGE_TRIG_IRQ) { + for (i = 0; i < host->n_ports; i++) { + struct ata_port *ap; + + ap = host->ports[i]; + if (ap) { + ahci_port_intr(ap); + VPRINTK("Residual irq from port %u\n", i); + } + handled = 1; + } + } + spin_unlock(&host->lock); VPRINTK("EXIT\n");