linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arch: um: remove locking in deactivate_all_fds()
@ 2019-05-24 19:37 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2019-05-24 19:37 UTC (permalink / raw)
  To: linux-um; +Cc: j, Richard Weinberger, Jeff Dike, Johannes Berg, Anton Ivanov

From: Johannes Berg <johannes.berg@intel.com>

Not only does the locking contradict the comment, and as
the comment says is pointless and actually harmful (all
the actual OS threads have exited already), but it also
causes crashes when lockdep is enabled, because calling
into the spinlock calls into lockdep, which then tries
to determine the current task, which no longer exists.

Remove the locking to let UML shut down cleanly in case
lockdep is enabled.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 arch/um/kernel/irq.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index b40dac71e25b..d532377f5808 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -384,10 +384,8 @@ EXPORT_SYMBOL(deactivate_fd);
  */
 int deactivate_all_fds(void)
 {
-	unsigned long flags;
 	struct irq_entry *to_free;
 
-	spin_lock_irqsave(&irq_lock, flags);
 	/* Stop IO. The IRQ loop has no lock so this is our
 	 * only way of making sure we are safe to dispose
 	 * of all IRQ handlers
@@ -404,7 +402,6 @@ int deactivate_all_fds(void)
 		to_free = to_free->next;
 	}
 	garbage_collect_irq_entries();
-	spin_unlock_irqrestore(&irq_lock, flags);
 	os_close_epoll_fd();
 	return 0;
 }
-- 
2.17.2


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-24 19:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-24 19:37 [PATCH] arch: um: remove locking in deactivate_all_fds() Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).