Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b89925c authored by Jon Mason's avatar Jon Mason Committed by Roland Dreier
Browse files

IB/mthca: Remove unnecessary read of PCI_CAP_ID_EXP



The PCIE capability offset is saved during PCI bus walking.  It will
remove an unnecessary search in the PCI configuration space if this
value is referenced instead of reacquiring it.  Also, pci_is_pcie is a
better way of determining if the device is PCIE or not (as it uses the
same saved PCIE capability offset).

Signed-off-by: default avatarJon Mason <jdmason@kudzu.us>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent cdb73db0
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -149,7 +149,7 @@ static int mthca_tune_pci(struct mthca_dev *mdev)
	} else if (!(mdev->mthca_flags & MTHCA_FLAG_PCIE))
	} else if (!(mdev->mthca_flags & MTHCA_FLAG_PCIE))
		mthca_info(mdev, "No PCI-X capability, not setting RBC.\n");
		mthca_info(mdev, "No PCI-X capability, not setting RBC.\n");


	if (pci_find_capability(mdev->pdev, PCI_CAP_ID_EXP)) {
	if (pci_is_pcie(mdev->pdev)) {
		if (pcie_set_readrq(mdev->pdev, 4096)) {
		if (pcie_set_readrq(mdev->pdev, 4096)) {
			mthca_err(mdev, "Couldn't write PCI Express read request, "
			mthca_err(mdev, "Couldn't write PCI Express read request, "
				"aborting.\n");
				"aborting.\n");
+1 −1
Original line number Original line Diff line number Diff line
@@ -113,7 +113,7 @@ int mthca_reset(struct mthca_dev *mdev)
	}
	}


	hca_pcix_cap = pci_find_capability(mdev->pdev, PCI_CAP_ID_PCIX);
	hca_pcix_cap = pci_find_capability(mdev->pdev, PCI_CAP_ID_PCIX);
	hca_pcie_cap = pci_find_capability(mdev->pdev, PCI_CAP_ID_EXP);
	hca_pcie_cap = pci_pcie_cap(mdev->pdev);


	if (bridge) {
	if (bridge) {
		bridge_header = kmalloc(256, GFP_KERNEL);
		bridge_header = kmalloc(256, GFP_KERNEL);