public inbox for linux-kernel@vger.kernel.org
 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
Subject: [patch 01/10] char/ds1620: use msleep() instead of schedule_timeout()
Date: Sat, 19 Mar 2005 14:17:15 +0100	[thread overview]
Message-ID: <20050319131716.DB08C1ECA8@trashy.coderock.org> (raw)



Not sure why any driver needs to sleep for *two* ticks, so let's fix it.

Use msleep() instead of schedule_timeout() to guarantee the
task delays as expected. Signals are never checked for by the callers or
in the function itself, so use TASK_UNINTERRUPTIBLE instead of
TASK_INTERRUPTIBLE. The delay is presumed to have been written when HZ==100,
and thus has been multiplied by 10 to pass to msleep().

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


 kj-domen/drivers/char/ds1620.c |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

diff -puN drivers/char/ds1620.c~msleep-drivers_char_ds1620 drivers/char/ds1620.c
--- kj/drivers/char/ds1620.c~msleep-drivers_char_ds1620	2005-03-18 20:05:09.000000000 +0100
+++ kj-domen/drivers/char/ds1620.c	2005-03-18 20:05:09.000000000 +0100
@@ -163,8 +163,7 @@ static void ds1620_out(int cmd, int bits
 	netwinder_ds1620_reset();
 	netwinder_unlock(&flags);
 
-	set_current_state(TASK_INTERRUPTIBLE);
-	schedule_timeout(2);
+	msleep(20);
 }
 
 static unsigned int ds1620_in(int cmd, int bits)
_

             reply	other threads:[~2005-03-19 13:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-19 13:17 domen [this message]
2005-03-19 19:35 ` [patch 01/10] char/ds1620: use msleep() instead of schedule_timeout() Russell King

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=20050319131716.DB08C1ECA8@trashy.coderock.org \
    --to=domen@coderock.org \
    --cc=akpm@osdl.org \
    --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