summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2006-12-13 10:10:40 -0600
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-01-06 08:56:58 -0600
commitddaf6fc85459d161c39a70a2cf9e04343dafe47f (patch)
tree6f5a5aaaef7a9cea94feb5c60e7791408245b0d4 /drivers/scsi
parent03c1c39680f949e0a944d540949b2d3d6887cdc0 (diff)
downloadop-kernel-dev-ddaf6fc85459d161c39a70a2cf9e04343dafe47f.zip
op-kernel-dev-ddaf6fc85459d161c39a70a2cf9e04343dafe47f.tar.gz
[SCSI] scsi_scan: fix report lun problems with CDROM or RBC devices
Apparently no ATAPI CD/DVD actually supports REPORT LUNS (in spite of claiming scsi-3 compliance, where it's mandatory) and worse, some crash or flake out on being sent the command. This may actually be due to a conflict between SPC and MMC with MMC not listing REPORT LUNS as mandatory. The same standards conflict exists for RBC as well. Fix all of this by reversing the blacklists for CDROM and RBC devices (i.e. now they have to have the BLIST_REPORTLUNS2 flag set even if the inquiry data returns scsi-3 compliance). Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi_scan.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 13228312..b83d03c 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -742,6 +742,14 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
sdev->no_uld_attach = 1;
switch (sdev->type = (inq_result[0] & 0x1f)) {
+ case TYPE_RBC:
+ /* RBC devices can return SCSI-3 compliance and yet
+ * still not support REPORT LUNS, so make them act as
+ * BLIST_NOREPORTLUN unless BLIST_REPORTLUN2 is
+ * specifically set */
+ if ((*bflags & BLIST_REPORTLUN2) == 0)
+ *bflags |= BLIST_NOREPORTLUN;
+ /* fall through */
case TYPE_TAPE:
case TYPE_DISK:
case TYPE_PRINTER:
@@ -752,11 +760,17 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
case TYPE_ENCLOSURE:
case TYPE_COMM:
case TYPE_RAID:
- case TYPE_RBC:
sdev->writeable = 1;
break;
- case TYPE_WORM:
case TYPE_ROM:
+ /* MMC devices can return SCSI-3 compliance and yet
+ * still not support REPORT LUNS, so make them act as
+ * BLIST_NOREPORTLUN unless BLIST_REPORTLUN2 is
+ * specifically set */
+ if ((*bflags & BLIST_REPORTLUN2) == 0)
+ *bflags |= BLIST_NOREPORTLUN;
+ /* fall through */
+ case TYPE_WORM:
sdev->writeable = 0;
break;
default:
OpenPOWER on IntegriCloud