From: Matthew Wilcox <matthew@wil.cx>
To: Ingo Flaschberger <if@xip.at>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
Linux-SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: Compaq Fiber Channel Array RM4000 / 2.6.16 kernel patch
Date: Thu, 30 Mar 2006 05:58:16 -0700 [thread overview]
Message-ID: <20060330125816.GG13590@parisc-linux.org> (raw)
In-Reply-To: <Pine.GSO.4.64.0603301252100.595@filebunker.xip.at>
On Thu, Mar 30, 2006 at 12:53:10PM +0200, Ingo Flaschberger wrote:
> * out_of_space hacks, D. Gilbert (dpg) 990608
> + *
> + * Added Compaq RA4x00 Fiber Channel Array support, 29.03.2006
> + * crossip communications gmbh - Ingo Flaschberger <if@xip.at>
> + *
> */
I think you can drop the changelog entry here -- it's not been updated
in many years. Plus, it's not really accurate.
> {"CNSi", "G8324", NULL, BLIST_SPARSELUN}, /* Chaparral G8324 RAID */
> + {"COMPAQ", "ARRAY CONTROLLER", "2.60", BLIST_SPARSELUN | BLIST_LARGELUN |
> + BLIST_MAX_512K}, /* Compaq RA4x00 */
> + {"COMPAQ", "LOGICAL VOLUME", "2.60", BLIST_MAX_512K}, /* Compaq RA4x00 */
> {"COMPAQ", "LOGICAL VOLUME", NULL, BLIST_FORCELUN},
I wonder if you should just be adding BLIST_MAX_512K to the current
entry for LOGICAL VOLUME instead?
> * or a LUN is seen that cannot have a device attached to it.
> + *
> + * Modification history:
> + * - Added Compaq RA4x00 Fiber Channel Array support, 29.03.2006
> + * crossip communications gmbh - Ingo Flaschberger <if@xip.at>
> + *
> */
Definitely don't start a changelog. That's what SCMs are for.
> @@ -715,6 +721,14 @@
> if (*bflags & BLIST_SELECT_NO_ATN)
> sdev->select_no_atn = 1;
>
> + /*
> + * Maximum 512K cdb transfer length
> + * broken RA4x00 Compaq Disk Array
> + */
> + if (*bflags & BLIST_MAX_512K) {
> + sdev->max_512k = 1;
> + }
> +
Indent with tabs, not spaces. Also, sdev->max_512k is a bit ...
specific. How about adding an unsigned short to struct scsi_device
(right above queue_depth, so it fits in the padding) called something
like max_xfer_len? Then you can do something like:
sdev->max_xfer_len = 0xffff;
if (*bflags & BLIST_MAX_512K)
sdev->max_xfer_len = 0x200;
and later:
> @@ -344,8 +346,14 @@
> SCpnt->cmnd[14] = SCpnt->cmnd[15] = 0;
> } else if ((this_count > 0xff) || (block > 0x1fffff) ||
> SCpnt->device->use_10_for_rw) {
> - if (this_count > 0xffff)
> - this_count = 0xffff;
> + if (SCpnt->device->max_512k) {
> + if (this_count > 0x200) {
> + this_count = 0x200;
> + }
> + } else {
> + if (this_count > 0xffff)
> + this_count = 0xffff;
> + }
>
> SCpnt->cmnd[0] += READ_10 - READ_6;
> SCpnt->cmnd[1] |= blk_fua_rq(rq) ? 0x8 : 0;
simplifies to:
if (this_count > SCpnt->device->max_xfer_len)
this_count = SCpnt->device->max_xfer_len;
> @@ -1089,9 +1103,12 @@
> * support more than 8 LUNs.
> */
> if ((bflags & BLIST_NOREPORTLUN) ||
> - starget->scsi_level < SCSI_2 ||
> - (starget->scsi_level < SCSI_3 &&
> - (!(bflags & BLIST_REPORTLUN2) || shost->max_lun <= 8)) )
> + ((starget->scsi_level < SCSI_2) &&
> + (starget->scsi_level != SCSI_UNKNOWN)) ||
> + (starget->scsi_level < SCSI_3 &&
> + ((!(bflags & BLIST_REPORTLUN2) &&
> + (starget->scsi_level != SCSI_UNKNOWN)) ||
> + shost->max_lun <= 8)) )
> return 1;
That conditional makes my brain hurt. Can we split it up?
if ((bflags & BLIST_NOREPORTLUN)
return 1;
if ((starget->scsi_level < SCSI_2) &&
(starget->scsi_level != SCSI_UNKNOWN))
return 1;
if ((starget->scsi_level < SCSI_3) &&
((!(bflags & BLIST_REPORTLUN2) &&
(starget->scsi_level != SCSI_UNKNOWN) ||
shost->max_lun <= 8)))
return 1;
I'm not sure that's what you meant to do, even. How about more simply:
/*
* Only support SCSI-3 and up devices if BLIST_NOREPORTLUN is not set.
* Also allow SCSI-2 and unknown devices if BLIST_REPORTLUN2 is set
* and host adapter supports more than 8 LUNs.
*/
if ((bflags & BLIST_NOREPORTLUN)
return 1;
if ((starget->scsi_level < SCSI_2) &&
(starget->scsi_level != SCSI_UNKNOWN))
return 1;
if ((starget->scsi_level < SCSI_3) &&
(!(bflags & BLIST_REPORTLUN2) || shost->max_lun <= 8))
return 1;
next prev parent reply other threads:[~2006-03-30 12:58 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-24 23:55 Compaq Fiber Channel Array RM4000 / Scsi middle ware driver Ingo Flaschberger
2006-02-28 0:23 ` Ingo Flaschberger
2006-02-28 0:32 ` Ingo Flaschberger
2006-02-28 0:40 ` Matthew Wilcox
2006-03-22 18:17 ` Ingo Flaschberger
2006-03-22 18:41 ` Martin K. Petersen
2006-03-22 19:58 ` Ingo Flaschberger
2006-03-22 20:02 ` Matthew Wilcox
2006-03-22 20:13 ` Ingo Flaschberger
2006-03-28 19:43 ` Compaq Fiber Channel Array RM4000 / SCSI Problems / Need HELP! Ingo Flaschberger
2006-03-29 6:07 ` Martin K. Petersen
2006-03-29 11:17 ` Ingo Flaschberger
2006-03-29 13:10 ` Compaq Fiber Channel Array RM4000 / Kernel implementation Ingo Flaschberger
2006-03-29 13:19 ` typo in scsi_devinfo.h Ingo Flaschberger
2006-03-29 13:43 ` Matthew Wilcox
2006-03-29 15:07 ` Compaq Fiber Channel Array RM4000 / Kernel implementation Christoph Hellwig
2006-03-29 16:47 ` Compaq Fiber Channel Array RM4000 / 2.6.16 kernel patch Ingo Flaschberger
2006-03-29 17:29 ` James Bottomley
2006-03-29 17:53 ` Ingo Flaschberger
2006-03-29 18:22 ` James Bottomley
2006-03-29 18:35 ` Ingo Flaschberger
2006-03-29 18:43 ` James Bottomley
2006-03-29 18:54 ` Ingo Flaschberger
2006-03-29 19:03 ` James Bottomley
2006-03-29 20:23 ` Ingo Flaschberger
2006-03-29 21:11 ` James Bottomley
2006-03-30 10:53 ` Ingo Flaschberger
2006-03-30 12:58 ` Matthew Wilcox [this message]
2006-03-30 14:20 ` Ingo Flaschberger
2006-03-30 14:46 ` James Bottomley
2006-03-30 15:04 ` Ingo Flaschberger
2006-03-30 15:09 ` James Bottomley
2006-03-30 15:54 ` Ingo Flaschberger
2006-03-30 16:13 ` Patrick Mansfield
2006-03-30 16:25 ` Ingo Flaschberger
2006-03-30 16:24 ` Matthew Wilcox
2006-03-30 16:35 ` Compaq Fiber Channel Array RM4000 / 2.6.16 kernel patch VER6 Ingo Flaschberger
2006-03-31 17:36 ` Ingo Flaschberger
2006-03-31 19:45 ` James Bottomley
2006-03-31 21:13 ` Ingo Flaschberger
2006-03-31 21:21 ` James Bottomley
2006-03-31 21:24 ` Ingo Flaschberger
2006-04-01 1:16 ` Ingo Flaschberger
2006-04-01 2:07 ` James Bottomley
2006-04-01 16:46 ` Ingo Flaschberger
2006-04-06 11:21 ` Compaq Fiber Channel Array RM4000 / 2.6.16 kernel patch VER7 Ingo Flaschberger
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=20060330125816.GG13590@parisc-linux.org \
--to=matthew@wil.cx \
--cc=James.Bottomley@SteelEye.com \
--cc=if@xip.at \
--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;
as well as URLs for NNTP newsgroup(s).