Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Sep 2014 19:43:48 +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: r271207 - head/sys/dev/ahci
Message-ID:  <201409061943.s86JhmK4084402@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



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