Skip to contentSkip to conversation

remoteproc: Move rproc_delete_debug_dir() to rproc_del()

PATCH Applied Sarangdhar Joshi 2 participants 3 messages Jan 24, 2017 – Jan 30, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remoteproc: Move rproc_delete_debug_dir() to rproc_del()

The "remoteproc{0,1...}" sysfs entries are added in rproc_add() and deleted in rproc_type_release() instead of in rproc_del(). That leaves these lingering entries sticking around after we return from rproc_del(). Move the rproc_delete_debug_dir() to rproc_del() to fix this.

---
 drivers/remoteproc/remoteproc_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/remoteproc_core.c +2 -2
index 953ee29..78200a7 100644
@@ -1315,8 +1315,6 @@ static void rproc_type_release(struct device *dev)
 
 	dev_info(&rproc->dev, "releasing %s\n", rproc->name);
 
-	rproc_delete_debug_dir(rproc);
-
 	idr_destroy(&rproc->notifyids);
 
 	if (rproc->index >= 0)
@@ -1491,6 +1489,8 @@ int rproc_del(struct rproc *rproc)
 	if (rproc->auto_boot)
 		rproc_shutdown(rproc);
 
+	rproc_delete_debug_dir(rproc);
+
 	/* the rproc is downref'ed as soon as it's removed from the klist */
 	mutex_lock(&rproc_list_mutex);
 	list_del(&rproc->node);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw
Quoted 7 lines · Sarangdhar Joshi

The "remoteproc{0,1...}" sysfs entries are added in rproc_add() and deleted in rproc_type_release() instead of in rproc_del(). That leaves these lingering entries sticking around after we return from rproc_del(). Move the rproc_delete_debug_dir() to rproc_del() to fix this.

I moved the rproc_delete_debug_dir() below the list_del() region to allow reuse of the critical region in the upcoming "deleted" patch.

Applied, thank you.

Regards,
Bjorn

Quoted 30 lines
---
 drivers/remoteproc/remoteproc_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/remoteproc_core.c +2 -2
index 953ee29..78200a7 100644
@@ -1315,8 +1315,6 @@ static void rproc_type_release(struct device *dev)
 
 	dev_info(&rproc->dev, "releasing %s\n", rproc->name);
 
-	rproc_delete_debug_dir(rproc);
-
 	idr_destroy(&rproc->notifyids);
 
 	if (rproc->index >= 0)
@@ -1491,6 +1489,8 @@ int rproc_del(struct rproc *rproc)
 	if (rproc->auto_boot)
 		rproc_shutdown(rproc);
 
+	rproc_delete_debug_dir(rproc);
+
 	/* the rproc is downref'ed as soon as it's removed from the klist */
 	mutex_lock(&rproc_list_mutex);
 	list_del(&rproc->node);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#2 lore raw
Quoted 8 lines · Bjorn Andersson
Quoted 6 lines · Sarangdhar Joshi

The "remoteproc{0,1...}" sysfs entries are added in rproc_add() and deleted in rproc_type_release() instead of in rproc_del(). That leaves these lingering entries sticking around after we return from rproc_del(). Move the rproc_delete_debug_dir() to rproc_del() to fix this.

Quoted 5 lines
Quoted 1 line

I moved the rproc_delete_debug_dir() below the list_del() region to allow reuse of the critical region in the upcoming "deleted" patch.

Never mind, I failed at reading. I re-applied this as is.

Regards,
Bjorn

Quoted 35 lines

Applied, thank you.

Regards,
Bjorn

Quoted 30 lines
---
 drivers/remoteproc/remoteproc_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/remoteproc_core.c +2 -2
index 953ee29..78200a7 100644
@@ -1315,8 +1315,6 @@ static void rproc_type_release(struct device *dev)
 
 	dev_info(&rproc->dev, "releasing %s\n", rproc->name);
 
-	rproc_delete_debug_dir(rproc);
-
 	idr_destroy(&rproc->notifyids);
 
 	if (rproc->index >= 0)
@@ -1491,6 +1489,8 @@ int rproc_del(struct rproc *rproc)
 	if (rproc->auto_boot)
 		rproc_shutdown(rproc);
 
+	rproc_delete_debug_dir(rproc);
+
 	/* the rproc is downref'ed as soon as it's removed from the klist */
 	mutex_lock(&rproc_list_mutex);
 	list_del(&rproc->node);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project