public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Cc: nacc@us.ibm.com
Subject: [PATCH] w1/w1_therm: replace schedule_timeout() with msleep_interruptible()
Date: Fri, 4 Mar 2005 12:39:42 -0800	[thread overview]
Message-ID: <110996878287@kroah.com> (raw)
In-Reply-To: <20050304203920.GB31644@kroah.com>

ChangeSet 1.2080, 2005/03/02 16:58:20-08:00, nacc@us.ibm.com

[PATCH] w1/w1_therm: replace schedule_timeout() with msleep_interruptible()

Description: Use msleep_interruptible() instead of schedule_timeout() to
guarantee the task delays as expected. Changed tm to an int, as it now is in
terms of msecs, not jiffies.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/w1/w1_therm.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)


diff -Nru a/drivers/w1/w1_therm.c b/drivers/w1/w1_therm.c
--- a/drivers/w1/w1_therm.c	2005-03-04 12:38:25 -08:00
+++ b/drivers/w1/w1_therm.c	2005-03-04 12:38:25 -08:00
@@ -26,6 +26,7 @@
 #include <linux/moduleparam.h>
 #include <linux/device.h>
 #include <linux/types.h>
+#include <linux/delay.h>
 
 #include "w1.h"
 #include "w1_io.h"
@@ -128,7 +129,7 @@
 		if (!w1_reset_bus (dev)) {
 			int count = 0;
 			u8 match[9] = {W1_MATCH_ROM, };
-			unsigned long tm;
+			unsigned int tm = 750;
 
 			memcpy(&match[1], (u64 *) & sl->reg_num, 8);
 			
@@ -136,11 +137,8 @@
 
 			w1_write_8(dev, W1_CONVERT_TEMP);
 
-			tm = jiffies + msecs_to_jiffies(750);
-			while(time_before(jiffies, tm)) {
-				set_current_state(TASK_INTERRUPTIBLE);
-				schedule_timeout(tm-jiffies);
-
+			while (tm) {
+				tm = msleep_interruptible(tm);
 				if (signal_pending(current))
 					flush_signals(current);
 			}


  reply	other threads:[~2005-03-04 22:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-04 20:39 [BK PATCH] W1 patches for 2.6.11 Greg KH
2005-03-04 20:39 ` Greg KH [this message]
2005-03-04 20:39   ` [PATCH] w1: dscore cleanups. 2/2 Greg KH
2005-03-04 20:39     ` [PATCH] w1: Core cleanup 1/2 Greg KH
2005-03-04 20:39       ` [PATCH] w1: fix some compiler warnings generated by the last "static" patch Greg KH
2005-03-04 20:39         ` [PATCH] w1: replace obsoleted *sleep_on* Greg KH
2005-03-04 20:39           ` [PATCH] w1: get rid of the potential problems with atomic operations Greg KH
2005-03-04 20:39             ` [PATCH] drivers/w1/*: convert to pci_register_driver Greg KH

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=110996878287@kroah.com \
    --to=greg@kroah.com \
    --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