diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2022-01-13 09:57:45 -0600 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2022-01-13 09:57:45 -0600 |
commit | 05642e2f64600a54f076dd0a3bbe2518d4c5cfe7 (patch) | |
tree | edc46fcc024f35852755e347b9c5f756b2f33776 /drivers/pci | |
parent | c6ff0f8dc05fc4137e0bc4a2e2d468430027df98 (diff) | |
parent | 500b55b05d0a21c4adddf4c3b29ee6f32b502046 (diff) |
Merge branch 'pci/resource'
- Always write Intel I210 ROM BAR on update to work around device defect
(Bjorn Helgaas)
* pci/resource:
PCI: Work around Intel I210 ROM BAR overlap defect
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/quirks.c | 10 | ||||
-rw-r--r-- | drivers/pci/setup-res.c | 8 |
2 files changed, 16 insertions, 2 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 003950c738d2..46ff04091fa3 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -5857,3 +5857,13 @@ static void nvidia_ion_ahci_fixup(struct pci_dev *pdev) pdev->dev_flags |= PCI_DEV_FLAGS_HAS_MSI_MASKING; } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0ab8, nvidia_ion_ahci_fixup); + +static void rom_bar_overlap_defect(struct pci_dev *dev) +{ + pci_info(dev, "working around ROM BAR overlap defect\n"); + dev->rom_bar_overlap = 1; +} +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1533, rom_bar_overlap_defect); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1536, rom_bar_overlap_defect); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1537, rom_bar_overlap_defect); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1538, rom_bar_overlap_defect); diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 7f1acb3918d0..439ac5f5907a 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -75,12 +75,16 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno) * as zero when disabled, so don't update ROM BARs unless * they're enabled. See * https://lore.kernel.org/r/43147B3D.1030309@vc.cvut.cz/ + * But we must update ROM BAR for buggy devices where even a + * disabled ROM can conflict with other BARs. */ - if (!(res->flags & IORESOURCE_ROM_ENABLE)) + if (!(res->flags & IORESOURCE_ROM_ENABLE) && + !dev->rom_bar_overlap) return; reg = dev->rom_base_reg; - new |= PCI_ROM_ADDRESS_ENABLE; + if (res->flags & IORESOURCE_ROM_ENABLE) + new |= PCI_ROM_ADDRESS_ENABLE; } else return; |