svn commit: r304639 - projects/powernv/dev/pci
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Mon Aug 22 21:40:53 UTC 2016
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);
More information about the svn-src-projects
mailing list