From: Pat LaVarre <p.lavarre@ieee.org>
To: patmans@us.ibm.com
Cc: stern@rowland.harvard.edu, ronald@kuetemeier.com,
linux-scsi@vger.kernel.org, usb-storage@one-eyed-alien.net,
james.bottomley@steeleye.com
Subject: Re: [PATCH/RFT] mode sense madness always use page 8
Date: 03 Nov 2003 14:40:03 -0700 [thread overview]
Message-ID: <1067895603.2303.42.camel@patrh9> (raw)
In-Reply-To: <1067632701.5742.45.camel@patrh9>
> > per Pat L's comment, should we decrement the
> > len by four if going from MODE SENSE 10 to
> > MODE SENSE? Or request four more bytes than
> > required?
Hang on a minute. I began to write this patch but I stumbled. I now
think I see:
We either need more complex rounding or no rounding at all?
Any votes for no rounding at all?
How about we add a parm to __scsi_mode_sense so that we specify one byte
length for our default of op x5A MODE_SENSE_10 and another length for
the choice of op x1A MODE_SENSE?
I argue as follows:
255 is xFF.
Op x5A MODE_SENSE_10 for xFF bytes makes no sense.
If we want max, then max is xFFFF for op x5A, not xFF as it was for op
x1A MODE_SENSE. If we want as many page bytes as in op x1A MODE_SENSE,
then because the header grew four bytes, x103 gives us that, not xFF.
> Tell me again what we think __scsi_mode_sense does?
Again I am grepping in 2.6.0-test9 drivers/scsi/ and leaping to
conclusions without having injected drive errors and collecting traces.
Into sd_read_cache_type we have coded only the t10 fiction that we can
fetch a header and it encodes the available length of bytes as an
additional length:
const int dbd = 0; ...
const int modepage = 0x08; ...
res = sd_do_mode_sense(SRpnt, dbd, modepage, buffer, 4, &data);
res = sd_do_mode_sense(SRpnt, dbd, modepage, buffer, len, &data);
In sd_read_write_protect_flag we try that t10 fiction first for page
x3F, then page x00, then we instead we try xFF, which is max only if the
op happens to be x1A MODE_SENSE and not x5A MODE_SENSE_10:
res = sd_do_mode_sense(SRpnt, 0, 0x3F, buffer, 4, &data);
res = sd_do_mode_sense(SRpnt, 0, 0, buffer, 4, &data);
res = sd_do_mode_sense(SRpnt, 0, 0x3F, buffer, 255, &data);
The op x1A MODE_SENSE interpretations of these appear reasonable:
-i 4 -y "1A 00:08:00 04 00"
-i x$len -y "1A 00:08:00 $len 00"
-i 4 -y "1A 00:3F:00 04 00"
-i 4 -y "1A 00:00:00 04 00"
-i xFF -y "1A 00:3F:00 FF 00"
The translation to op x5A MODE_SENSE appears incomplete:
-i 4 -y "5A 00 08:00:00:00 00 00:04 00"
-i x$hi$lo -y "5A 00 08:00:00:00 00 $hi:$lo 00"
-i 4 -y "5A 00 3F:00:00:00 00 00:04 00"
-i 4 -y "5A 00 00:00:00:00 00 00:04 00"
-i xFF -y "5A 00 3F:00:00:00 00 00:FF 00"
In 2.6.0-test9, we round up 4 to 8, but we do not round up xFF to
xFFFF. If per Alan S' comments we dislike rounding up the allocated len
parm of a buffer parm, we could ask for 8 and xFFFF rather than 4 and
xFF, and round down.
But do we ever want to ask for xFFFF? Why???
Tell me again what we think sd_do_mode_sense does?
Pat LaVarre
next prev parent reply other threads:[~2003-11-03 21:40 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1067293080.1075.8.camel@ronald.kuetemeier.com>
[not found] ` <20031027145531.A2130@beaverton.ibm.com>
2003-10-28 3:51 ` [PATCH] SCSI: limit mode sense usage Ronald Kuetemeier
2003-10-28 15:03 ` [usb-storage] " Alan Stern
2003-10-28 15:16 ` Patrick Mansfield
2003-10-28 15:40 ` Alan Stern
2003-10-28 15:55 ` Ronald Kuetemeier
2003-10-28 16:15 ` Ronald Kuetemeier
2003-10-28 19:17 ` Alan Stern
2003-10-28 19:55 ` Ronald Kuetemeier
2003-10-28 20:29 ` Alan Stern
2003-10-28 21:33 ` Ronald Kuetemeier
2003-10-28 22:49 ` Alan Stern
2003-10-28 23:37 ` Pat LaVarre
2003-10-29 1:51 ` Patrick Mansfield
2003-10-29 2:16 ` Ronald Kuetemeier
2003-10-29 7:27 ` Patrick Mansfield
2003-10-29 7:21 ` Patrick Mansfield
2003-10-29 15:16 ` Alan Stern
2003-10-29 16:04 ` Ronald Kuetemeier
2003-10-29 15:09 ` Alan Stern
2003-10-29 15:53 ` Ronald Kuetemeier
2003-10-29 16:30 ` Patrick Mansfield
2003-10-28 15:42 ` Ronald Kuetemeier
2003-10-29 16:46 ` [PATCH/RFT] check non-scsi part of status in scsi_status_is_good Patrick Mansfield
2003-10-29 17:53 ` Ronald Kuetemeier
2003-10-29 23:16 ` Patrick Mansfield
2003-10-30 15:11 ` Alan Stern
2003-10-30 16:35 ` Pat LaVarre
2003-10-30 17:18 ` Patrick Mansfield
2003-10-30 17:38 ` Pat LaVarre
2003-10-30 18:05 ` [PATCH/RFT] mode sense madness always use page 8 Patrick Mansfield
2003-10-30 18:14 ` Ronald Kuetemeier
2003-10-30 18:25 ` Patrick Mansfield
2003-10-30 18:15 ` Pat LaVarre
2003-10-30 18:56 ` Alan Stern
2003-10-30 19:06 ` Pat LaVarre
2003-10-30 20:00 ` Alan Stern
2003-10-31 20:47 ` Pat LaVarre
2003-10-30 19:26 ` Patrick Mansfield
2003-10-31 20:38 ` Pat LaVarre
2003-11-03 21:40 ` Pat LaVarre [this message]
2003-10-30 19:25 ` Ronald Kuetemeier
2003-10-30 19:39 ` Pat LaVarre
2003-10-30 21:48 ` Patrick Mansfield
2003-10-30 21:58 ` Ronald Kuetemeier
2003-10-30 23:59 ` Pat LaVarre
2003-10-31 18:16 ` Patrick Mansfield
2003-10-31 23:11 ` Pat LaVarre
2003-11-06 23:11 ` Douglas Gilbert
2003-11-07 16:13 ` Pat LaVarre
2003-10-28 15:38 ` [PATCH] SCSI: limit mode sense usage Pat LaVarre
2003-10-28 20:56 ` Pat LaVarre
2003-10-28 22:28 ` Alan Stern
2003-10-28 22:54 ` Pat LaVarre
2003-10-29 14:49 ` Alan Stern
2003-10-29 15:43 ` Pat LaVarre
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=1067895603.2303.42.camel@patrh9 \
--to=p.lavarre@ieee.org \
--cc=james.bottomley@steeleye.com \
--cc=linux-scsi@vger.kernel.org \
--cc=patmans@us.ibm.com \
--cc=ronald@kuetemeier.com \
--cc=stern@rowland.harvard.edu \
--cc=usb-storage@one-eyed-alien.net \
/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