]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/pci/probe.c
Merge tag 'pci-v4.11-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
[mirror_ubuntu-bionic-kernel.git] / drivers / pci / probe.c
index 204960e70333f1dbe49d03ffffac7393f06a37c4..dfc9a27941418976c0fadee7e6628531fbb47613 100644 (file)
@@ -1556,8 +1556,16 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp)
 
 static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp)
 {
-       if (hpp)
-               dev_warn(&dev->dev, "PCI-X settings not supported\n");
+       int pos;
+
+       if (!hpp)
+               return;
+
+       pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
+       if (!pos)
+               return;
+
+       dev_warn(&dev->dev, "PCI-X settings not supported\n");
 }
 
 static bool pcie_root_rcb_set(struct pci_dev *dev)
@@ -1583,6 +1591,9 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
        if (!hpp)
                return;
 
+       if (!pci_is_pcie(dev))
+               return;
+
        if (hpp->revision > 1) {
                dev_warn(&dev->dev, "PCIe settings rev %d not supported\n",
                         hpp->revision);
@@ -1652,12 +1663,30 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
         */
 }
 
+static void pci_configure_extended_tags(struct pci_dev *dev)
+{
+       u32 dev_cap;
+       int ret;
+
+       if (!pci_is_pcie(dev))
+               return;
+
+       ret = pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &dev_cap);
+       if (ret)
+               return;
+
+       if (dev_cap & PCI_EXP_DEVCAP_EXT_TAG)
+               pcie_capability_set_word(dev, PCI_EXP_DEVCTL,
+                                        PCI_EXP_DEVCTL_EXT_TAG);
+}
+
 static void pci_configure_device(struct pci_dev *dev)
 {
        struct hotplug_params hpp;
        int ret;
 
        pci_configure_mps(dev);
+       pci_configure_extended_tags(dev);
 
        memset(&hpp, 0, sizeof(hpp));
        ret = pci_get_hp_params(dev, &hpp);