Skip to contentSkip to conversation

use rtnl_lock_interruptible in 8139 to avoid shutdown hang

PATCH In review Christoph Hellwig 2 participants 4 messages Jan 9, 2005 – Jan 11, 2005

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

PATCH 2/2 use rtnl_lock_interruptible in 8139 to avoid shutdown hang

The 8139too thread needs to use rtnl_lock_interruptible so it can avoid doing the actual work once it's been kill_proc()ed on module removal time.

Based on debugging and an earlier patch that adds a driver-private semaphore from Herbert Xu.

drivers/net/8139too.c +2 -1
@@ -1636,7 +1636,8 @@
 		if (tp->time_to_die)
 			break;
 
-		rtnl_lock ();
+		if (rtnl_lock_interruptible ())
+			break;
 		rtl8139_thread_iter (dev, tp, tp->mmio_addr);
 		rtnl_unlock ();
 	}
maintainer
#1 lore raw
Quoted 6 lines · On Sun, 9 Jan 2005 13:16:30 +0100 Christoph Hellwig <[email protected]> wrote:

The 8139too thread needs to use rtnl_lock_interruptible so it can avoid doing the actual work once it's been kill_proc()ed on module removal time.

Based on debugging and an earlier patch that adds a driver-private semaphore from Herbert Xu.

I've applied these two patches, they look perfectly fine. Thanks Christoph.

#2 lore raw
Quoted 7 lines · David S. Miller
Quoted 4 lines · On Sun, 9 Jan 2005 13:16:30 +0100 Christoph Hellwig <[email protected]> wrote:

The 8139too thread needs to use rtnl_lock_interruptible so it can avoid doing the actual work once it's been kill_proc()ed on module removal time.

Quoted 5 lines
Quoted 2 lines

Based on debugging and an earlier patch that adds a driver-private semaphore from Herbert Xu.

I've applied these two patches, they look perfectly fine. Thanks Christoph.

Btw, there's some confusing between rtnl_lock and rtnl_shlock (similar for the other variants). Is there an agenda behind this versions or would you take a patch that unifies the lock assecors?

maintainer
#3 lore raw
Quoted 3 lines · On Mon, 10 Jan 2005 22:45:22 +0100 Christoph Hellwig <[email protected]> wrote:

Btw, there's some confusing between rtnl_lock and rtnl_shlock (similar for the other variants). Is there an agenda behind this versions or would you take a patch that unifies the lock assecors?

What exactly do you plan to change?