Inside my linux driver I have an ioctl dispatcher, and one branch uses msleep() function.
static long p347_fpga_ioctl(struct file *filp, uint cmd, unsigned long arg)
{
long ret_code = 0;
...
switch (cmd) {
...
case p347_IOCTL_CLIENT_START_ROT: {
if (arg != 0) {
ret_code = rot_set_params(trp); //idx
if (ret_code == 0) {
ret_code = rot_run(trp->rot_idx);
} else {
printk("Cannot setup rot channel with error=%d\n",ret_code);
}
}
}
break; }
...
};
...
return ret_code;
}
int rot_run(unsigned char rot_idx) contains msleep() call
Further, my userspace program uses all of ioctls inside mutex to prevent simultaneous calls.
...
pthread_mutex_lock(&FMutex);
ret = ioctl(dev_desc, p347_IOCTL_CLIENT_START_ROT, ¶ms);
pthread_mutex_unlock(&FMutex);
...
That way, can msleep() cause any problems?