mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: domen@coderock.org
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, domen@coderock.org,
	nacc@us.ibm.com, janitor@sternwelten.at
Subject: [patch 06/11] Re: sbus/aurora: replace schedule_timeout() with msleep_interruptible()
Date: Wed, 12 Jan 2005 00:35:08 +0100	[thread overview]
Message-ID: <20050111233508.9D5E81F226@trashy.coderock.org> (raw)




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

On Wed, Sep 29, 2004 at 06:10:06PM +0200, Domen Puncer wrote:
> On 27/09/04 10:24 -0700, Nishanth Aravamudan wrote:
> > -			current->state = TASK_INTERRUPTIBLE;
> > -			schedule_timeout(port->close_delay);
> > +			msleep_interruptible(port->close_delay);
> 
> I think you forgot jiffies_to_msecs here.

Please find the corrected patch below.
Thanks for catching this, Domen.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Maximilian Attems <janitor@sternwelten.at>
Signed-off-by: Domen Puncer <domen@coderock.org>
---


 kj-domen/drivers/sbus/char/aurora.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff -puN drivers/sbus/char/aurora.c~msleep_interruptible-drivers_sbus_char_aurora drivers/sbus/char/aurora.c
--- kj/drivers/sbus/char/aurora.c~msleep_interruptible-drivers_sbus_char_aurora	2005-01-10 18:00:11.000000000 +0100
+++ kj-domen/drivers/sbus/char/aurora.c	2005-01-10 18:00:11.000000000 +0100
@@ -1519,8 +1519,7 @@ static void aurora_close(struct tty_stru
 		 */
 		timeout = jiffies+HZ;
 		while(port->SRER & SRER_TXEMPTY)  {
-			current->state = TASK_INTERRUPTIBLE;
-			schedule_timeout(port->timeout);
+			msleep_interruptible(jiffies_to_msecs(port->timeout));
 			if (time_after(jiffies, timeout))
 				break;
 		}
@@ -1537,8 +1536,7 @@ static void aurora_close(struct tty_stru
 	port->tty = 0;
 	if (port->blocked_open) {
 		if (port->close_delay) {
-			current->state = TASK_INTERRUPTIBLE;
-			schedule_timeout(port->close_delay);
+			msleep_interruptible(jiffies_to_msecs(port->close_delay));
 		}
 		wake_up_interruptible(&port->open_wait);
 	}
_

                 reply	other threads:[~2005-01-11 23:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050111233508.9D5E81F226@trashy.coderock.org \
    --to=domen@coderock.org \
    --cc=akpm@osdl.org \
    --cc=janitor@sternwelten.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nacc@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome