linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Mansfield <patmans@us.ibm.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Jens Axboe <axboe@suse.de>,
	James Bottomley <James.Bottomley@SteelEye.com>,
	SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: Device flags: use_10_for_rw and use_10_for_ms
Date: Tue, 29 Nov 2005 14:48:35 -0800	[thread overview]
Message-ID: <20051129224835.GA7505@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0511291616470.18319-100000@iolanthe.rowland.org>

On Tue, Nov 29, 2005 at 04:23:16PM -0500, Alan Stern wrote:

Alan -

Looking at the full log (with no patches) and your earlier patch, I'm
confused by two things.

First, the READ_10 command being sent after we get the ILLEGAL REQUEST.

Do you know how that READ_10 is sent? Is the upper layer add_disk() check
partition code retrying? Then I'd expect a READ_6. If it were already
prepped, I guess we can get another READ_10, but I thought that the
partition read/check code only issued one read at a time.

The scsi_check_sense() should not be allowing the retry, we have a "return
SUCCESS" there. If we did want to retry via scmd->retries, we might be
able to add code into scis_check_sense().

And:

How can the current scsi_lib.c scsi_io_completion() *ever* requeue after
an sd.c read/write has turned off use_10_for_rw in sd_rw_intr()?

That is, sd.c sd_rw_intr() gets ILLEGAL REQUEST, and clears use_10_for_rw,
this snippet:

		case ILLEGAL_REQUEST:
			if (SCpnt->device->use_10_for_rw &&
			    (SCpnt->cmnd[0] == READ_10 ||
			     SCpnt->cmnd[0] == WRITE_10))
				SCpnt->device->use_10_for_rw = 0;

Then it calls scsi_io_completion(), where we only requeue if use_10_for_rw
is still set, so we never requeue via this code path. That is why without
your patch we get an error output. Correct?!

So with the patch you posted earlier, all it does (in scsi_io_completion())
is set use_10_for_rw back to 1, and then requeue the IO.

If you remove (or move) that sd.c code, it seems you'll hit this, and
figure that you do not want to switch from 6 to 10 byte commands (and
perhaps back) at all.

Then we need a method so we don't switch: another bit or state set after
a successful read or write command (and I guess one for succesful mode
sense command). 

We need only check the do-not-switch flag if we get an ILLEGAL REQUEST. We
already have to check use_10_for_rw before every read or write request.

-- Patrick Mansfield

  reply	other threads:[~2005-11-29 22:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-28 21:43 Device flags: use_10_for_rw and use_10_for_ms Alan Stern
2005-11-29 20:03 ` Jens Axboe
2005-11-29 21:23   ` Alan Stern
2005-11-29 22:48     ` Patrick Mansfield [this message]
2005-11-30 15:46       ` Alan Stern
2005-11-30  8:08     ` Jens Axboe
2005-11-30 14:46       ` James Bottomley
2005-11-30 14:51         ` Jens Axboe

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=20051129224835.GA7505@us.ibm.com \
    --to=patmans@us.ibm.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=axboe@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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).