public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 02/26]  char/cyclades: replace  schedule_timeout() with msleep_interruptible()
@ 2004-09-23 20:24 janitor
  2004-09-24 15:55 ` Nishanth Aravamudan
  0 siblings, 1 reply; 2+ messages in thread
From: janitor @ 2004-09-23 20:24 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, janitor, nacc




Any comments would be appreciated. 

Description: Use msleep_interruptible() instead of schedule_timeout()
to guarantee the task delays as expected.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

Signed-off-by: Maximilian Attems <janitor@sternwelten.at>
---

 linux-2.6.9-rc2-bk7-max/drivers/char/cyclades.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff -puN drivers/char/cyclades.c~msleep_interruptible-drivers_char_cyclades drivers/char/cyclades.c
--- linux-2.6.9-rc2-bk7/drivers/char/cyclades.c~msleep_interruptible-drivers_char_cyclades	2004-09-21 21:07:58.000000000 +0200
+++ linux-2.6.9-rc2-bk7-max/drivers/char/cyclades.c	2004-09-21 21:07:58.000000000 +0200
@@ -2717,8 +2717,7 @@ cy_wait_until_sent(struct tty_struct *tt
 #ifdef CY_DEBUG_WAIT_UNTIL_SENT
 	    printk("Not clean (jiff=%lu)...", jiffies);
 #endif
-	    current->state = TASK_INTERRUPTIBLE;
-	    schedule_timeout(char_time);
+	    msleep_interruptible(msecs_to_jiffies(char_time));
 	    if (signal_pending(current))
 		break;
 	    if (timeout && time_after(jiffies, orig_jiffies + timeout))
@@ -2729,8 +2728,7 @@ cy_wait_until_sent(struct tty_struct *tt
 	// Nothing to do!
     }
     /* Run one more char cycle */
-    current->state = TASK_INTERRUPTIBLE;
-    schedule_timeout(char_time * 5);
+    msleep_interruptible(jiffies_to_msecs(char_time * 5));
 #ifdef CY_DEBUG_WAIT_UNTIL_SENT
     printk("Clean (jiff=%lu)...done\n", jiffies);
 #endif
@@ -2860,8 +2858,7 @@ cy_close(struct tty_struct *tty, struct 
     if (info->blocked_open) {
 	CY_UNLOCK(info, flags);
         if (info->close_delay) {
-            current->state = TASK_INTERRUPTIBLE;
-            schedule_timeout(info->close_delay);
+            msleep_interruptible(jiffies_to_msecs(info->close_delay));
         }
         wake_up_interruptible(&info->open_wait);
 	CY_LOCK(info, flags);
_

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 02/26]  char/cyclades: replace  schedule_timeout() with msleep_interruptible()
  2004-09-23 20:24 [patch 02/26] char/cyclades: replace schedule_timeout() with msleep_interruptible() janitor
@ 2004-09-24 15:55 ` Nishanth Aravamudan
  0 siblings, 0 replies; 2+ messages in thread
From: Nishanth Aravamudan @ 2004-09-24 15:55 UTC (permalink / raw)
  To: janitor; +Cc: akpm, linux-kernel

On Thu, Sep 23, 2004 at 10:24:58PM +0200, janitor@sternwelten.at wrote:
> 
> 
> 
> Any comments would be appreciated. 
> 
> Description: Use msleep_interruptible() instead of schedule_timeout()
> to guarantee the task delays as expected.
> 
> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
> 
> Signed-off-by: Maximilian Attems <janitor@sternwelten.at>
> ---
> 
>  linux-2.6.9-rc2-bk7-max/drivers/char/cyclades.c |    9 +++------
>  1 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff -puN drivers/char/cyclades.c~msleep_interruptible-drivers_char_cyclades drivers/char/cyclades.c
> --- linux-2.6.9-rc2-bk7/drivers/char/cyclades.c~msleep_interruptible-drivers_char_cyclades	2004-09-21 21:07:58.000000000 +0200
> +++ linux-2.6.9-rc2-bk7-max/drivers/char/cyclades.c	2004-09-21 21:07:58.000000000 +0200
> @@ -2717,8 +2717,7 @@ cy_wait_until_sent(struct tty_struct *tt
>  #ifdef CY_DEBUG_WAIT_UNTIL_SENT
>  	    printk("Not clean (jiff=%lu)...", jiffies);
>  #endif
> -	    current->state = TASK_INTERRUPTIBLE;
> -	    schedule_timeout(char_time);
> +	    msleep_interruptible(msecs_to_jiffies(char_time));

Looks like the wrong macro was used here (should be jiffies_to_msecs()).
Max, want me to send it to you again?

-Nish

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-24 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-23 20:24 [patch 02/26] char/cyclades: replace schedule_timeout() with msleep_interruptible() janitor
2004-09-24 15:55 ` Nishanth Aravamudan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox