From owner-svn-src-all@freebsd.org Tue Sep 8 16:05:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A99FA00B5E; Tue, 8 Sep 2015 16:05:19 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B54C182F; Tue, 8 Sep 2015 16:05:19 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t88G5IET066950; Tue, 8 Sep 2015 16:05:18 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t88G5IU1066949; Tue, 8 Sep 2015 16:05:18 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201509081605.t88G5IU1066949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Tue, 8 Sep 2015 16:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287564 - head/sys/dev/isci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Tue, 08 Sep 2015 16:05:19 -0000 Author: jimharris Date: Tue Sep 8 16:05:18 2015 New Revision: 287564 URL: https://svnweb.freebsd.org/changeset/base/287564 Log: isci: check return value of pci_alloc_msix() Certain VM guest types (VMware, Xen) do not support MSI, so pci_alloc_msix() always fails. isci(4) was not properly detecting the allocation failure, and would try to proceed with MSIx resource initialization rather than reverting to INTx. Reported and tested by: Bradley W. Dutton (brad-fbsd-stable@duttonbros.com) MFC after: 3 days Sponsored by: Intel Modified: head/sys/dev/isci/isci_interrupt.c Modified: head/sys/dev/isci/isci_interrupt.c ============================================================================== --- head/sys/dev/isci/isci_interrupt.c Tue Sep 8 15:59:55 2015 (r287563) +++ head/sys/dev/isci/isci_interrupt.c Tue Sep 8 16:05:18 2015 (r287564) @@ -136,8 +136,8 @@ isci_interrupt_setup(struct isci_softc * pci_msix_count(isci->device) >= max_msix_messages) { isci->num_interrupts = max_msix_messages; - pci_alloc_msix(isci->device, &isci->num_interrupts); - if (isci->num_interrupts == max_msix_messages) + if (pci_alloc_msix(isci->device, &isci->num_interrupts) == 0 && + isci->num_interrupts == max_msix_messages) use_msix = TRUE; }