diff options
author | dave wysochanski <davidw@netapp.com> | 2006-08-09 14:56:32 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-08-19 16:37:40 -0400 |
commit | 84961f28e9d13a4b193d0c8545f3c060c1890ff3 (patch) | |
tree | 11ad36484d5a891a2455d876dfd9cf6fd82f51f3 /drivers/scsi | |
parent | 8c867b257d159ca04602d7087fa29f846785f9ea (diff) |
[SCSI] Don't add scsi_device for devices that return PQ=1, PDT=0x1f
Some targets may return slight variations of PQ and PDT to indicate
no LUN mapped. USB UFI setting PDT=0x1f but having reserved bits for
PQ is one example, and NetApp targets returning PQ=1 and PDT=0x1f is
another. Both instances seem like reasonable responses according to
SPC-3 and UFI specs.
The current scsi_probe_and_add_lun() code adds a scsi_device
for targets that return PQ=1 and PDT=0x1f. This causes LUNs of type
"UNKNOWN" to show up in /proc/scsi/scsi when no LUNs are mapped.
In addition, subsequent rescans fail to recognize LUNs that may be
added on the target, unless preceded by a write to the delete attribute
of the "UNKNOWN" LUN.
This patch addresses this problem by skipping over the scsi_add_lun()
when PQ=1,PDT=0x1f is encountered, and just returns
SCSI_SCAN_TARGET_PRESENT.
Signed-off-by: Dave Wysochanski <davidw@netapp.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/scsi_scan.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 114e2067dce5..a24d3461fc78 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -893,11 +893,26 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget, | |||
893 | } | 893 | } |
894 | 894 | ||
895 | /* | 895 | /* |
896 | * Non-standard SCSI targets may set the PDT to 0x1f (unknown or | 896 | * Some targets may set slight variations of PQ and PDT to signal |
897 | * no device type) instead of using the Peripheral Qualifier to | 897 | * that no LUN is present, so don't add sdev in these cases. |
898 | * indicate that no LUN is present. For example, USB UFI does this. | 898 | * Two specific examples are: |
899 | * 1) NetApp targets: return PQ=1, PDT=0x1f | ||
900 | * 2) USB UFI: returns PDT=0x1f, with the PQ bits being "reserved" | ||
901 | * in the UFI 1.0 spec (we cannot rely on reserved bits). | ||
902 | * | ||
903 | * References: | ||
904 | * 1) SCSI SPC-3, pp. 145-146 | ||
905 | * PQ=1: "A peripheral device having the specified peripheral | ||
906 | * device type is not connected to this logical unit. However, the | ||
907 | * device server is capable of supporting the specified peripheral | ||
908 | * device type on this logical unit." | ||
909 | * PDT=0x1f: "Unknown or no device type" | ||
910 | * 2) USB UFI 1.0, p. 20 | ||
911 | * PDT=00h Direct-access device (floppy) | ||
912 | * PDT=1Fh none (no FDD connected to the requested logical unit) | ||
899 | */ | 913 | */ |
900 | if (starget->pdt_1f_for_no_lun && (result[0] & 0x1f) == 0x1f) { | 914 | if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) && |
915 | (result[0] & 0x1f) == 0x1f) { | ||
901 | SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO | 916 | SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO |
902 | "scsi scan: peripheral device type" | 917 | "scsi scan: peripheral device type" |
903 | " of 31, no device added\n")); | 918 | " of 31, no device added\n")); |