linux - Can msleep inside ioctl cause incorrect mutex operation? -
inside linux driver have ioctl dispatcher, , 1 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 error=%d\n",ret_code); } } } break; } ... }; ... return ret_code; }
int rot_run(unsigned char rot_idx) contains msleep() call
further, userspace program uses of ioctls inside mutex 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 problems?
Comments
Post a Comment