Skip to content

Commit

Permalink
iommu/amd: Check for the right TLP prefix bit
Browse files Browse the repository at this point in the history
Unfortunatly the PRI spec changed and moved the
TLP-prefix-required bit to a different location. This patch
makes the necessary change in the AMD IOMMU driver.
Regressions are not expected because all hardware
implementing the PRI capability sets this bit to zero
anyway.

Cc: stable@vger.kernel.org # v3.3
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
  • Loading branch information
Joerg Roedel committed Apr 12, 2012
1 parent 0034102 commit a3b9312
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/iommu/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2035,20 +2035,20 @@ static int pdev_iommuv2_enable(struct pci_dev *pdev)
}

/* FIXME: Move this to PCI code */
#define PCI_PRI_TLP_OFF (1 << 2)
#define PCI_PRI_TLP_OFF (1 << 15)

bool pci_pri_tlp_required(struct pci_dev *pdev)
{
u16 control;
u16 status;
int pos;

pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
if (!pos)
return false;

pci_read_config_word(pdev, pos + PCI_PRI_CTRL, &control);
pci_read_config_word(pdev, pos + PCI_PRI_STATUS, &status);

return (control & PCI_PRI_TLP_OFF) ? true : false;
return (status & PCI_PRI_TLP_OFF) ? true : false;
}

/*
Expand Down

0 comments on commit a3b9312

Please sign in to comment.