From: "Tony Battersby" <tonyb@cybernetics.com>
To: linux-scsi@vger.kernel.org
Subject: ide-scsi cmd_per_lun
Date: Tue, 9 Jul 2002 17:18:31 -0400 [thread overview]
Message-ID: <000701c2278e$2dc723a0$e0019d89@cybernetics.com> (raw)
I have encountered another problem with ide-scsi. My userspace program has
the sg device for an IDE tape drive open multiple times so that it can have
multiple outstanding commands. The tape drive itself (like most tape
drives) does not support multiple outstanding commands. The driver should
send the commands one at a time to the drive; having multiple outstanding
commands is merely a convenience for my program.
Let me use a concrete example to illustrate the problem. I have /dev/sg0
open twice, yielding two file descriptors. To the first file descriptor I
send a read(6) command, and then to the second file descriptor I send a test
unit ready command. The ide-scsi driver sends the read command, which after
a several second medium access delay, returns CHECK CONDITION because of an
ILI (incorrect block size). Next the ide-scsi driver sends the test unit
ready command. Finally, the ide-scsi driver sends a request sense command
to recover the sense data from the read command's CHECK CONDITION. This
obviously doesn't work as intended, since the test unit ready command has
reset the sense data.
The problem boils down to the fact that ide-scsi relies on the mid-level
(old eh) to do the auto-sense. I was able to work around this problem by
setting cmd_per_lun: 1 in ide-scsi.h (vanilla 2.4.17). Doing this caused
the request sense command to make it to the drive before any other command
could sneak in and reset the sense data. Can anyone tell me if this is a
good solution? Looking at the 2.4.19-rc1 source, I see an additional field
"can_queue: 10" in the template. Should this be changed too? I cannot use
2.4.19 for the moment, so I can't experiment with it.
Thanks,
Anthony J. Battersby
Cybernetics
next reply other threads:[~2002-07-09 21:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-09 21:18 Tony Battersby [this message]
2002-07-09 22:00 ` ide-scsi cmd_per_lun Doug Ledford
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='000701c2278e$2dc723a0$e0019d89@cybernetics.com' \
--to=tonyb@cybernetics.com \
--cc=linux-scsi@vger.kernel.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