hfi1/user_exp_rcv: explicitely call hfi1_map_device_addresses

There were cases where nobody else did this mapping for us
This commit is contained in:
Dominique Martinet
2017-09-22 11:38:47 +09:00
committed by Balazs Gerofi
parent d23939da8c
commit 662895c020
3 changed files with 21 additions and 3 deletions

View File

@ -641,8 +641,6 @@ long hfi1_file_ioctl(void *private_data, unsigned int cmd,
return ret;
}
int hfi1_map_device_addresses(struct hfi1_filedata *fd);
#ifdef __HFI1_ORIG__
static ssize_t hfi1_aio_write(struct kiocb *kiocb, const struct iovec *iovec,
unsigned long dim, loff_t offset)

View File

@ -1651,6 +1651,8 @@ struct hfi1_filedata {
void *mm; //struct mm_struct *mm;
};
int hfi1_map_device_addresses(struct hfi1_filedata *fd);
#ifdef __HFI1_ORIG__
extern struct list_head hfi1_dev_list;

View File

@ -50,6 +50,7 @@
#include <hfi1/hfi.h>
#include <hfi1/chip.h>
#include <hfi1/user_exp_rcv.h>
#include <hfi1/user_sdma.h> // for hfi1_map_device_addresses
//#define DEBUG_PRINT_USER_EXP_RCV
@ -99,6 +100,12 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd, struct hfi1_tid_info *tinf
return -EINVAL;
}
if (hfi1_map_device_addresses(fd) < 0) {
kprintf("%s: Could not map hfi1 device addresses\n",
__FUNCTION__);
return -EINVAL;
}
tidlist = kmalloc_cache_alloc(&tidlist_cache,
sizeof(*tidlist) * uctxt->expected_count);
if (!tidlist)
@ -234,6 +241,17 @@ int hfi1_user_exp_rcv_clear(struct hfi1_filedata *fd, struct hfi1_tid_info *tinf
goto done;
}
/* Technically should never be needed (because mapped previously
* on update), but this call is no-op if addresses have been set
* previously
*/
if (hfi1_map_device_addresses(fd) < 0) {
kprintf("%s: Could not map hfi1 device addresses\n",
__FUNCTION__);
return -EINVAL;
}
dkprintf("Clear called, cnt %d\n", tinfo->tidcnt);
for (tididx = 0; tididx < tinfo->tidcnt; tididx++) {
ret = unprogram_rcvarray(fd, tidinfo[tididx], NULL);
@ -296,8 +314,8 @@ static int program_rcvarray(struct hfi1_filedata *fd, uintptr_t phys,
order = 0;
dkprintf("len %u, order %u\n", len, order);
rcv_array_wc_fill(dd, grp->base + idx);
rcventry = grp->base + idx;
rcv_array_wc_fill(dd, rcventry);
ret = set_rcvarray_entry(fd, phys, rcventry, grp,
order);
if (ret)