Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264230
b: refs/heads/master
c: 5f39e67
h: refs/heads/master
v: v3
  • Loading branch information
Jon Mason authored and Linus Torvalds committed Oct 4, 2011
1 parent cc0ca1a commit 991d427
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 05faadcf59507e8eea57ffbeea9cbb14c9a2ab3d
refs/heads/master: 5f39e6705faade2e89d119958a8c51b9b6e2c53c
6 changes: 5 additions & 1 deletion trunk/drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ unsigned long pci_cardbus_mem_size = DEFAULT_CARDBUS_MEM_SIZE;
unsigned long pci_hotplug_io_size = DEFAULT_HOTPLUG_IO_SIZE;
unsigned long pci_hotplug_mem_size = DEFAULT_HOTPLUG_MEM_SIZE;

enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_SAFE;
enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_TUNE_OFF;

/*
* The default CLS is used if arch didn't set CLS explicitly and not
Expand Down Expand Up @@ -3568,10 +3568,14 @@ static int __init pci_setup(char *str)
pci_hotplug_io_size = memparse(str + 9, &str);
} else if (!strncmp(str, "hpmemsize=", 10)) {
pci_hotplug_mem_size = memparse(str + 10, &str);
} else if (!strncmp(str, "pcie_bus_tune_off", 17)) {
pcie_bus_config = PCIE_BUS_TUNE_OFF;
} else if (!strncmp(str, "pcie_bus_safe", 13)) {
pcie_bus_config = PCIE_BUS_SAFE;
} else if (!strncmp(str, "pcie_bus_perf", 13)) {
pcie_bus_config = PCIE_BUS_PERFORMANCE;
} else if (!strncmp(str, "pcie_bus_peer2peer", 18)) {
pcie_bus_config = PCIE_BUS_PEER2PEER;
} else {
printk(KERN_ERR "PCI: Unknown option `%s'\n",
str);
Expand Down
14 changes: 13 additions & 1 deletion trunk/drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1458,12 +1458,24 @@ static int pcie_bus_configure_set(struct pci_dev *dev, void *data)
*/
void pcie_bus_configure_settings(struct pci_bus *bus, u8 mpss)
{
u8 smpss = mpss;
u8 smpss;

if (!pci_is_pcie(bus->self))
return;

if (pcie_bus_config == PCIE_BUS_TUNE_OFF)
return;

/* FIXME - Peer to peer DMA is possible, though the endpoint would need
* to be aware to the MPS of the destination. To work around this,
* simply force the MPS of the entire system to the smallest possible.
*/
if (pcie_bus_config == PCIE_BUS_PEER2PEER)
smpss = 0;

if (pcie_bus_config == PCIE_BUS_SAFE) {
smpss = mpss;

pcie_find_smpss(bus->self, &smpss);
pci_walk_bus(bus, pcie_find_smpss, &smpss);
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,9 @@ struct pci_driver {
extern void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss);

enum pcie_bus_config_types {
PCIE_BUS_PERFORMANCE,
PCIE_BUS_TUNE_OFF,
PCIE_BUS_SAFE,
PCIE_BUS_PERFORMANCE,
PCIE_BUS_PEER2PEER,
};

Expand Down

0 comments on commit 991d427

Please sign in to comment.