From: James Bottomley <James.Bottomley@SteelEye.com>
To: "Salyzyn, Mark" <mark_salyzyn@adaptec.com>
Cc: janitor@sternwelten.at,
SCSI Mailing List <linux-scsi@vger.kernel.org>,
nacc@us.ibm.com
Subject: RE: [patch 08/10] scsi/dpt_i2o: replace schedule_timeout() withmsleep_interruptible()
Date: 21 Oct 2004 09:47:15 -0400 [thread overview]
Message-ID: <1098366441.1716.12.camel@mulgrave> (raw)
In-Reply-To: <60807403EABEB443939A5A7AA8A7458B40B5E9@otce2k01.adaptec.com>
On Thu, 2004-10-21 at 09:17, Salyzyn, Mark wrote:
> The driver does set the state to TASK_INTERRUPTIBLE a handful of lines
> above, is there some other state that the driver should have set?
No, it should be set to TASK_[UN]INTERRUPTIBLE. However, you can't just
do it once. When the schedule_timeout() returns, the state is once more
TASK_RUNNING. If you want to do another schedule_timeout() like you're
doing in this case, you have to set it to TASK_[UN]INTERRUPTIBLE again.
> We should remove the set_current_state(TASK_INTERRUPTIBLE) line when
> replacing with the msleep_interruptible(timeout * 1000) line.
Actually, the whole thing:
if((status = adpt_i2o_post_this(pHba, msg, len)) == 0){
set_current_state(TASK_INTERRUPTIBLE);
if(pHba->host)
spin_unlock_irq(pHba->host->host_lock);
if (!timeout)
schedule();
else{
timeout = schedule_timeout(timeout);
if (timeout == 0) {
// I/O issued, but cannot get result in
// specified time. Freeing resorces is
// dangerous.
status = -ETIME;
}
schedule_timeout(timeout*HZ);
}
if(pHba->host)
spin_lock_irq(pHba->host->host_lock);
}
Looks a bit bogus. Are the conditional spinlocks really necesary? Why
is timeout multiplied by HZ in the second case, but not in the first
case? The only reason why timeout would be non-zero in the first
schedule timeout would be if the sleep were interrupted.
James
next prev parent reply other threads:[~2004-10-21 13:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-21 13:17 [patch 08/10] scsi/dpt_i2o: replace schedule_timeout() withmsleep_interruptible() Salyzyn, Mark
2004-10-21 13:47 ` James Bottomley [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-10-21 14:11 [patch 08/10] scsi/dpt_i2o: replace schedule_timeout()withmsleep_interruptible() Salyzyn, Mark
2004-10-22 23:22 ` Nishanth Aravamudan
2004-10-24 14:03 ` maximilian attems
2004-10-24 14:39 ` James Bottomley
2004-10-25 11:30 Salyzyn, Mark
2004-10-25 14:19 ` James Bottomley
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=1098366441.1716.12.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=janitor@sternwelten.at \
--cc=linux-scsi@vger.kernel.org \
--cc=mark_salyzyn@adaptec.com \
--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