* [Kernel-janitors] [PATCH 2.6.9-rc2 3/40] net/airo: replace
@ 2004-09-21 22:00 Nishanth Aravamudan
0 siblings, 0 replies; only message in thread
From: Nishanth Aravamudan @ 2004-09-21 22:00 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 3173 bytes --]
Any comments would be appreciated.
Description: Use msleep()/msleep_interruptible() [as appropriate]
instead of schedule_timeout() to guarantee the task delays as
expected. Also uses set_current_state() instead of direct assignment of
current->state in one place.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
--- 2.6.9-rc2-vanilla/drivers/net/wireless/airo.c 2004-09-13 17:15:41.000000000 -0700
+++ 2.6.9-rc2/drivers/net/wireless/airo.c 2004-09-15 09:51:48.000000000 -0700
@@ -1699,9 +1699,8 @@ static int readBSSListRid(struct airo_in
issuecommand(ai, &cmd, &rsp);
up(&ai->sem);
/* Let the command take effect */
- set_current_state (TASK_INTERRUPTIBLE);
ai->task = current;
- schedule_timeout (3*HZ);
+ msleep_interruptible(3*1000);
ai->task = NULL;
}
rc = PC4500_readrid(ai, first ? RID_BSSLISTFIRST : RID_BSSLISTNEXT,
@@ -2671,11 +2670,9 @@ int reset_card( struct net_device *dev ,
return -1;
waitbusy (ai);
OUT4500(ai,COMMAND,CMD_SOFTRESET);
- set_current_state (TASK_UNINTERRUPTIBLE);
- schedule_timeout (HZ/5);
+ msleep(200);
waitbusy (ai);
- set_current_state (TASK_UNINTERRUPTIBLE);
- schedule_timeout (HZ/5);
+ msleep(200);
if (lock)
up(&ai->sem);
return 0;
@@ -2934,7 +2931,7 @@ static int airo_thread(void *data) {
}
break;
}
- current->state = TASK_RUNNING;
+ set_current_state(TASK_RUNNING);
remove_wait_queue(&ai->thr_wait, &wait);
locked = 1;
}
@@ -5526,12 +5523,12 @@ static int airo_pci_resume(struct pci_de
} else {
OUT4500(ai, EVACK, EV_AWAKEN);
OUT4500(ai, EVACK, EV_AWAKEN);
- schedule_timeout(HZ/10);
+ msleep_interruptible(100);
}
set_bit (FLAG_COMMIT, &ai->flags);
disable_MAC(ai, 0);
- schedule_timeout (HZ/5);
+ msleep_interruptible(200);
if (ai->SSID) {
writeSsidRid(ai, ai->SSID, 0);
kfree(ai->SSID);
@@ -7437,8 +7434,7 @@ int cmdreset(struct airo_info *ai) {
OUT4500(ai,COMMAND,CMD_SOFTRESET);
- set_current_state (TASK_UNINTERRUPTIBLE);
- schedule_timeout (HZ); /* WAS 600 12/7/00 */
+ ssleep(1); /* WAS 600 12/7/00 */
if(!waitbusy (ai)){
printk(KERN_INFO "Waitbusy hang AFTER RESET\n");
@@ -7465,8 +7461,7 @@ int setflashmode (struct airo_info *ai)
OUT4500(ai, SWS3, FLASH_COMMAND);
OUT4500(ai, COMMAND,0);
}
- set_current_state (TASK_UNINTERRUPTIBLE);
- schedule_timeout (HZ/2); /* 500ms delay */
+ msleep(500); /* 500ms delay */
if(!waitbusy(ai)) {
clear_bit (FLAG_FLASHING, &ai->flags);
@@ -7576,8 +7571,7 @@ int flashputbuf(struct airo_info *ai){
int flashrestart(struct airo_info *ai,struct net_device *dev){
int i,status;
- set_current_state (TASK_UNINTERRUPTIBLE);
- schedule_timeout (HZ); /* Added 12/7/00 */
+ ssleep(1); /* Added 12/7/00 */
clear_bit (FLAG_FLASHING, &ai->flags);
if (test_bit(FLAG_MPI, &ai->flags)) {
status = mpi_init_descriptors(ai);
@@ -7592,8 +7586,7 @@ int flashrestart(struct airo_info *ai,st
( ai, 2312, i >= MAX_FIDS / 2 );
}
- set_current_state (TASK_UNINTERRUPTIBLE);
- schedule_timeout (HZ); /* Added 12/7/00 */
+ ssleep(1); /* Added 12/7/00 */
return status;
}
#endif /* CISCO_EXT */
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-09-21 22:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-21 22:00 [Kernel-janitors] [PATCH 2.6.9-rc2 3/40] net/airo: replace Nishanth Aravamudan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.