HFI: call hfi1_map_device_addresses() at initialization time
Conflicts: kernel/syscall.c
This commit is contained in:
@ -571,6 +571,7 @@ long hfi1_file_ioctl(void *private_data, unsigned int cmd,
|
||||
else
|
||||
return -EPERM;
|
||||
#endif
|
||||
ret = -ENODEV;
|
||||
dkprintf("%s: HFI1_IOCTL_SET_PKEY \n", __FUNCTION__);
|
||||
break;
|
||||
|
||||
@ -687,10 +688,6 @@ ssize_t hfi1_aio_write(void *private_data, const struct iovec *iovec, unsigned l
|
||||
if (!dim)
|
||||
return -EINVAL;
|
||||
|
||||
if (hfi1_map_device_addresses(fd) < 0) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hfi1_cdbg(SDMA, "SDMA request from %u:%u (%lu)",
|
||||
fd->uctxt->ctxt, fd->subctxt, dim);
|
||||
|
||||
|
||||
@ -3146,6 +3146,7 @@ SYSCALL_DECLARE(ioctl)
|
||||
long irqstate;
|
||||
void *private_data = proc->fd_priv_table[fd];
|
||||
unsigned long t_s = rdtsc();
|
||||
int sub_rc = 0;
|
||||
|
||||
irqstate = ihk_mc_spinlock_lock(&proc->mckfd_lock);
|
||||
for(fdp = proc->mckfd; fdp; fdp = fdp->next)
|
||||
@ -3163,20 +3164,34 @@ SYSCALL_DECLARE(ioctl)
|
||||
ihk_mc_syscall_arg1(ctx),
|
||||
ihk_mc_syscall_arg2(ctx),
|
||||
t_s);
|
||||
/* continue forwarding iff hfi1 didn't handle it */
|
||||
|
||||
/* Continue forwarding iff hfi1 didn't handle it */
|
||||
// TODO: improve heuristics?
|
||||
if (rc != -ENOTSUPP)
|
||||
if (rc != -ENOTSUPP && rc != -ENODEV)
|
||||
return rc;
|
||||
|
||||
if (rc == -ENODEV) {
|
||||
sub_rc = rc;
|
||||
}
|
||||
}
|
||||
|
||||
if (fdp && fdp->ioctl_cb) {
|
||||
//kprintf("ioctl: found system fd %d\n", fd);
|
||||
rc = fdp->ioctl_cb(fdp, ctx);
|
||||
}
|
||||
else {
|
||||
rc = syscall_generic_forwarding(__NR_ioctl, ctx);
|
||||
}
|
||||
|
||||
if (private_data && sub_rc == -ENODEV) {
|
||||
extern int hfi1_map_device_addresses(void *fd);
|
||||
|
||||
if (hfi1_map_device_addresses(private_data) < 0) {
|
||||
kprintf("%s: Could not map hfi1 device addresses\n",
|
||||
__FUNCTION__);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@ -100,12 +100,6 @@ 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);
|
||||
sizeof(*tidlist) * 1024);
|
||||
|
||||
Reference in New Issue
Block a user