diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/intel-iommu.c | 14 | ||||
-rw-r--r-- | drivers/pci/pci.c | 1 | ||||
-rw-r--r-- | drivers/pci/pcie/pme/pcie_pme.c | 19 | ||||
-rw-r--r-- | drivers/pci/setup-res.c | 32 |
4 files changed, 57 insertions, 9 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 796828fce34c..c9171be74564 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -340,7 +340,7 @@ int dmar_disabled = 0; | |||
340 | int dmar_disabled = 1; | 340 | int dmar_disabled = 1; |
341 | #endif /*CONFIG_DMAR_DEFAULT_ON*/ | 341 | #endif /*CONFIG_DMAR_DEFAULT_ON*/ |
342 | 342 | ||
343 | static int __initdata dmar_map_gfx = 1; | 343 | static int dmar_map_gfx = 1; |
344 | static int dmar_forcedac; | 344 | static int dmar_forcedac; |
345 | static int intel_iommu_strict; | 345 | static int intel_iommu_strict; |
346 | 346 | ||
@@ -1874,14 +1874,15 @@ static struct dmar_domain *get_domain_for_dev(struct pci_dev *pdev, int gaw) | |||
1874 | } | 1874 | } |
1875 | } | 1875 | } |
1876 | if (found) { | 1876 | if (found) { |
1877 | spin_unlock_irqrestore(&device_domain_lock, flags); | ||
1877 | free_devinfo_mem(info); | 1878 | free_devinfo_mem(info); |
1878 | domain_exit(domain); | 1879 | domain_exit(domain); |
1879 | domain = found; | 1880 | domain = found; |
1880 | } else { | 1881 | } else { |
1881 | list_add(&info->link, &domain->devices); | 1882 | list_add(&info->link, &domain->devices); |
1882 | list_add(&info->global, &device_domain_list); | 1883 | list_add(&info->global, &device_domain_list); |
1884 | spin_unlock_irqrestore(&device_domain_lock, flags); | ||
1883 | } | 1885 | } |
1884 | spin_unlock_irqrestore(&device_domain_lock, flags); | ||
1885 | } | 1886 | } |
1886 | 1887 | ||
1887 | found_domain: | 1888 | found_domain: |
@@ -3603,7 +3604,8 @@ static int intel_iommu_attach_device(struct iommu_domain *domain, | |||
3603 | pte = dmar_domain->pgd; | 3604 | pte = dmar_domain->pgd; |
3604 | if (dma_pte_present(pte)) { | 3605 | if (dma_pte_present(pte)) { |
3605 | free_pgtable_page(dmar_domain->pgd); | 3606 | free_pgtable_page(dmar_domain->pgd); |
3606 | dmar_domain->pgd = (struct dma_pte *)dma_pte_addr(pte); | 3607 | dmar_domain->pgd = (struct dma_pte *) |
3608 | phys_to_virt(dma_pte_addr(pte)); | ||
3607 | } | 3609 | } |
3608 | dmar_domain->agaw--; | 3610 | dmar_domain->agaw--; |
3609 | } | 3611 | } |
@@ -3719,6 +3721,12 @@ static void __devinit quirk_iommu_rwbf(struct pci_dev *dev) | |||
3719 | */ | 3721 | */ |
3720 | printk(KERN_INFO "DMAR: Forcing write-buffer flush capability\n"); | 3722 | printk(KERN_INFO "DMAR: Forcing write-buffer flush capability\n"); |
3721 | rwbf_quirk = 1; | 3723 | rwbf_quirk = 1; |
3724 | |||
3725 | /* https://bugzilla.redhat.com/show_bug.cgi?id=538163 */ | ||
3726 | if (dev->revision == 0x07) { | ||
3727 | printk(KERN_INFO "DMAR: Disabling IOMMU for graphics on this chipset\n"); | ||
3728 | dmar_map_gfx = 0; | ||
3729 | } | ||
3722 | } | 3730 | } |
3723 | 3731 | ||
3724 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf); | 3732 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf); |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 60f30e7f1c8c..740fb4ea9669 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -2292,6 +2292,7 @@ void pci_msi_off(struct pci_dev *dev) | |||
2292 | pci_write_config_word(dev, pos + PCI_MSIX_FLAGS, control); | 2292 | pci_write_config_word(dev, pos + PCI_MSIX_FLAGS, control); |
2293 | } | 2293 | } |
2294 | } | 2294 | } |
2295 | EXPORT_SYMBOL_GPL(pci_msi_off); | ||
2295 | 2296 | ||
2296 | #ifndef HAVE_ARCH_PCI_SET_DMA_MAX_SEGMENT_SIZE | 2297 | #ifndef HAVE_ARCH_PCI_SET_DMA_MAX_SEGMENT_SIZE |
2297 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size) | 2298 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size) |
diff --git a/drivers/pci/pcie/pme/pcie_pme.c b/drivers/pci/pcie/pme/pcie_pme.c index aac285a16b62..d672a0a63816 100644 --- a/drivers/pci/pcie/pme/pcie_pme.c +++ b/drivers/pci/pcie/pme/pcie_pme.c | |||
@@ -34,7 +34,7 @@ | |||
34 | * being registered. Consequently, the interrupt-based PCIe PME signaling will | 34 | * being registered. Consequently, the interrupt-based PCIe PME signaling will |
35 | * not be used by any PCIe root ports in that case. | 35 | * not be used by any PCIe root ports in that case. |
36 | */ | 36 | */ |
37 | static bool pcie_pme_disabled; | 37 | static bool pcie_pme_disabled = true; |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * The PCI Express Base Specification 2.0, Section 6.1.8, states the following: | 40 | * The PCI Express Base Specification 2.0, Section 6.1.8, states the following: |
@@ -64,12 +64,19 @@ bool pcie_pme_msi_disabled; | |||
64 | 64 | ||
65 | static int __init pcie_pme_setup(char *str) | 65 | static int __init pcie_pme_setup(char *str) |
66 | { | 66 | { |
67 | if (!strcmp(str, "off")) | 67 | if (!strncmp(str, "auto", 4)) |
68 | pcie_pme_disabled = true; | 68 | pcie_pme_disabled = false; |
69 | else if (!strcmp(str, "force")) | 69 | else if (!strncmp(str, "force", 5)) |
70 | pcie_pme_force_enable = true; | 70 | pcie_pme_force_enable = true; |
71 | else if (!strcmp(str, "nomsi")) | 71 | |
72 | pcie_pme_msi_disabled = true; | 72 | str = strchr(str, ','); |
73 | if (str) { | ||
74 | str++; | ||
75 | str += strspn(str, " \t"); | ||
76 | if (*str && !strcmp(str, "nomsi")) | ||
77 | pcie_pme_msi_disabled = true; | ||
78 | } | ||
79 | |||
73 | return 1; | 80 | return 1; |
74 | } | 81 | } |
75 | __setup("pcie_pme=", pcie_pme_setup); | 82 | __setup("pcie_pme=", pcie_pme_setup); |
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 92379e2d37e7..2aaa13150de3 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -156,6 +156,38 @@ static int __pci_assign_resource(struct pci_bus *bus, struct pci_dev *dev, | |||
156 | pcibios_align_resource, dev); | 156 | pcibios_align_resource, dev); |
157 | } | 157 | } |
158 | 158 | ||
159 | if (ret < 0 && dev->fw_addr[resno]) { | ||
160 | struct resource *root, *conflict; | ||
161 | resource_size_t start, end; | ||
162 | |||
163 | /* | ||
164 | * If we failed to assign anything, let's try the address | ||
165 | * where firmware left it. That at least has a chance of | ||
166 | * working, which is better than just leaving it disabled. | ||
167 | */ | ||
168 | |||
169 | if (res->flags & IORESOURCE_IO) | ||
170 | root = &ioport_resource; | ||
171 | else | ||
172 | root = &iomem_resource; | ||
173 | |||
174 | start = res->start; | ||
175 | end = res->end; | ||
176 | res->start = dev->fw_addr[resno]; | ||
177 | res->end = res->start + size - 1; | ||
178 | dev_info(&dev->dev, "BAR %d: trying firmware assignment %pR\n", | ||
179 | resno, res); | ||
180 | conflict = request_resource_conflict(root, res); | ||
181 | if (conflict) { | ||
182 | dev_info(&dev->dev, | ||
183 | "BAR %d: %pR conflicts with %s %pR\n", resno, | ||
184 | res, conflict->name, conflict); | ||
185 | res->start = start; | ||
186 | res->end = end; | ||
187 | } else | ||
188 | ret = 0; | ||
189 | } | ||
190 | |||
159 | if (!ret) { | 191 | if (!ret) { |
160 | res->flags &= ~IORESOURCE_STARTALIGN; | 192 | res->flags &= ~IORESOURCE_STARTALIGN; |
161 | dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res); | 193 | dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res); |