diff --git a/drivers/uacce/uacce.c b/drivers/uacce/uacce.c index f863aa6f49e0951442c7b6a92c16cfb714f24fc8..9e61cfd646560a907a69d9e33af74ddc08261c6f 100644 --- a/drivers/uacce/uacce.c +++ b/drivers/uacce/uacce.c @@ -44,6 +44,7 @@ static DEFINE_RWLOCK(uacce_qs_lock); static const struct file_operations uacce_fops; static int uacce_fops_fasync(int fd, struct file *file, int mode); +static int uacce_put_queue(struct file *filep); /* match with enum uacce_qfrt */ static const char *const qfrt_str[] = { @@ -540,6 +541,9 @@ static long uacce_fops_unl_ioctl(struct file *filep, case UACCE_CMD_GET_SS_DMA: return uacce_get_ss_dma(q, (void __user *)arg); + case UACCE_CMD_PUT_Q: + return uacce_put_queue(filep); + default: if (uacce->ops->ioctl) return uacce->ops->ioctl(q, cmd, arg); @@ -630,9 +634,9 @@ static int uacce_queue_drain(struct uacce_queue *q) } /* While user space releases a queue, all the relatives on the queue - * should be released imediately by this flush. + * should be released imediately by this putting. */ -static int uacce_fops_flush(struct file *filep, fl_owner_t id) +static int uacce_put_queue(struct file *filep) { struct uacce_queue *q = filep->private_data; struct uacce *uacce; @@ -645,12 +649,6 @@ static int uacce_fops_flush(struct file *filep, fl_owner_t id) atomic_cmpxchg(&q->status, UACCE_ST_OPENNED, UACCE_ST_INIT)) return 0; - /* - * It is different between CI and kernel-dev here, so delete list - * entry in flush callback and release callback. After flush is called - * uacce_queue will be NULL, and same code will not be called in - * release, so it is safe. - */ uacce_fops_fasync(-1, filep, 0); mutex_lock(&uacce->q_lock); list_del(&q->q_dev); @@ -915,7 +913,6 @@ static int uacce_fops_fasync(int fd, struct file *file, int mode) static const struct file_operations uacce_fops = { .owner = THIS_MODULE, .open = uacce_fops_open, - .flush = uacce_fops_flush, .release = uacce_fops_release, .unlocked_ioctl = uacce_fops_unl_ioctl, #ifdef CONFIG_COMPAT diff --git a/include/uapi/linux/uacce.h b/include/uapi/linux/uacce.h index 953f9bf5067df157bc9e816fefbf6dbe936a4a80..2085969bade769b77e0f61bdb1b3d1e4e1ce3626 100644 --- a/include/uapi/linux/uacce.h +++ b/include/uapi/linux/uacce.h @@ -10,6 +10,7 @@ #define UACCE_CMD_SHARE_SVAS _IO('W', 0) #define UACCE_CMD_START _IO('W', 1) #define UACCE_CMD_GET_SS_DMA _IOR('W', 2, unsigned long) +#define UACCE_CMD_PUT_Q _IO('W', 3) /** * UACCE Device Attributes: