From owner-svn-src-projects@freebsd.org Mon Aug 22 21:40:53 2016 Return-Path: Delivered-To: svn-src-projects@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 358A6BC2E6D for ; Mon, 22 Aug 2016 21:40:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 0268E1975; Mon, 22 Aug 2016 21:40:52 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MLeqkD028199; Mon, 22 Aug 2016 21:40:52 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MLeqbl028198; Mon, 22 Aug 2016 21:40:52 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201608222140.u7MLeqbl028198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 22 Aug 2016 21:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r304639 - projects/powernv/dev/pci X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 21:40:53 -0000 Author: nwhitehorn Date: Mon Aug 22 21:40:51 2016 New Revision: 304639 URL: https://svnweb.freebsd.org/changeset/base/304639 Log: Linux can leave MSIs enabled. Turn them off at boot. Modified: projects/powernv/dev/pci/pci.c Modified: projects/powernv/dev/pci/pci.c ============================================================================== --- projects/powernv/dev/pci/pci.c Mon Aug 22 21:30:59 2016 (r304638) +++ projects/powernv/dev/pci/pci.c Mon Aug 22 21:40:51 2016 (r304639) @@ -864,12 +864,24 @@ pci_read_cap(device_t pcib, pcicfgregs * case PCIY_MSI: /* PCI MSI */ cfg->msi.msi_location = ptr; cfg->msi.msi_ctrl = REG(ptr + PCIR_MSI_CTRL, 2); + if (cfg->msi.msi_ctrl & PCIM_MSICTRL_MSI_ENABLE) { + /* Make sure MSIs are off at boot */ + cfg->msi.msi_ctrl &= ~PCIM_MSICTRL_MSI_ENABLE; + WREG(ptr + PCIR_MSI_CTRL, cfg->msi.msi_ctrl, 2); + } cfg->msi.msi_msgnum = 1 << ((cfg->msi.msi_ctrl & PCIM_MSICTRL_MMC_MASK)>>1); break; case PCIY_MSIX: /* PCI MSI-X */ cfg->msix.msix_location = ptr; cfg->msix.msix_ctrl = REG(ptr + PCIR_MSIX_CTRL, 2); + if (cfg->msix.msix_ctrl & PCIM_MSIXCTRL_MSIX_ENABLE) { + /* Make sure MSIs are off at boot */ + cfg->msix.msix_ctrl &= + ~PCIM_MSIXCTRL_MSIX_ENABLE; + WREG(ptr + PCIR_MSIX_CTRL, cfg->msix.msix_ctrl, + 2); + } cfg->msix.msix_msgnum = (cfg->msix.msix_ctrl & PCIM_MSIXCTRL_TABLE_SIZE) + 1; val = REG(ptr + PCIR_MSIX_TABLE, 4);