linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: sam song <sam_song@usish.com>
Cc: linux-ide@vger.kernel.org
Subject: Re: Issuing a vendor specific ATA cmd on SATA Disk via ATA Pass Thru
Date: Tue, 04 Dec 2007 11:21:09 +0900	[thread overview]
Message-ID: <4754B995.4010800@gmail.com> (raw)
In-Reply-To: <002d01c83615$79261090$6539a8c0@usish.com.cn>

[-- Attachment #1: Type: text/plain, Size: 464 bytes --]

sam song wrote:
=>> Hmmm... It's timeout.  How long does the command take?  It's a bit weird
>> because 36000s but the reported command duration is 136s.  How long did
>> the command take actually?
> 
> The command did actually take 136minutes25seconds. I set the timeout in app
> as 36000seconds(10-hour). 

Right, 136m.  I wonder whether it's hitting some hard timeout limit in
the kernel.  Hmmmm... Does the attached patch fix your problem?

Thanks.

-- 
tejun

[-- Attachment #2: sg_io-fix-jiffies-conversion.patch --]
[-- Type: text/x-patch, Size: 753 bytes --]

diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 91c7322..9675b34 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -230,7 +230,7 @@ static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
 	rq->cmd_len = hdr->cmd_len;
 	rq->cmd_type = REQ_TYPE_BLOCK_PC;
 
-	rq->timeout = (hdr->timeout * HZ) / 1000;
+	rq->timeout = msecs_to_jiffies(hdr->timeout);
 	if (!rq->timeout)
 		rq->timeout = q->sg_timeout;
 	if (!rq->timeout)
@@ -366,7 +366,7 @@ static int sg_io(struct file *file, struct request_queue *q,
 	 */
 	blk_execute_rq(q, bd_disk, rq, 0);
 
-	hdr->duration = ((jiffies - start_time) * 1000) / HZ;
+	hdr->duration = jiffies_to_msecs(jiffies - start_time);
 
 	return blk_complete_sghdr_rq(rq, hdr, bio);
 out:

  reply	other threads:[~2007-12-04  2:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29 10:34 Issuing a vendor specific ATA cmd on SATA Disk via ATA Pass Thru sam song
2007-11-30  1:18 ` Tejun Heo
2007-11-30  3:33   ` sam song
2007-11-30  6:12     ` Tejun Heo
2007-11-30  6:29       ` sam song
2007-11-30  6:33         ` Tejun Heo
2007-11-30  6:42           ` sam song
2007-11-30  6:47             ` Tejun Heo
2007-11-30  7:01               ` sam song
2007-11-30  8:22                 ` Tejun Heo
2007-12-03 10:20                   ` sam song
2007-12-04  0:46                     ` Tejun Heo
2007-12-04  1:32                       ` sam song
2007-12-04  2:21                         ` Tejun Heo [this message]
2007-12-05  1:43                           ` Tejun Heo
2007-12-05  2:39                             ` sam song
2007-12-05  3:16                               ` Tejun Heo
2008-03-11  3:17                                 ` sam song
2008-03-11  3:21                                   ` Tejun Heo

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=4754B995.4010800@gmail.com \
    --to=htejun@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=sam_song@usish.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;
as well as URLs for NNTP newsgroup(s).