From 3c9526f4791b8ef85d98796c08ff8fb3731e87b5 Mon Sep 17 00:00:00 2001 From: Jianqun Xu Date: Wed, 6 Jul 2022 15:57:32 +0800 Subject: [PATCH] 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: 4fe55239b3ba ("iommu/iova: add iova procfs for each dma iommu") Signed-off-by: Jianqun Xu Change-Id: If8aa00bacd13f72efda266632d06ef6899776f5f --- drivers/iommu/iova.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index 7447a0f3f988..716331f802ea 100644 --- a/drivers/iommu/iova.c +++ b/drivers/iommu/iova.c @@ -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;