mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [git patch review 1/4] IB/mthca: Relax UAR size check
@ 2006-01-31  0:45 Roland Dreier
  2006-01-31  0:45 ` [git patch review 2/4] IB/srp: Semaphore to mutex conversion Roland Dreier
  0 siblings, 1 reply; 4+ messages in thread
From: Roland Dreier @ 2006-01-31  0:45 UTC (permalink / raw)
  To: linux-kernel, openib-general

There are some cards around that have UAR (user access region) size
different from 8 MB.  Relax our sanity check to make sure that the PCI
BAR is big enough to access the UAR size reported by the device
firmware instead.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

---

 drivers/infiniband/hw/mthca/mthca_main.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

cbd2981a97cb628431a987a8abd1731c74bcc32e
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c
index 8b00d9a..9c849d2 100644
--- a/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/drivers/infiniband/hw/mthca/mthca_main.c
@@ -155,6 +155,13 @@ static int __devinit mthca_dev_lim(struc
 		return -ENODEV;
 	}
 
+	if (dev_lim->uar_size > pci_resource_len(mdev->pdev, 2)) {
+		mthca_err(mdev, "HCA reported UAR size of 0x%x bigger than "
+			  "PCI resource 2 size of 0x%lx, aborting.\n",
+			  dev_lim->uar_size, pci_resource_len(mdev->pdev, 2));
+		return -ENODEV;
+	}
+
 	mdev->limits.num_ports      	= dev_lim->num_ports;
 	mdev->limits.vl_cap             = dev_lim->max_vl;
 	mdev->limits.mtu_cap            = dev_lim->max_mtu;
@@ -976,8 +983,7 @@ static int __devinit mthca_init_one(stru
 		err = -ENODEV;
 		goto err_disable_pdev;
 	}
-	if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM) ||
-	    pci_resource_len(pdev, 2) != 1 << 23) {
+	if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM)) {
 		dev_err(&pdev->dev, "Missing UAR, aborting.\n");
 		err = -ENODEV;
 		goto err_disable_pdev;
-- 
1.1.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-01-31  0:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-31  0:45 [git patch review 1/4] IB/mthca: Relax UAR size check Roland Dreier
2006-01-31  0:45 ` [git patch review 2/4] IB/srp: Semaphore to mutex conversion Roland Dreier
2006-01-31  0:45   ` [git patch review 3/4] IB/mthca: Don't cancel commands on a signal Roland Dreier
2006-01-31  0:45     ` [git patch review 4/4] IB/mthca: Semaphore to mutex conversions Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome