From a468bf60bf828218741838e73e42ba50ac0b47f2 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Fri, 31 Mar 2006 20:07:45 -0600 Subject: [PATCH] --- yaml --- r: 25820 b: refs/heads/master c: 4d7db04a7a69099accd84984a78c64d2178252f1 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/scsi/scsi.c | 3 ++- trunk/drivers/scsi/scsi_devinfo.c | 4 +++- trunk/drivers/scsi/scsi_scan.c | 19 +++++++++++++++---- trunk/include/scsi/scsi_devinfo.h | 1 + 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 6246b661b5e6..4f576df7937d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d637c4543fdc86cbef5805c679d24bb665172a7d +refs/heads/master: 4d7db04a7a69099accd84984a78c64d2178252f1 diff --git a/trunk/drivers/scsi/scsi.c b/trunk/drivers/scsi/scsi.c index 32979fee6186..73994e2ac2cb 100644 --- a/trunk/drivers/scsi/scsi.c +++ b/trunk/drivers/scsi/scsi.c @@ -565,7 +565,8 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd) /* * If SCSI-2 or lower, store the LUN value in cmnd. */ - if (cmd->device->scsi_level <= SCSI_2) { + if (cmd->device->scsi_level <= SCSI_2 && + cmd->device->scsi_level != SCSI_UNKNOWN) { cmd->cmnd[1] = (cmd->cmnd[1] & 0x1f) | (cmd->device->lun << 5 & 0xe0); } diff --git a/trunk/drivers/scsi/scsi_devinfo.c b/trunk/drivers/scsi/scsi_devinfo.c index 84c3937ae8fb..c750d3399a97 100644 --- a/trunk/drivers/scsi/scsi_devinfo.c +++ b/trunk/drivers/scsi/scsi_devinfo.c @@ -132,7 +132,9 @@ static struct { {"CMD", "CRA-7280", NULL, BLIST_SPARSELUN}, /* CMD RAID Controller */ {"CNSI", "G7324", NULL, BLIST_SPARSELUN}, /* Chaparral G7324 RAID */ {"CNSi", "G8324", NULL, BLIST_SPARSELUN}, /* Chaparral G8324 RAID */ - {"COMPAQ", "LOGICAL VOLUME", NULL, BLIST_FORCELUN}, + {"COMPAQ", "ARRAY CONTROLLER", NULL, BLIST_SPARSELUN | BLIST_LARGELUN | + BLIST_MAX_512 | BLIST_REPORTLUN2}, /* Compaq RA4x00 */ + {"COMPAQ", "LOGICAL VOLUME", NULL, BLIST_FORCELUN | BLIST_MAX_512}, /* Compaq RA4x00 */ {"COMPAQ", "CR3500", NULL, BLIST_FORCELUN}, {"COMPAQ", "MSA1000", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD}, {"COMPAQ", "MSA1000 VOLUME", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD}, diff --git a/trunk/drivers/scsi/scsi_scan.c b/trunk/drivers/scsi/scsi_scan.c index f14945996ede..1a5474bd11a1 100644 --- a/trunk/drivers/scsi/scsi_scan.c +++ b/trunk/drivers/scsi/scsi_scan.c @@ -673,6 +673,7 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags) case TYPE_MEDIUM_CHANGER: case TYPE_ENCLOSURE: case TYPE_COMM: + case TYPE_RAID: case TYPE_RBC: sdev->writeable = 1; break; @@ -737,6 +738,13 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags) if (*bflags & BLIST_SELECT_NO_ATN) sdev->select_no_atn = 1; + /* + * Maximum 512 sector transfer length + * broken RA4x00 Compaq Disk Array + */ + if (*bflags & BLIST_MAX_512) + blk_queue_max_sectors(sdev->request_queue, 512); + /* * Some devices may not want to have a start command automatically * issued when a device is added. @@ -1123,10 +1131,13 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags, * Also allow SCSI-2 if BLIST_REPORTLUN2 is set and host adapter does * 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)) ) + 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; if (bflags & BLIST_NOLUN) return 0; diff --git a/trunk/include/scsi/scsi_devinfo.h b/trunk/include/scsi/scsi_devinfo.h index 174101b2069b..d31b16d25a09 100644 --- a/trunk/include/scsi/scsi_devinfo.h +++ b/trunk/include/scsi/scsi_devinfo.h @@ -28,4 +28,5 @@ #define BLIST_NO_ULD_ATTACH 0x100000 /* device is actually for RAID config */ #define BLIST_SELECT_NO_ATN 0x200000 /* select without ATN */ #define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */ +#define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */ #endif