aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 692671b11667..08a95b369d85 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1905,7 +1905,7 @@ void pci_enable_ari(struct pci_dev *dev)
1905{ 1905{
1906 int pos; 1906 int pos;
1907 u32 cap; 1907 u32 cap;
1908 u16 ctrl; 1908 u16 flags, ctrl;
1909 struct pci_dev *bridge; 1909 struct pci_dev *bridge;
1910 1910
1911 if (!pci_is_pcie(dev) || dev->devfn) 1911 if (!pci_is_pcie(dev) || dev->devfn)
@@ -1923,6 +1923,11 @@ void pci_enable_ari(struct pci_dev *dev)
1923 if (!pos) 1923 if (!pos)
1924 return; 1924 return;
1925 1925
1926 /* ARI is a PCIe v2 feature */
1927 pci_read_config_word(bridge, pos + PCI_EXP_FLAGS, &flags);
1928 if ((flags & PCI_EXP_FLAGS_VERS) < 2)
1929 return;
1930
1926 pci_read_config_dword(bridge, pos + PCI_EXP_DEVCAP2, &cap); 1931 pci_read_config_dword(bridge, pos + PCI_EXP_DEVCAP2, &cap);
1927 if (!(cap & PCI_EXP_DEVCAP2_ARI)) 1932 if (!(cap & PCI_EXP_DEVCAP2_ARI))
1928 return; 1933 return;
@@ -3186,7 +3191,7 @@ EXPORT_SYMBOL(pcie_get_readrq);
3186 * @rq: maximum memory read count in bytes 3191 * @rq: maximum memory read count in bytes
3187 * valid values are 128, 256, 512, 1024, 2048, 4096 3192 * valid values are 128, 256, 512, 1024, 2048, 4096
3188 * 3193 *
3189 * If possible sets maximum read byte count 3194 * If possible sets maximum memory read request in bytes
3190 */ 3195 */
3191int pcie_set_readrq(struct pci_dev *dev, int rq) 3196int pcie_set_readrq(struct pci_dev *dev, int rq)
3192{ 3197{
@@ -3209,7 +3214,7 @@ int pcie_set_readrq(struct pci_dev *dev, int rq)
3209 if ((ctl & PCI_EXP_DEVCTL_READRQ) != v) { 3214 if ((ctl & PCI_EXP_DEVCTL_READRQ) != v) {
3210 ctl &= ~PCI_EXP_DEVCTL_READRQ; 3215 ctl &= ~PCI_EXP_DEVCTL_READRQ;
3211 ctl |= v; 3216 ctl |= v;
3212 err = pci_write_config_dword(dev, cap + PCI_EXP_DEVCTL, ctl); 3217 err = pci_write_config_word(dev, cap + PCI_EXP_DEVCTL, ctl);
3213 } 3218 }
3214 3219
3215out: 3220out: