devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Suman Tripathi <stripathi-qTEPVZfXA3Y@public.gmane.org>
To: olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org,
	tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	arnd-r2nGTMty4D4@public.gmane.org
Cc: linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-ide-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	mlangsdo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	jcm-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	patches-qTEPVZfXA3Y@public.gmane.org,
	Suman Tripathi <stripathi-qTEPVZfXA3Y@public.gmane.org>
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	[thread overview]
Message-ID: <1430667220-23477-2-git-send-email-stripathi@apm.com> (raw)
In-Reply-To: <1430667220-23477-1-git-send-email-stripathi-qTEPVZfXA3Y@public.gmane.org>

This patch adds the support to handle HOST_IRQ_STAT as edge trigger
latch.

Signed-off-by: Suman Tripathi <stripathi-qTEPVZfXA3Y@public.gmane.org>
---
 drivers/ata/ahci.h    |  2 ++
 drivers/ata/libahci.c | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)

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");
--
1.8.2.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-05-03 15:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-03 15:33 [PATCH v3 0/2] ata: ahci_xgene: Add support for 2nd HW version of APM X-Gene SoC AHCI SATA Host controller driver Suman Tripathi
     [not found] ` <1430667220-23477-1-git-send-email-stripathi-qTEPVZfXA3Y@public.gmane.org>
2015-05-03 15:33   ` Suman Tripathi [this message]
2015-05-04 13:08     ` [PATCH v3 1/2] libahci: Add support to handle HOST_IRQ_STAT as edge trigger latch Sergei Shtylyov
2015-05-04 15:47     ` Tejun Heo
2015-05-04 16:43       ` Suman Tripathi
2015-05-04 18:26         ` Tejun Heo
2015-05-05  5:55           ` Suman Tripathi
2015-05-05 13:18             ` Tejun Heo
2015-05-03 15:33   ` [PATCH v3 2/2] ata: ahci_xgene: Add AHCI Support for 2nd HW version of APM X-Gene SoC AHCI SATA Host controller Suman Tripathi
2015-05-04  0:26     ` Julian Calaby
2015-05-04  2:51       ` Suman Tripathi
2015-05-04  3:22         ` Julian Calaby
     [not found]           ` <CAGRGNgX8d0vMDzTH2mPnkwgBk7RJGWVReSyMC3nS=G0z0XvdYQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-04  4:33             ` Suman Tripathi

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=1430667220-23477-2-git-send-email-stripathi@apm.com \
    --to=stripathi-qtepvzfxa3y@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jcm-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-ide-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mlangsdo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org \
    --cc=patches-qTEPVZfXA3Y@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /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).