|
@@ -179,6 +179,9 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
|
|
u16 orig_cmd;
|
|
u16 orig_cmd;
|
|
struct pci_bus_region region, inverted_region;
|
|
struct pci_bus_region region, inverted_region;
|
|
|
|
|
|
|
|
+ if (dev->non_compliant_bars)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
mask = type ? PCI_ROM_ADDRESS_MASK : ~0;
|
|
mask = type ? PCI_ROM_ADDRESS_MASK : ~0;
|
|
|
|
|
|
/* No printks while decoding is disabled! */
|
|
/* No printks while decoding is disabled! */
|
|
@@ -1171,6 +1174,7 @@ static void pci_msi_setup_pci_dev(struct pci_dev *dev)
|
|
int pci_setup_device(struct pci_dev *dev)
|
|
int pci_setup_device(struct pci_dev *dev)
|
|
{
|
|
{
|
|
u32 class;
|
|
u32 class;
|
|
|
|
+ u16 cmd;
|
|
u8 hdr_type;
|
|
u8 hdr_type;
|
|
int pos = 0;
|
|
int pos = 0;
|
|
struct pci_bus_region region;
|
|
struct pci_bus_region region;
|
|
@@ -1214,6 +1218,16 @@ int pci_setup_device(struct pci_dev *dev)
|
|
/* device class may be changed after fixup */
|
|
/* device class may be changed after fixup */
|
|
class = dev->class >> 8;
|
|
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 */
|
|
switch (dev->hdr_type) { /* header type */
|
|
case PCI_HEADER_TYPE_NORMAL: /* standard header */
|
|
case PCI_HEADER_TYPE_NORMAL: /* standard header */
|
|
if (class == PCI_CLASS_BRIDGE_PCI)
|
|
if (class == PCI_CLASS_BRIDGE_PCI)
|