diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 09:52:46 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 09:52:46 -0800 |
commit | 488823f114a3cef58e7eb932cac977440a2a59cb (patch) | |
tree | f6cb0840c927ba0234949b8f8728600a474cb1b2 /drivers/infiniband/hw/mthca/mthca_provider.c | |
parent | 827b3f6abc21246928e38480bb308936701a2ad4 (diff) | |
parent | 3c2d774cad5bf4fad576363da77870e9e6530b7a (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
RDMA/nes: Add a driver for NetEffect RNICs
IB/mthca: Return proper error codes from mthca_fmr_alloc()
IB: Avoid marking __devinitdata as const
IB/mlx4: Actually print out the driver version
IB/ib_mthca: Pre-link receive WQEs in Tavor mode
IB/mthca: Remove checks for srq->first_free < 0
IB/fmr_pool: Allocate page list for pool FMRs only when caching enabled
IB/srp: Retry stale connections
mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
IB/mthca: Don't read reserved fields in mthca_QUERY_ADAPTER()
IPoIB: Remove a misleading debug print
IPoIB: Handle bonding failover race for connected neighbours too
IB/mthca: Fix and simplify page size calculation in mthca_reg_phys_mr()
IB/ehca: Add PMA support
IB/ehca: Update sma_attr also in case of disruptive config change
IB/ehca: Prevent sending UD packets to QP0
IB/cm: Add interim support for routed paths
mlx4_core: Fix more section mismatches
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_provider.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_provider.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c index 6bcde1cb968..9e491df6419 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.c +++ b/drivers/infiniband/hw/mthca/mthca_provider.c @@ -923,17 +923,13 @@ static struct ib_mr *mthca_reg_phys_mr(struct ib_pd *pd, struct mthca_mr *mr; u64 *page_list; u64 total_size; - u64 mask; + unsigned long mask; int shift; int npages; int err; int i, j, n; - /* First check that we have enough alignment */ - if ((*iova_start & ~PAGE_MASK) != (buffer_list[0].addr & ~PAGE_MASK)) - return ERR_PTR(-EINVAL); - - mask = 0; + mask = buffer_list[0].addr ^ *iova_start; total_size = 0; for (i = 0; i < num_phys_buf; ++i) { if (i != 0) @@ -947,17 +943,7 @@ static struct ib_mr *mthca_reg_phys_mr(struct ib_pd *pd, if (mask & ~PAGE_MASK) return ERR_PTR(-EINVAL); - /* Find largest page shift we can use to cover buffers */ - for (shift = PAGE_SHIFT; shift < 31; ++shift) - if (num_phys_buf > 1) { - if ((1ULL << shift) & mask) - break; - } else { - if (1ULL << shift >= - buffer_list[0].size + - (buffer_list[0].addr & ((1ULL << shift) - 1))) - break; - } + shift = __ffs(mask | 1 << 31); buffer_list[0].size += buffer_list[0].addr & ((1ULL << shift) - 1); buffer_list[0].addr &= ~0ull << shift; @@ -1270,6 +1256,8 @@ static int mthca_init_node_data(struct mthca_dev *dev) goto out; } + if (mthca_is_memfree(dev)) + dev->rev_id = be32_to_cpup((__be32 *) (out_mad->data + 32)); memcpy(&dev->ib_dev.node_guid, out_mad->data + 12, 8); out: |