Skip to contentSkip to conversation

dtlk: replace

PATCH New Nishanth Aravamudan 1 participant 9 messages Sep 1, 2004

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

PATCH 1/1 dtlk: replace

This is one of 10 patches which have either not been pushed to mainline (2.6.9-rc1-bk7) or have not been included in any of the recent kjt's.

Applys-to: 2.6.9-rc1-bk7

Description: Uses msleep() instead of schedule_timeout() to guarantee the task delays at least the desired time amount.

drivers/char/dtlk.c +5 -13
@@ -55,7 +55,7 @@
 #include <linux/mm.h>		/* for verify_area */
 #include <linux/errno.h>	/* for -EBUSY */
 #include <linux/ioport.h>	/* for request_region */
-#include <linux/delay.h>	/* for loops_per_jiffy */
+#include <linux/delay.h>	/* for loops_per_jiffy, msleep */
 #include <asm/io.h>		/* for inb_p, outb_p, inb, outb, etc. */
 #include <asm/uaccess.h>	/* for get_user, etc. */
 #include <linux/wait.h>		/* for wait_queue */
@@ -107,7 +107,6 @@ static struct file_operations dtlk_fops 
 };
 
 /* local prototypes */
-static void dtlk_delay(int ms);
 static int dtlk_dev_probe(void);
 static struct dtlk_settings *dtlk_interrogate(void);
 static int dtlk_readable(void);
@@ -146,7 +145,7 @@ static ssize_t dtlk_read(struct file *fi
 			return i;
 		if (file->f_flags & O_NONBLOCK)
 			break;
-		dtlk_delay(100);
+		msleep(100);
 	}
 	if (retries == loops_per_jiffy)
 		printk(KERN_ERR "dtlk_read times out\n");
@@ -191,7 +190,7 @@ static ssize_t dtlk_write(struct file *f
 				   rate to 500 bytes/sec, but that's
 				   still enough to keep up with the
 				   speech synthesizer. */
-				dtlk_delay(1);
+				msleep(1);
 			else {
 				/* the RDY bit goes zero 2-3 usec
 				   after writing, and goes 1 again
@@ -212,7 +211,7 @@ static ssize_t dtlk_write(struct file *f
 		if (file->f_flags & O_NONBLOCK)
 			break;
 
-		dtlk_delay(1);
+		msleep(1);
 
 		if (++retries > 10 * HZ) { /* wait no more than 10 sec
 					      from last write */
@@ -368,13 +367,6 @@ module_exit(dtlk_cleanup);
 
 /* ------------------------------------------------------------------------ */
 
-/* sleep for ms milliseconds */
-static void dtlk_delay(int ms)
-{
-	current->state = TASK_INTERRUPTIBLE;
-	schedule_timeout((ms * HZ + 1000 - HZ) / 1000);
-}
-
 static int dtlk_readable(void)
 {
 #ifdef TRACING
@@ -431,7 +423,7 @@ static int __init dtlk_dev_probe(void)
 			/* posting an index takes 18 msec.  Here, we
 			   wait up to 100 msec to see whether it
 			   appears. */
-			dtlk_delay(100);
+			msleep(100);
 			dtlk_has_indexing = dtlk_readable();
 #ifdef TRACING
 			printk(", indexing %d\n", dtlk_has_indexing);

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

#1 lore raw

PATCH 1/1 i2c-algo-ite: remove

This is one of 10 patches which have either not been pushed to mainline (2.6.9-rc1-bk7) or have not been included in any of the recent kjt's.

Applys-to: 2.6.9-rc1-bk7

Description: Removes unused function iic_sleep().

drivers/i2c/algos/i2c-algo-ite.c +0 -8
@@ -107,14 +107,6 @@ static int wait_for_bb(struct i2c_algo_i
 	return(timeout<=0);
 }
 
-/*
- * Puts this process to sleep for a period equal to timeout 
- */
-static inline void iic_sleep(unsigned long timeout)
-{
-	schedule_timeout( timeout * HZ);
-}
-
 /* After we issue a transaction on the IIC bus, this function
  * is called.  It puts this process to sleep until we get an interrupt from
  * from the controller telling us that the transaction we requested in complete.

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

#2 lore raw

PATCH 1/1 isdn/act2000_isa: remove

In reply to Nishanth Aravamudan

This is one of 10 patches which have either not been pushed to mainline (2.6.9-rc1-bk7) or have not been included in any of the recent kjt's.

Applys-to: 2.6.9-rc1-bk7

Description: Removes isa_delay() and replaces invocations thereof with appropriate calls to msleep() to guarantee the task delays as requested.

drivers/isdn/act2000/act2000_isa.c +2 -9
@@ -18,13 +18,6 @@
 
 static act2000_card *irq2card_map[16];
 
-static void
-act2000_isa_delay(long t)
-{
-        set_current_state(TASK_INTERRUPTIBLE);
-        schedule_timeout(t);
-}
-
 /*
  * Reset Controller, then try to read the Card's signature.
  + Return:
@@ -419,7 +412,7 @@ act2000_isa_download(act2000_card * card
 
         if (!act2000_isa_reset(card->port))
                 return -ENXIO;
-        act2000_isa_delay(HZ / 2);
+        msleep(500);
         if(copy_from_user(&cblock, cb, sizeof(cblock)))
         	return -EFAULT;
         length = cblock.length;
@@ -449,6 +442,6 @@ act2000_isa_download(act2000_card * card
                 p += l;
         }
         kfree(buf);
-        act2000_isa_delay(HZ / 2);
+        msleep(500);
         return (act2000_isa_getid(card));
 }

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

#3 lore raw

PATCH 1/1 isdn/sc/hardware: remove

In reply to Nishanth Aravamudan

This is one of 10 patches which have either not been pushed to mainline (2.6.9-rc1-bk7) or have not been included in any of the recent kjt's.

Applys-to: 2.6.9-rc1-bk7

Depends-on: 2.6.9-rc1-bk7-kjt1 patch, which removes usage of milliseconds() from init.c and card.h.

Description: Removes milliseconds() macro. msecs_to_jiffies() [#include <linux/time.h>] should be used instead.

drivers/isdn/sc/hardware.h +0 -3
@@ -104,9 +104,6 @@
  * Some handy macros
  */
 
-/* Return the number of jiffies in a given number of msecs */
-#define milliseconds(x)	(((x)*HZ)/1000)
-
 /* Determine if a channel number is valid for the adapter */
 #define IS_VALID_CHANNEL(y,x)	((x>0) && (x <= sc_adapter[y]->channels))
 

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

#4 lore raw

PATCH 1/1 message/mptbase: replace

In reply to Nishanth Aravamudan

This is one of 10 patches which have either not been pushed to mainline (2.6.9-rc1-bk7) or have not been included in any of the recent kjt's.

Applys-to: 2.6.9-rc1-bk7

Description: Uses msleep() instead of schedule_timeout() to guarantee the task delays as desired. Fixed for 2.6.9-rc1-bk7.

drivers/message/fusion/mptbase.c +14 -28
@@ -2229,8 +2229,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force
 		}
 
 		if (sleepFlag == CAN_SLEEP) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(1 * HZ / 1000);
+			msleep (1);
 		} else {
 			mdelay (1);	/* 1 msec delay */
 		}
@@ -2599,8 +2598,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepF
 	state = mpt_GetIocState(ioc, 1);
 	while (state != MPI_IOC_STATE_OPERATIONAL && --cntdn) {
 		if (sleepFlag == CAN_SLEEP) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(1 * HZ / 1000);
+			msleep(1);
 		} else {
 			mdelay(1);
 		}
@@ -2867,8 +2865,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int s
 
 	/* wait 1 msec */
 	if (sleepFlag == CAN_SLEEP) {
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(1 * HZ / 1000);
+		msleep (1);
 	} else {
 		mdelay (1);
 	}
@@ -2885,8 +2882,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int s
 		}
 		/* wait 1 sec */
 		if (sleepFlag == CAN_SLEEP) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(1000 * HZ / 1000);
