public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Willem Riede <osst@riede.org>
Cc: domen@coderock.org, linux-scsi@vger.kernel.org
Subject: [UPDATE PATCH] scsi/osst: replace schedule_timeout() with msleep()
Date: Mon, 7 Mar 2005 15:05:22 -0800	[thread overview]
Message-ID: <20050307230522.GD2778@us.ibm.com> (raw)
In-Reply-To: <1110148975l.5880l.4l@serve.riede.org>

On Sun, Mar 06, 2005 at 10:42:55PM +0000, Willem Riede wrote:
> On 03/06/2005 05:27:41 PM, domen@coderock.org wrote:
> > 
> > 
> > Use msleep() instead of schedule_timeout() to guarantee the task
> > delays as expected. Although TASK_INTERRUPTIBLE is used in the current code,
> > there is no code dealing with an early return / signals_pending().
> 
> This change is a total don't-care as far as I'm concerned. But if we are going to 
> make it, can we please be consistent? Does the "set_current_state(TASK_INTERRUPTIBLE)"
> stay or go? The two changes below don't agree in that respect.

You are completely correct. Please excuse the sloppy patch, fixed below.

Description: Use msleep() instead of schedule_timeout() to guarantee the
task delays as expected. Although TASK_INTERRUPTIBLE is used in the
current code, there is no code dealing with an early return / signals_pending().

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

--- 2.6.11-v/drivers/scsi/osst.c	2005-03-01 23:38:08.000000000 -0800
+++ 2.6.11/drivers/scsi/osst.c	2005-03-07 15:01:38.000000000 -0800
@@ -862,8 +862,7 @@ static int osst_recover_wait_frame(struc
 				retval = osst_write_error_recovery(STp, aSRpnt, 0);
 				break;
 			}
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout (HZ / OSST_POLL_PER_SEC);
+			msleep(1000 / OSST_POLL_PER_SEC);
 
 			STp->buffer->b_data = mybuf; STp->buffer->buffer_size = 24;
 			memset(cmd, 0, MAX_COMMAND_SIZE);
@@ -1558,8 +1557,7 @@ static int osst_reposition_and_retry(str
 			osst_set_frame_position(STp, aSRpnt, frame + skip, 1);
 			flag = 0;
 			attempts--;
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(HZ / 10);
+			msleep(100);
 		}
 		if (osst_get_frame_position(STp, aSRpnt) < 0) {		/* additional write error */
 #if DEBUG
@@ -1620,8 +1618,7 @@ static int osst_reposition_and_retry(str
 			debugging = 0;
 		}
 #endif
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(HZ / 10);
+		msleep(100);
 	}
 	printk(KERN_ERR "%s:E: Failed to find valid tape media\n", name);
 #if DEBUG

      reply	other threads:[~2005-03-07 23:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-06 22:27 [patch 1/1] scsi/osst: replace schedule_timeout() with msleep() domen
2005-03-06 22:42 ` Willem Riede
2005-03-07 23:05   ` Nishanth Aravamudan [this message]

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=20050307230522.GD2778@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=domen@coderock.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=osst@riede.org \
    /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