Commit e1e5a155 authored by Qi Tao's avatar Qi Tao Committed by JiangShui
Browse files

uacce: modify the configuration mode of device isolation stragety

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I82ARL


CVE: NA

------------------------------------------------------------------

Cancel the reference counting of the accelerator device
so that the device (with hardware errors) isolation stragety
can also be modified while the accelerator is running a task.

Signed-off-by: default avatarQi Tao <taoqi10@huawei.com>
Signed-off-by: default avatarJiangShui Yang <yangjiangshui@h-partners.com>
parent 5923d73e
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -88,7 +88,6 @@ static int uacce_put_queue(struct uacce_queue *q)
		uacce->ops->put_queue(q);

	q->state = UACCE_Q_ZOMBIE;
	atomic_dec(&uacce->ref);

	return 0;
}
@@ -348,7 +347,6 @@ static int uacce_fops_open(struct inode *inode, struct file *filep)
			goto out_with_bond;
	}

	atomic_inc(&uacce->ref);
	init_waitqueue_head(&q->wait);
	filep->private_data = q;
	q->state = UACCE_Q_INIT;
@@ -821,9 +819,6 @@ static ssize_t isolate_strategy_store(struct device *dev, struct device_attribut
	if (val > UACCE_MAX_ERR_THRESHOLD)
		return -EINVAL;

	if (atomic_read(&uacce->ref))
		return -EBUSY;

	ret = uacce->ops->isolate_err_threshold_write(uacce, val);
	if (ret)
		return ret;
+0 −2
Original line number Diff line number Diff line
@@ -148,7 +148,6 @@ struct uacce_queue {
 * @mutex: protects uacce operation
 * @priv: private pointer of the uacce
 * @queues: list of queues
 * @ref: reference of the uacce
 */
struct uacce_device {
	const char *algs;
@@ -164,7 +163,6 @@ struct uacce_device {
	struct device dev;
	struct mutex mutex;
	void *priv;
	atomic_t ref;
	struct uacce_err_isolate *isolate;
	struct list_head queues;
};