From owner-svn-src-all@FreeBSD.ORG Sat Oct 4 21:50:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7E5653E; Sat, 4 Oct 2014 21:50:35 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 686EEA5F; Sat, 4 Oct 2014 21:50:35 +0000 (UTC) Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XaTEN-00051r-OW; Sat, 04 Oct 2014 21:34:55 +0400 Message-ID: <54306B2A.2040702@FreeBSD.org> Date: Sun, 05 Oct 2014 01:48:26 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r271207 - head/sys/dev/ahci References: <201409061943.s86JhmK4084402@svn.freebsd.org> In-Reply-To: <201409061943.s86JhmK4084402@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Oct 2014 21:50:35 -0000 On 06.09.2014 23:43, Alexander Motin wrote: > 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 This one causes tons of "Interrupt storm" messages (and inability to boot) for SATA AHCI VirtualBox disk controller. > > 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) > >