aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_main.c
diff options
context:
space:
mode:
authorRoland Dreier <roland@topspin.com>2005-04-16 18:26:24 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:26:24 -0400
commit44ea66879d5638cfed5b5ecf628badfd8ec26f36 (patch)
tree987bb5368a8e4a058cffc2eef4752d7cca4335e5 /drivers/infiniband/hw/mthca/mthca_main.c
parentddb934e0eead2feadc7467b1f7bf9c81aa241232 (diff)
[PATCH] IB/mthca: fix MTT allocation in mem-free mode
Fix bug in MTT allocation in mem-free mode. I misunderstood the MTT size value returned by the firmware -- it is really the size of a single MTT entry, since mem-free mode does not segment the MTT as the original firmware did. This meant that our MTT addresses ended up being off by a factor of 8. This meant that our MTT allocations might overlap, and so we could overwrite and corrupt earlier memory regions when writing new MTT entries. We fix this by always using our 64-byte MTT segment size. This allows some simplification of the code as well, since there's no reason to put the MTT segment size in a variable -- we can always use our enum value directly. Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_main.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c
index 144aed417faa..7912b262a4cf 100644
--- a/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/drivers/infiniband/hw/mthca/mthca_main.c
@@ -390,7 +390,7 @@ static int __devinit mthca_init_icm(struct mthca_dev *mdev,
390 } 390 }
391 391
392 mdev->mr_table.mtt_table = mthca_alloc_icm_table(mdev, init_hca->mtt_base, 392 mdev->mr_table.mtt_table = mthca_alloc_icm_table(mdev, init_hca->mtt_base,
393 dev_lim->mtt_seg_sz, 393 MTHCA_MTT_SEG_SIZE,
394 mdev->limits.num_mtt_segs, 394 mdev->limits.num_mtt_segs,
395 mdev->limits.reserved_mtts, 1); 395 mdev->limits.reserved_mtts, 1);
396 if (!mdev->mr_table.mtt_table) { 396 if (!mdev->mr_table.mtt_table) {