netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netconsole: release the spinlock before __netpoll_cleanup()
@ 2013-03-06 14:46 Veaceslav Falico
  2013-03-06 14:51 ` Cong Wang
  2013-03-07  0:08 ` Neil Horman
  0 siblings, 2 replies; 11+ messages in thread
From: Veaceslav Falico @ 2013-03-06 14:46 UTC (permalink / raw)
  To: netdev; +Cc: amwang, davem

Commit 3335f0ca130c201f8680e97f63612053fbc16e22 removed spinlock unlocking
before __netpoll_cleanup() in netconsole_netdev_event(), however we still
might sleep in __netpoll_cleanup() - via synchronize_srcu(). Revert it and
add a comment.

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
 drivers/net/netconsole.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 37add21..dd62b4c 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -680,7 +680,17 @@ static int netconsole_netdev_event(struct notifier_block *this,
 				 * rtnl_lock already held
 				 */
 				if (nt->np.dev) {
+					/*
+					 * we still might sleep in
+					 * __netpoll_cleanup(), so release
+					 * the lock
+					 */
+					spin_unlock_irqrestore(
+							      &target_list_lock,
+							      flags);
 					__netpoll_cleanup(&nt->np);
+					spin_lock_irqsave(&target_list_lock,
+							  flags);
 					dev_put(nt->np.dev);
 					nt->np.dev = NULL;
 				}
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-03-11 17:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-06 14:46 [PATCH] netconsole: release the spinlock before __netpoll_cleanup() Veaceslav Falico
2013-03-06 14:51 ` Cong Wang
2013-03-07  0:08 ` Neil Horman
2013-03-07 10:03   ` Veaceslav Falico
2013-03-07 14:43     ` Neil Horman
2013-03-07 21:14     ` David Miller
2013-03-10 15:25       ` Veaceslav Falico
2013-03-11 10:08         ` Veaceslav Falico
2013-03-11 11:30           ` Neil Horman
2013-03-11 11:39             ` Veaceslav Falico
2013-03-11 17:58               ` Neil Horman

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).