Pull asus into release branch
[pandora-kernel.git] / drivers / infiniband / hw / mthca / mthca_mr.c
index 6037dd3..ee561c5 100644 (file)
@@ -310,8 +310,9 @@ int mthca_write_mtt_size(struct mthca_dev *dev)
        return mthca_is_memfree(dev) ? (PAGE_SIZE / sizeof (u64)) : 0x7ffffff;
 }
 
-void mthca_tavor_write_mtt_seg(struct mthca_dev *dev, struct mthca_mtt *mtt,
-                             int start_index, u64 *buffer_list, int list_len)
+static void mthca_tavor_write_mtt_seg(struct mthca_dev *dev,
+                                     struct mthca_mtt *mtt, int start_index,
+                                     u64 *buffer_list, int list_len)
 {
        u64 __iomem *mtts;
        int i;
@@ -323,8 +324,9 @@ void mthca_tavor_write_mtt_seg(struct mthca_dev *dev, struct mthca_mtt *mtt,
                                  mtts + i);
 }
 
-void mthca_arbel_write_mtt_seg(struct mthca_dev *dev, struct mthca_mtt *mtt,
-                             int start_index, u64 *buffer_list, int list_len)
+static void mthca_arbel_write_mtt_seg(struct mthca_dev *dev,
+                                     struct mthca_mtt *mtt, int start_index,
+                                     u64 *buffer_list, int list_len)
 {
        __be64 *mtts;
        dma_addr_t dma_handle;
@@ -833,6 +835,7 @@ void mthca_arbel_fmr_unmap(struct mthca_dev *dev, struct mthca_fmr *fmr)
 
        key = arbel_key_to_hw_index(fmr->ibmr.lkey);
        key &= dev->limits.num_mpts - 1;
+       key = adjust_key(dev, key);
        fmr->ibmr.lkey = fmr->ibmr.rkey = arbel_hw_index_to_key(key);
 
        fmr->maps = 0;
@@ -879,8 +882,8 @@ int mthca_init_mr_table(struct mthca_dev *dev)
                }
                mpts = mtts = 1 << i;
        } else {
-               mpts = dev->limits.num_mtt_segs;
-               mtts = dev->limits.num_mpts;
+               mtts = dev->limits.num_mtt_segs;
+               mpts = dev->limits.num_mpts;
        }
 
        if (!mthca_is_memfree(dev) &&