Skip to contentSkip to conversation

8139too.c

KJ carlos neira 3 participants 3 messages Jan 9, 2006

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

greetings :
patch: linux-2.6.15-rc7/drivers/net/8139too.c

This patch uses wait_event_interruptible instead of slep_on_interruptible , compiled ok , using it right now.
Please some comments if i messed something up .

Signature · 3 lines
"Employ your time in improving yourself by other men's writings, so that you 
shall gain easily what others have labored hard for."
Socrates
home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/net/8139too.c renamed from usr/src/linux-2.6.15-rc7/drivers/net/8139too.c +9 -5
diff -urN /usr/src/linux-2.6.15-rc7/drivers/net/8139too.c /home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/net/8139too.c
@@ -111,6 +111,7 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/irq.h>
+#include<linux/wait.h>
 
 #define RTL8139_DRIVER_NAME   DRV_NAME " Fast Ethernet driver " DRV_VERSION
 #define PFX DRV_NAME ": "
@@ -1599,18 +1600,21 @@
 	struct net_device *dev = data;
 	struct rtl8139_private *tp = netdev_priv(dev);
 	unsigned long timeout;
-
+	wait_queue_head_t  rlq;
+	init_waitqueue_head(&rlq);
+	int gotsignal ;
 	daemonize("%s", dev->name);
 	allow_signal(SIGTERM);
 
 	while (1) {
 		timeout = next_tick;
 		do {
-			timeout = interruptible_sleep_on_timeout (&tp->thr_wait, timeout);
-			/* make swsusp happy with our thread */
-			try_to_freeze();
-		} while (!signal_pending (current) && (timeout > 0));
+		  
+		 gotsignal = wait_event_interruptible(rlq,timeout > 0);	
+		  
+		} while (gotsignal != 0  && (timeout > 0));
 
+		
 		if (signal_pending (current)) {
 			flush_signals(current);
 		}

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/net/8139too.c

Quoted 7 lines · carlos neira

This patch uses wait_event_interruptible instead of slep_on_interruptible , compiled ok , using it right now.
Please some comments if i messed something up .

diff -urN /usr/src/linux-2.6.15-rc7/drivers/net/8139too.c /home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/net/8139too.c

home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/net/8139too.c renamed from usr/src/linux-2.6.15-rc7/drivers/net/8139too.c +0 -0

Please, read Documentation/SubmittingPatches for the proper format.

home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/net/8139too.c line 1617

Quoted 13 lines
home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/net/8139too.c renamed from usr/src/linux-2.6.15-rc7/drivers/net/8139too.c +5 -4
 	while (1) {
 		timeout = next_tick;
 		do {
-			timeout = interruptible_sleep_on_timeout (&tp->thr_wait, timeout);
-			/* make swsusp happy with our thread */
-			try_to_freeze();
-		} while (!signal_pending (current) && (timeout > 0));
+		  
+		 gotsignal = wait_event_interruptible(rlq,timeout > 0);	
+		  
+		} while (gotsignal != 0  && (timeout > 0));
 
+		

I'm sure swsusp won't be happy with this change.

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw
In reply to carlos neira
Quoted 23 lines · Alexey Dobriyan

home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/net/8139too.c

Quoted 7 lines · carlos neira

This patch uses wait_event_interruptible instead of slep_on_interruptible , compiled ok , using it right now.
Please some comments if i messed something up .

diff -urN /usr/src/linux-2.6.15-rc7/drivers/net/8139too.c /home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/net/8139too.c

home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/net/8139too.c renamed from usr/src/linux-2.6.15-rc7/drivers/net/8139too.c +0 -0

Please, read Documentation/SubmittingPatches for the proper format.

Quoted 12 lines
home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/net/8139too.c renamed from usr/src/linux-2.6.15-rc7/drivers/net/8139too.c +4 -4
 	while (1) {
 		timeout = next_tick;
 		do {
-			timeout = interruptible_sleep_on_timeout (&tp->thr_wait, timeout);
-			/* make swsusp happy with our thread */
-			try_to_freeze();
-		} while (!signal_pending (current) && (timeout > 0));
+		  
+		 gotsignal = wait_event_interruptible(rlq,timeout > 0);	
+		  
+		} while (gotsignal != 0  && (timeout > 0));
Quoted 3 lines

home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/net/8139too.c

Quoted 1 line
home/cneira/Linuxjanitoring/linux-janitorpatching/drivers/net/8139too.c renamed from usr/src/linux-2.6.15-rc7/drivers/net/8139too.c +1 -0
+		

I'm sure swsusp won't be happy with this change.

Agreed, NACK... hint: the try_to_freeze() call is necessary.

Thanks,
Nish

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors