iommu/iova: remove a iova procfs if existed

Since the dma iommu iova maybe deinit, the iova procfs lack of a deinit
operation, driver will complain such as:

[    3.143475] ------------[ cut here ]------------
[    3.143501] proc_dir_entry 'iova/ff920000.rkisp1' already registered
[    3.143545] WARNING: CPU: 1 PID: 154 at fs/proc/generic.c:381 proc_register+0x104/0x128
[    3.143552] Modules linked in:
[    3.143567] CPU: 1 PID: 154 Comm: kworker/u12:2 Not tainted 5.10.66 #19
[    3.143573] Hardware name: Rockchip RK3399 EVB IND LPDDR4 Board edp (Linux) (DT)
[    3.143586] Workqueue: events_unbound deferred_probe_work_func
[    3.143598] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--)
[    3.143606] pc : proc_register+0x104/0x128
[    3.143614] lr : proc_register+0x104/0x128
[    3.143620] sp : ffffffc0128bb9c0
[    3.143625] x29: ffffffc0128bb9c0 x28: 0000000000000000
[    3.143637] x27: ffffffc011cd40e0 x26: 0000000000000000
[    3.143648] x25: 0000000000000000 x24: ffffff8002aaf690
[    3.143658] x23: ffffff8002fd14bc x22: ffffffc011b65820
[    3.143669] x21: ffffff8004050298 x20: ffffff8002aaf600
[    3.143680] x19: ffffff8002fd1400 x18: 0000000000000000
[    3.143690] x17: 0000000000000000 x16: 0000000000000000
[    3.143701] x15: 000000000000000a x14: 6465726574736967
[    3.143711] x13: 6572207964616572 x12: 6c61202731707369
[    3.143722] x11: 6b722e3030303032 x10: 3966662f61766f69
[    3.143733] x9 : ffffffc01009fe50 x8 : 7269645f636f7270

Fixes: 4fe55239b3 ("iommu/iova: add iova procfs for each dma iommu")
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: If8aa00bacd13f72efda266632d06ef6899776f5f
This commit is contained in:
Jianqun Xu
2022-07-06 15:57:32 +08:00
committed by Tao Huang
parent 9f8c23685e
commit 3c9526f479
+1
View File
@@ -69,6 +69,7 @@ void init_iova_domain_procfs(struct iova_domain *iovad, const char *name)
{
struct proc_dir_entry *root;
remove_proc_subtree(name, iova_dir);
root = proc_mkdir(name, iova_dir);
if (!root)
return;