Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Dec 2009 21:27:57 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r200814 - head/sys/dev/ahci
Message-ID:  <200912212127.nBLLRvSW041339@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Dec 21 21:27:56 2009
New Revision: 200814
URL: http://svn.freebsd.org/changeset/base/200814

Log:
  Clear all ports interrupt status bits in single write. Clearing one by one
  causes additional MSIs messages sent if several ports asked for attention
  same time. Time window before clearing is not important, as these interrupts
  are level triggered by interrupt source.

Modified:
  head/sys/dev/ahci/ahci.c

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Mon Dec 21 21:17:59 2009	(r200813)
+++ head/sys/dev/ahci/ahci.c	Mon Dec 21 21:27:56 2009	(r200814)
@@ -596,20 +596,18 @@ ahci_intr(void *data)
 		unit = irq->r_irq_rid - 1;
 		is = ATA_INL(ctlr->r_mem, AHCI_IS);
 	}
+	/* Some controllers have edge triggered IS. */
+	if (ctlr->quirks & AHCI_Q_EDGEIS)
+		ATA_OUTL(ctlr->r_mem, AHCI_IS, is);
 	for (; unit < ctlr->channels; unit++) {
 		if ((is & (1 << unit)) != 0 &&
 		    (arg = ctlr->interrupt[unit].argument)) {
-			if (ctlr->quirks & AHCI_Q_EDGEIS) {
-				/* Some controller have edge triggered IS. */
-				ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit);
 				ctlr->interrupt[unit].function(arg);
-			} else {
-				/* but AHCI declares level triggered IS. */
-				ctlr->interrupt[unit].function(arg);
-				ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit);
-			}
 		}
 	}
+	/* AHCI declares level triggered IS. */
+	if (!(ctlr->quirks & AHCI_Q_EDGEIS))
+		ATA_OUTL(ctlr->r_mem, AHCI_IS, is);
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912212127.nBLLRvSW041339>