diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2006-12-13 11:10:40 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-01-06 09:56:58 -0500 |
commit | ddaf6fc85459d161c39a70a2cf9e04343dafe47f (patch) | |
tree | 6f5a5aaaef7a9cea94feb5c60e7791408245b0d4 /drivers/scsi/scsi_scan.c | |
parent | 03c1c39680f949e0a944d540949b2d3d6887cdc0 (diff) |
[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/scsi_scan.c')
-rw-r--r-- | drivers/scsi/scsi_scan.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 13228312fc4d..b83d03c4deef 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, | |||
742 | sdev->no_uld_attach = 1; | 742 | sdev->no_uld_attach = 1; |
743 | 743 | ||
744 | switch (sdev->type = (inq_result[0] & 0x1f)) { | 744 | switch (sdev->type = (inq_result[0] & 0x1f)) { |
745 | case TYPE_RBC: | ||
746 | /* RBC devices can return SCSI-3 compliance and yet | ||
747 | * still not support REPORT LUNS, so make them act as | ||
748 | * BLIST_NOREPORTLUN unless BLIST_REPORTLUN2 is | ||
749 | * specifically set */ | ||
750 | if ((*bflags & BLIST_REPORTLUN2) == 0) | ||
751 | *bflags |= BLIST_NOREPORTLUN; | ||
752 | /* fall through */ | ||
745 | case TYPE_TAPE: | 753 | case TYPE_TAPE: |
746 | case TYPE_DISK: | 754 | case TYPE_DISK: |
747 | case TYPE_PRINTER: | 755 | case TYPE_PRINTER: |
@@ -752,11 +760,17 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, | |||
752 | case TYPE_ENCLOSURE: | 760 | case TYPE_ENCLOSURE: |
753 | case TYPE_COMM: | 761 | case TYPE_COMM: |
754 | case TYPE_RAID: | 762 | case TYPE_RAID: |
755 | case TYPE_RBC: | ||
756 | sdev->writeable = 1; | 763 | sdev->writeable = 1; |
757 | break; | 764 | break; |
758 | case TYPE_WORM: | ||
759 | case TYPE_ROM: | 765 | case TYPE_ROM: |
766 | /* MMC devices can return SCSI-3 compliance and yet | ||
767 | * still not support REPORT LUNS, so make them act as | ||
768 | * BLIST_NOREPORTLUN unless BLIST_REPORTLUN2 is | ||
769 | * specifically set */ | ||
770 | if ((*bflags & BLIST_REPORTLUN2) == 0) | ||
771 | *bflags |= BLIST_NOREPORTLUN; | ||
772 | /* fall through */ | ||
773 | case TYPE_WORM: | ||
760 | sdev->writeable = 0; | 774 | sdev->writeable = 0; |
761 | break; | 775 | break; |
762 | default: | 776 | default: |