Skip to contentSkip to conversation

usb/usbnet: replace

PATCH Applied David Brownell 3 participants 4 messages Jul 28, 2004 – Aug 2, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 5 lines · Nishanth Aravamudan

I would appreciate any comments from the janitors list.

Applys-to: 2.6.7

Description: Use msleep() instead of schedule_timeout() to guarantee the task delays for the desired time.

Please define and use UNLINK_TIMEOUT_MS, instead.
Or better yet, switch to wait_event() ...

Quoted 7 lines

drivers/usb/net/usbnet.c static int usbnet_stop (struct net_devic · line 2556

Quoted 9 lines
drivers/usb/net/usbnet.c +1 -2
@@ -2550,8 +2550,7 @@ static int usbnet_stop (struct net_devic
 	while (skb_queue_len (&dev->rxq)
 			&& skb_queue_len (&dev->txq)
 			&& skb_queue_len (&dev->done)) {
-		set_current_state (TASK_UNINTERRUPTIBLE);
-		schedule_timeout (UNLINK_TIMEOUT_JIFFIES);
+		msleep(jiffies_to_msecs(UNLINK_TIMEOUT_JIFFIES);
 		devdbg (dev, "waited for %d urb completions", temp);
 	}
 	dev->wait = 0;

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

#1 lore raw
Quoted 10 lines · David Brownell
Quoted 6 lines · Nishanth Aravamudan

I would appreciate any comments from the janitors list.

Applys-to: 2.6.7

Description: Use msleep() instead of schedule_timeout() to guarantee the task delays for the desired time.

Please define and use UNLINK_TIMEOUT_MS, instead.
Or better yet, switch to wait_event() ...

Please find the first of these changes below. Thanks.

drivers/usb/net/usbnet.c +3 -3
@@ -165,7 +165,8 @@
 
 // between wakeups
 #define UNLINK_TIMEOUT_JIFFIES ((3  /*ms*/ * HZ)/1000)
-
+#define UNLINK_TIMEOUT_MS	3
+ 
 /*-------------------------------------------------------------------------*/
 
 // randomly generated ethernet address
@@ -2550,8 +2551,7 @@ static int usbnet_stop (struct net_devic
 	while (skb_queue_len (&dev->rxq)
 			&& skb_queue_len (&dev->txq)
 			&& skb_queue_len (&dev->done)) {
-		set_current_state (TASK_UNINTERRUPTIBLE);
-		schedule_timeout (UNLINK_TIMEOUT_JIFFIES);
+		msleep(UNLINK_TIMEOUT_MS);
 		devdbg (dev, "waited for %d urb completions", temp);
 	}
 	dev->wait = 0;

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

#2 lore raw
In reply to David Brownell
Quoted 6 lines · Nishanth Aravamudan
Quoted 5 lines · David Brownell
Quoted 4 lines · Nishanth Aravamudan

I would appreciate any comments from the janitors list.

Applys-to: 2.6.7

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Description: Use msleep() instead of schedule_timeout() to guarantee the task delays for the desired time.

Please define and use UNLINK_TIMEOUT_MS, instead.
Or better yet, switch to wait_event() ...

Please find the first of these changes below. Thanks.

The previous patch inserted extraneous whitespace. Please find the corrected version below. Also, the unused UNLINK_TIMEOUT_JIFFIES is removed.

-Nish

Applys-to: 2.6.7

Description: Use msleep() instead of schedule_timeout() to guarantee the task delays for the desired time. Delete unused UNLINK_TIMEOUT_JIFFIES #define.

drivers/usb/net/usbnet.c +2 -3
@@ -164,7 +164,7 @@
 #define CONTROL_TIMEOUT_JIFFIES ((CONTROL_TIMEOUT_MS * HZ)/1000)
 
 // between wakeups
-#define UNLINK_TIMEOUT_JIFFIES ((3  /*ms*/ * HZ)/1000)
+#define UNLINK_TIMEOUT_MS	3
 
 /*-------------------------------------------------------------------------*/
 
@@ -2550,8 +2550,7 @@ static int usbnet_stop (struct net_devic
 	while (skb_queue_len (&dev->rxq)
 			&& skb_queue_len (&dev->txq)
 			&& skb_queue_len (&dev->done)) {
-		set_current_state (TASK_UNINTERRUPTIBLE);
-		schedule_timeout (UNLINK_TIMEOUT_JIFFIES);
+		msleep(UNLINK_TIMEOUT_MS);
 		devdbg (dev, "waited for %d urb completions", temp);
 	}
 	dev->wait = 0;

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

Applied
#3 lore raw
In reply to David Brownell
Quoted 21 lines · Nishanth Aravamudan
Quoted 6 lines · Nishanth Aravamudan
Quoted 5 lines · David Brownell
Quoted 4 lines · Nishanth Aravamudan

I would appreciate any comments from the janitors list.

Applys-to: 2.6.7

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Description: Use msleep() instead of schedule_timeout() to guarantee the task delays for the desired time.

Please define and use UNLINK_TIMEOUT_MS, instead.
Or better yet, switch to wait_event() ...

Please find the first of these changes below. Thanks.

The previous patch inserted extraneous whitespace. Please find the corrected version below. Also, the unused UNLINK_TIMEOUT_JIFFIES is removed.

-Nish

Quoted 7 lines

Applys-to: 2.6.7

Description: Use msleep() instead of schedule_timeout() to guarantee the task delays for the desired time. Delete unused UNLINK_TIMEOUT_JIFFIES #define.

Applied, thanks.

greg k-h

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