Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67101
b: refs/heads/master
c: a855b1a
h: refs/heads/master
i:
  67099: 52cfb4e
v: v3
  • Loading branch information
Peter Oruba authored and Roland Dreier committed Oct 10, 2007
1 parent 34ddc1a commit 75d949f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 26 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: 3c10c7c929b30e8813d15960cb97f95a0b2ba615
refs/heads/master: a855b1a7423ac83c76638f156d79c854b0feb94d
33 changes: 8 additions & 25 deletions trunk/drivers/infiniband/hw/mthca/mthca_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,40 +137,23 @@ static const char mthca_version[] __devinitdata =

static int mthca_tune_pci(struct mthca_dev *mdev)
{
int cap;
u16 val;

if (!tune_pci)
return 0;

/* First try to max out Read Byte Count */
cap = pci_find_capability(mdev->pdev, PCI_CAP_ID_PCIX);
if (cap) {
if (pci_read_config_word(mdev->pdev, cap + PCI_X_CMD, &val)) {
mthca_err(mdev, "Couldn't read PCI-X command register, "
"aborting.\n");
return -ENODEV;
}
val = (val & ~PCI_X_CMD_MAX_READ) | (3 << 2);
if (pci_write_config_word(mdev->pdev, cap + PCI_X_CMD, val)) {
mthca_err(mdev, "Couldn't write PCI-X command register, "
"aborting.\n");
if (pci_find_capability(mdev->pdev, PCI_CAP_ID_PCIX)) {
if (pcix_set_mmrbc(mdev->pdev, pcix_get_max_mmrbc(mdev->pdev))) {
mthca_err(mdev, "Couldn't set PCI-X max read count, "
"aborting.\n");
return -ENODEV;
}
} else if (!(mdev->mthca_flags & MTHCA_FLAG_PCIE))
mthca_info(mdev, "No PCI-X capability, not setting RBC.\n");

cap = pci_find_capability(mdev->pdev, PCI_CAP_ID_EXP);
if (cap) {
if (pci_read_config_word(mdev->pdev, cap + PCI_EXP_DEVCTL, &val)) {
mthca_err(mdev, "Couldn't read PCI Express device control "
"register, aborting.\n");
return -ENODEV;
}
val = (val & ~PCI_EXP_DEVCTL_READRQ) | (5 << 12);
if (pci_write_config_word(mdev->pdev, cap + PCI_EXP_DEVCTL, val)) {
mthca_err(mdev, "Couldn't write PCI Express device control "
"register, aborting.\n");
if (pci_find_capability(mdev->pdev, PCI_CAP_ID_EXP)) {
if (pcie_set_readrq(mdev->pdev, 4096)) {
mthca_err(mdev, "Couldn't write PCI Express read request, "
"aborting.\n");
return -ENODEV;
}
} else if (mdev->mthca_flags & MTHCA_FLAG_PCIE)
Expand Down

0 comments on commit 75d949f

Please sign in to comment.