-
由 Mingqiang Ling 提交于
driver inclusion category: bugfix bugzilla: NA CVE: NA This patch adds state machine for uacce and QM. Related state machine and lock design documents can be found: https://github.com/hisilicon/dev-docs/blob/master/warpdrive/state_model.rst https://github.com/hisilicon/dev-docs/blob/master/warpdrive/uacce_lock.rst This patch also solves below problems: - Remove uacce_queue pool in uacce, let's low level driver to maintain queue pool. So locks(uacce_mutex, uacce->q_lock) for uacce are also removed. - Provide an ioctl to put hardware queue, as hardware queue which is put in uacce .release callback will be delayed to put in kernel. - Modify reset logic of uacce. UACCE_ST_RST state of uacce has been deleted. Current logic is: before doing hardware reset, a SIGIO has been sent to process which has been binded with uacce_queue, low level driver waits user to close all fds before doing uacce_unregister; after hardware reset done, low level driver can register to uacce subsystem again. - Modify the way to send reset signal: use send_sig_info to send signal. Known issue as comments of function uacce_send_sig_to_client: "This function can be called in low level driver, which may bring a race with uacce_fops_release. The problem is this function may be called when q is NULL. Low level driver should avoid this by locking hardware queue pool and check if there is related hardware queue before calling this function. Modify the sec/rde module codes to adapt the uacce/qm changes. Signed-off-by: Ntanshukun (A) <tanshukun1@huawei.com> Reviewed-by: Nwangzhou <wangzhou1@hisilicon.com> Signed-off-by: NMingqiang Ling <lingmingqiang@huawei.com> Signed-off-by: Nlingmingqiang <lingmingqiang@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
8bf65d55