|
@@ -88,6 +88,12 @@ enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_TUNE_OFF;
|
|
|
u8 pci_dfl_cache_line_size __devinitdata = L1_CACHE_BYTES >> 2;
|
|
|
u8 pci_cache_line_size;
|
|
|
|
|
|
+/*
|
|
|
+ * If we set up a device for bus mastering, we need to check the latency
|
|
|
+ * timer as certain BIOSes forget to set it properly.
|
|
|
+ */
|
|
|
+unsigned int pcibios_max_latency = 255;
|
|
|
+
|
|
|
/**
|
|
|
* pci_bus_max_busnr - returns maximum PCI bus number of given bus' children
|
|
|
* @bus: pointer to PCI bus structure to search
|
|
@@ -2595,6 +2601,29 @@ static void __pci_set_master(struct pci_dev *dev, bool enable)
|
|
|
dev->is_busmaster = enable;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * pcibios_set_master - enable PCI bus-mastering for device dev
|
|
|
+ * @dev: the PCI device to enable
|
|
|
+ *
|
|
|
+ * Enables PCI bus-mastering for the device. This is the default
|
|
|
+ * implementation. Architecture specific implementations can override
|
|
|
+ * this if necessary.
|
|
|
+ */
|
|
|
+void __weak pcibios_set_master(struct pci_dev *dev)
|
|
|
+{
|
|
|
+ u8 lat;
|
|
|
+
|
|
|
+ pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
|
|
|
+ if (lat < 16)
|
|
|
+ lat = (64 <= pcibios_max_latency) ? 64 : pcibios_max_latency;
|
|
|
+ else if (lat > pcibios_max_latency)
|
|
|
+ lat = pcibios_max_latency;
|
|
|
+ else
|
|
|
+ return;
|
|
|
+ dev_printk(KERN_DEBUG, &dev->dev, "setting latency timer to %d\n", lat);
|
|
|
+ pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* pci_set_master - enables bus-mastering for device dev
|
|
|
* @dev: the PCI device to enable
|