+			msleep (1000);
 		} else {
 			mdelay (1000);
 		}
@@ -2986,8 +2982,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int s
 			return 0;
 		}
 		if (sleepFlag == CAN_SLEEP) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(10 * HZ / 1000);
+			msleep (10);
 		} else {
 			mdelay (10);
 		}
@@ -3038,8 +3033,7 @@ KickStart(MPT_ADAPTER *ioc, int force, i
 		SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag);
 
 		if (sleepFlag == CAN_SLEEP) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(1000 * HZ / 1000);
+			msleep (1000);
 		} else {
 			mdelay (1000);
 		}
@@ -3061,8 +3055,7 @@ KickStart(MPT_ADAPTER *ioc, int force, i
 			return hard_reset_done;
 		}
 		if (sleepFlag == CAN_SLEEP) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(10 * HZ / 1000);
+			msleep (10);
 		} else {
 			mdelay (10);
 		}
@@ -3133,8 +3126,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ign
 
 			/* wait 100 msec */
 			if (sleepFlag == CAN_SLEEP) {
-				set_current_state(TASK_INTERRUPTIBLE);
-				schedule_timeout(100 * HZ / 1000);
+				msleep (100);
 			} else {
 				mdelay (100);
 			}
@@ -3213,8 +3205,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ign
 
 				/* wait 1 sec */
 				if (sleepFlag == CAN_SLEEP) {
-					set_current_state(TASK_INTERRUPTIBLE);
-					schedule_timeout(1000 * HZ / 1000);
+					msleep (1000);
 				} else {
 					mdelay (1000);
 				}
@@ -3241,8 +3232,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ign
 
 				/* wait 1 sec */
 				if (sleepFlag == CAN_SLEEP) {
-					set_current_state(TASK_INTERRUPTIBLE);
-					schedule_timeout(1000 * HZ / 1000);
+					msleep (1000):
 				} else {
 					mdelay (1000);
 				}
