All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rob Turk" <r.turk@chello.nl>
To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MODE SENSE in sd.c; sddr09.c
Date: Mon, 2 Sep 2002 13:00:39 +0200	[thread overview]
Message-ID: <akvg26$7nt$1@ncc1701.cistron.net> (raw)
In-Reply-To: UTC200209020041.g820fGS22828.aeb@smtp.cwi.nl

<Andries.Brouwer@cwi.nl> wrote in message
news:cistron.UTC200209020041.g820fGS22828.aeb@smtp.cwi.nl...
> In sd.c we call MODE SENSE (6) in order to find out whether the
> device is write protected. The info we need is in byte 2, the
> header of the MODE SENSE answer, but in the request we have to
> specify (i) what page(s) we want, and (ii) how many bytes we want.
>
> Long ago we asked for 12 bytes from page 1 (Daniel Roche, 1.3.35).
> Matthew Dharm made this 8 bytes from page 3F (all pages),
patch-2.4.0-test8.
> In patch-2.4.10 the 8 was increased to 255.
>
> I found on the one hand devices that only react to page 0
> (the vendor page), and return an error for page 3F.
> And on the other hand devices that are unable to handle requests
> for more bytes than they actually have.
>
> So, it seems that the cautious way to ask for MODE SENSE data is
> to first ask for the header only, see how much is available,
> and then ask for everything.
>
> The patch below first separates out the MODE SENSE call,
> and then tries it three times: on all pages (3F), only the first
> four bytes; on the vendor page (0), only the first four bytes;
> on all pages (3F), 255 bytes.
>

Andries,

Would it be possible to move away from using 'standard' 255 bytes? Many SCSI
device don't like requests for odd byte counts on 16-bit SCSI busses, and
IDE isn't too crazy about it either. How about asking for 254 instead??

Rob





  reply	other threads:[~2002-09-02 11:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-02  0:41 [PATCH] MODE SENSE in sd.c; sddr09.c Andries.Brouwer
2002-09-02 11:00 ` Rob Turk [this message]
2002-09-02 12:38   ` Andries Brouwer

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='akvg26$7nt$1@ncc1701.cistron.net' \
    --to=r.turk@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.