@@ -31,6 +31,22 @@
#include <asm/dma.h> /* isa_dma_bridge_buggy */
#include "pci.h"
+static void test_pci_device_reset(struct pci_dev *dev)
+{
+ u16 pci_command;
+
+ if (!reset_devices)
+ return;
+
+ pci_read_config_word(dev, PCI_COMMAND, &pci_command);
+ if (pci_command & PCI_COMMAND_MASTER) {
+ dev_info(&dev->dev, "DEBUG: Disable Bus Master bit\n");
+ pci_command &= ~PCI_COMMAND_MASTER;
+ pci_write_config_word(dev, PCI_COMMAND, pci_command);
+ }
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, test_pci_device_reset);
+
/*
* Decoding should be disabled for a PCI device during BAR sizing to avoid
* conflict. But doing so may cause problems on host bridge and perhaps other