@@ -3276,8 +3266,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ign
 
 		/* wait 100 msec */
 		if (sleepFlag == CAN_SLEEP) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(100 * HZ / 1000);
+			msleep (100);
 		} else {
 			mdelay (100);
 		}
@@ -3371,8 +3360,7 @@ SendIocReset(MPT_ADAPTER *ioc, u8 reset_
 		}
 
 		if (sleepFlag == CAN_SLEEP) {
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(1 * HZ / 1000);
+			msleep (1);
 		} else {
 			mdelay (1);	/* 1 msec delay */
 		}
@@ -3808,8 +3796,7 @@ WaitForDoorbellAck(MPT_ADAPTER *ioc, int
 			intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
 			if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS))
 				break;
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(1 * HZ / 1000);
+			msleep (1);
 			count++;
 		}
 	} else {
@@ -3858,8 +3845,7 @@ WaitForDoorbellInt(MPT_ADAPTER *ioc, int
 			intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
 			if (intstat & MPI_HIS_DOORBELL_INTERRUPT)
 				break;
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(1 * HZ / 1000);
+			msleep (1);
 			count++;
 		}
 	} else {

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

#5 lore raw

PATCH 1/1 pcmcia/yenta_socket:

In reply to Nishanth Aravamudan

This is one of 10 patches which have either not been pushed to mainline (2.6.9-rc1-bk7) or have not been included in any of the recent kjt's.

Applys-to: 2.6.9-rc1-bk7

Description: Uses msleep() instead of schedule_timeout() to guarantee the task delays as desired.

drivers/pcmcia/yenta_socket.c +1 -2
@@ -827,8 +827,7 @@ static int yenta_probe_cb_irq(struct yen
 	cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
 	cb_writel(socket, CB_SOCKET_FORCE, CB_FCARDSTS);
 	
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(HZ/10);
+	msleep(100);
 
 	/* disable interrupts */
 	cb_writel(socket, CB_SOCKET_MASK, 0);

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

#6 lore raw

PATCH 1/1 tokenring/lanstreamer:

In reply to Nishanth Aravamudan

This is one of 10 patches which have either not been pushed to mainline (2.6.9-rc1-bk7) or have not been included in any of the recent kjt's.

Applys-to: 2.6.9-rc1-bk7

Description: Uses msleep() instead of schedule_timeout() to guarantee the task delays as desired.

drivers/net/tokenring/lanstreamer.c +1 -2
@@ -455,8 +455,7 @@ static int streamer_reset(struct net_dev
 	writew(readw(streamer_mmio + BCTL) | BCTL_SOFTRESET, streamer_mmio + BCTL);
 	t = jiffies;
 	/* Hold soft reset bit for a while */
-	current->state = TASK_UNINTERRUPTIBLE;
-	schedule_timeout(HZ);
+	msleep(1000);
 	
 	writew(readw(streamer_mmio + BCTL) & ~BCTL_SOFTRESET,
 	       streamer_mmio + BCTL);

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

#7 lore raw

PATCH 1/1 wireless/orinoco_plx:

In reply to Nishanth Aravamudan

This is one of 10 patches which have either not been pushed to mainline (2.6.9-rc1-bk7) or have not been included in any of the recent kjt's.

Applys-to: 2.6.9-rc1-bk7

Description: Uses msleep() instead of schedule_timeout() to guarantee the task delays as desired.

drivers/net/wireless/orinoco_plx.c +1 -2
@@ -352,8 +352,7 @@ static int __init orinoco_plx_init(void)
 static void __exit orinoco_plx_exit(void)
 {
 	pci_unregister_driver(&orinoco_plx_driver);
-	current->state = TASK_UNINTERRUPTIBLE;
-	schedule_timeout(HZ);
+	msleep(1000);
 }
 
 module_init(orinoco_plx_init);

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

#8 lore raw

PATCH 1/1 wireless/orinoco_tmd:

In reply to Nishanth Aravamudan

This is one of 10 patches which have either not been pushed to mainline (2.6.9-rc1-bk7) or have not been included in any of the recent kjt's.

Applys-to: 2.6.9-rc1-bk7

Description: Uses msleep() instead of schedule_timeout() to guarantee the task delays as desired.

drivers/net/wireless/orinoco_tmd.c +2 -2
@@ -63,6 +63,7 @@
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/ioport.h>
+#include <linux/delay.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/system.h>
@@ -218,8 +219,7 @@ static int __init orinoco_tmd_init(void)
 static void __exit orinoco_tmd_exit(void)
 {
 	pci_unregister_driver(&orinoco_tmd_driver);
-	current->state = TASK_UNINTERRUPTIBLE;
-	schedule_timeout(HZ);
+	msleep(1000);
 }
 
 module_init(orinoco_tmd_init);

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