From: Patrick Mansfield <patmans@us.ibm.com>
To: Hannes Reinecke <hare@suse.de>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
Christoph Hellwig <hch@infradead.org>,
SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] Sanitize PQ3 device handling (Take #2)
Date: Fri, 20 May 2005 14:40:30 -0700 [thread overview]
Message-ID: <20050520214030.GA8925@us.ibm.com> (raw)
In-Reply-To: <428CA4E3.9030601@suse.de>
On Thu, May 19, 2005 at 04:38:27PM +0200, Hannes Reinecke wrote:
> Hi James,
>
> this is an updated version of the patch. As I suspected, the issue isn't
> quite as easy. Problem is that older SCSI-2 device have the habit for
> responding to LUN1 in addition to LUN0, even though only one device is
> attached. LUN1 has set PQ to 3 accordingly.
> And of course we _don't_ want those fake devices to stick around.
> So I've improved the logic to not register devices with LUN != 0 and a
> PQ of 1 or 3. All other devices are registered accordingly.
>
> I can't really see why we should register devices with PQ 1 and LUN !=
> 0; if one wants to have them he still can do a REPORT LUN on LUN 0 and
> an explicit scan for the missing device.
>
> And I do think the locking is slightly wrong for the failure case;
> without this adaptecs have a habit of crashing when doing a rmmod.
Is that what the extra put's are fixing? That should be a separate patch.
> But again, comments etc are welcome.
I had a similar patch, that did not leave LUN 0 configured:
http://marc.theaimsgroup.com/?l=linux-scsi&m=110297733824960&w=2
It did not change handling of PQ.
I don't have a strong opinion for either direction, but having LUN 0 with
and sometimes without an sd there bothers me. Pick your poison ...
Long term, a way to access any LUN on a target from user space would be
very useful, not just LUN 0.
And ...
> --- linux-2.6.12-rc4/drivers/scsi/scsi_scan.c.orig 2005-05-19 15:57:51.000000000 +0200
> +++ linux-2.6.12-rc4/drivers/scsi/scsi_scan.c 2005-05-19 16:18:26.000000000 +0200
> @@ -64,15 +64,15 @@
> * SCSI_SCAN_NO_RESPONSE: no valid response received from the target, this
> * includes allocation or general failures preventing IO from being sent.
> *
> - * SCSI_SCAN_TARGET_PRESENT: target responded, but no device is available
> - * on the given LUN.
> + * SCSI_SCAN_TARGET_IGNORED: target responded, but is ignored from the
> + * midlayer
> *
> - * SCSI_SCAN_LUN_PRESENT: target responded, and a device is available on a
> - * given LUN.
> + * SCSI_SCAN_TARGET_PRESENT: target responded, and is registered with the
> + * midlayer
> */
> #define SCSI_SCAN_NO_RESPONSE 0
> -#define SCSI_SCAN_TARGET_PRESENT 1
> -#define SCSI_SCAN_LUN_PRESENT 2
> +#define SCSI_SCAN_TARGET_IGNORED 1
> +#define SCSI_SCAN_TARGET_PRESENT 2
I prefer naming with all LUN in all the defines since we are returning LUN
status, or leave as is. For SCSI_SCAN_TARGET_IGNORED, we are not
configuring the LUN.
i.e. keep the original:
#define SCSI_SCAN_NO_RESPONSE 0
#define SCSI_SCAN_TARGET_PRESENT 1
#define SCSI_SCAN_LUN_PRESENT 2
Or:
#define SCSI_SCAN_NO_RESPONSE 0
#define SCSI_SCAN_LUN_IGNORED 1
#define SCSI_SCAN_LUN_PRESENT 2
You should add code to not print the "unknown device type" if PQ 3 or 1,
or special case type 31 (0x1f).
SCSI spec says for PQ of 011 (3):
The device server is not capable of supporting a peripheral device
on this logical unit. For this peripheral qualifier the
peripheral device type shall be set to 1Fh to provide
compatibility with previous versions of SCSI.
We see the warnings now even for PQ of 1 (I don't know the age of these
devices):
scsi: unknown device type 31
Vendor: IBM Model: 5703001 Rev: 0150
Type: Unknown ANSI SCSI revision: 00
For PQ of 3 there should be a lot more.
-- Patrick Mansfield
next prev parent reply other threads:[~2005-05-20 21:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-19 14:38 [PATCH] Sanitize PQ3 device handling (Take #2) Hannes Reinecke
2005-05-20 21:40 ` Patrick Mansfield [this message]
2005-05-24 8:24 ` Hannes Reinecke
2005-06-10 21:52 ` James Bottomley
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=20050520214030.GA8925@us.ibm.com \
--to=patmans@us.ibm.com \
--cc=James.Bottomley@SteelEye.com \
--cc=hare@suse.de \
--cc=hch@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox