svn commit: r271207 - head/sys/dev/ahci

Alexander Motin mav at FreeBSD.org
Sat Sep 6 19:43:49 UTC 2014


Author: mav
Date: Sat Sep  6 19:43:48 2014
New Revision: 271207
URL: http://svnweb.freebsd.org/changeset/base/271207

Log:
  Save one register read (AHCI_IS) for AHCI controllers with only one port.
  
  For controllers with only one port (like PCIe or M.2 SSDs) interrupt can
  come from only one source, and skipping read saves few percents of CPU time.
  
  MFC after:	1 month
  H/W donated by:	I/O Switch

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

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Sat Sep  6 19:39:12 2014	(r271206)
+++ head/sys/dev/ahci/ahci.c	Sat Sep  6 19:43:48 2014	(r271207)
@@ -359,7 +359,9 @@ ahci_setup_interrupt(device_t dev)
 	for (i = 0; i < ctlr->numirqs; i++) {
 		ctlr->irqs[i].ctlr = ctlr;
 		ctlr->irqs[i].r_irq_rid = i + (ctlr->msi ? 1 : 0);
-		if (ctlr->numirqs == 1 || i >= ctlr->channels ||
+		if (ctlr->channels == 1 && !ctlr->ccc)
+			ctlr->irqs[i].mode = AHCI_IRQ_MODE_ONE;
+		else if (ctlr->numirqs == 1 || i >= ctlr->channels ||
 		    (ctlr->ccc && i == ctlr->cccv))
 			ctlr->irqs[i].mode = AHCI_IRQ_MODE_ALL;
 		else if (i == ctlr->numirqs - 1)


More information about the svn-src-head mailing list