summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hns/hns_roce_hem.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman2019-04-21 23:18:44 +0200
committerGreg Kroah-Hartman2019-04-21 23:18:44 +0200
commit817de6b85914a3dda72b971c074d4d342965fba0 (patch)
treedf0a4563a04aadb8f8595f72392d66d65797c455 /drivers/infiniband/hw/hns/hns_roce_hem.c
parentstaging: kpc2000: add initial set of Daktronics drivers (diff)
parentLinux 5.1-rc6 (diff)
downloadkernel-qcow2-linux-817de6b85914a3dda72b971c074d4d342965fba0.tar.gz
kernel-qcow2-linux-817de6b85914a3dda72b971c074d4d342965fba0.tar.xz
kernel-qcow2-linux-817de6b85914a3dda72b971c074d4d342965fba0.zip
Merge 5.1-rc6 into staging-next
We want the fixes in here as well as this resolves an iio driver merge issue. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/infiniband/hw/hns/hns_roce_hem.c')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.c b/drivers/infiniband/hw/hns/hns_roce_hem.c
index f1fec56f3ff4..8e29dbb5b5fb 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hem.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hem.c
@@ -792,6 +792,8 @@ void *hns_roce_table_find(struct hns_roce_dev *hr_dev,
idx_offset = (obj & (table->num_obj - 1)) % obj_per_chunk;
dma_offset = offset = idx_offset * table->obj_size;
} else {
+ u32 seg_size = 64; /* 8 bytes per BA and 8 BA per segment */
+
hns_roce_calc_hem_mhop(hr_dev, table, &mhop_obj, &mhop);
/* mtt mhop */
i = mhop.l0_idx;
@@ -803,8 +805,8 @@ void *hns_roce_table_find(struct hns_roce_dev *hr_dev,
hem_idx = i;
hem = table->hem[hem_idx];
- dma_offset = offset = (obj & (table->num_obj - 1)) *
- table->obj_size % mhop.bt_chunk_size;
+ dma_offset = offset = (obj & (table->num_obj - 1)) * seg_size %
+ mhop.bt_chunk_size;
if (mhop.hop_num == 2)
dma_offset = offset = 0;
}