diff options
| author | Alex Shi <alex.shi@linaro.org> | 2016-04-13 12:02:17 +0800 |
|---|---|---|
| committer | Alex Shi <alex.shi@linaro.org> | 2016-04-13 12:02:17 +0800 |
| commit | ad592b70ae97800d4f5bf535d45a680649e2789e (patch) | |
| tree | 340a684df3e8dc3d893297f43c025c82e94cbb6a /drivers/pci/probe.c | |
| parent | f96884662e5ca42a3a39854454f5efd04342b48b (diff) | |
| parent | b40108b826ed9e1c558f73b9dbabb8d80ded268b (diff) | |
Merge tag 'v4.4.7' into linux-linaro-lsk-v4.4
This is the 4.4.7 stable release
Diffstat (limited to 'drivers/pci/probe.c')
| -rw-r--r-- | drivers/pci/probe.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index edb1984201e9..7aafb5fb9336 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -179,6 +179,9 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, u16 orig_cmd; struct pci_bus_region region, inverted_region; + if (dev->non_compliant_bars) + return 0; + mask = type ? PCI_ROM_ADDRESS_MASK : ~0; /* No printks while decoding is disabled! */ @@ -1174,6 +1177,7 @@ void pci_msi_setup_pci_dev(struct pci_dev *dev) int pci_setup_device(struct pci_dev *dev) { u32 class; + u16 cmd; u8 hdr_type; int pos = 0; struct pci_bus_region region; @@ -1219,6 +1223,16 @@ int pci_setup_device(struct pci_dev *dev) /* device class may be changed after fixup */ class = dev->class >> 8; + if (dev->non_compliant_bars) { + pci_read_config_word(dev, PCI_COMMAND, &cmd); + if (cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { + dev_info(&dev->dev, "device has non-compliant BARs; disabling IO/MEM decoding\n"); + cmd &= ~PCI_COMMAND_IO; + cmd &= ~PCI_COMMAND_MEMORY; + pci_write_config_word(dev, PCI_COMMAND, cmd); + } + } + switch (dev->hdr_type) { /* header type */ case PCI_HEADER_TYPE_NORMAL: /* standard header */ if (class == PCI_CLASS_BRIDGE_PCI) |
