diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-08-21 16:14:14 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-08-29 10:19:11 -0400 |
commit | 01b291bd66564b4bd826326af6bd0b6d17e99439 (patch) | |
tree | 89ba1f339a68827c1ea0e434629759a9252b0a69 | |
parent | bb0003c1e189d5766b6b39299b08c690c985c4dc (diff) |
[SCSI] fix check of PQ and PDT bits for WLUNs
For IBM z series certain LUNs can no longer be accessed.
This is because kernel version 2.6.19 a check was introduced not to
create a generic SCSI device for devices that return PQ=1 and
PDT=0x1f. For WLUNs (see SAM-3, p. 41ff) generic SCSI devices should
be created unconditionally without looking at the PQ bit, so add a
check for WLUNs in with this test.
Acked-by: Martin Petermann <martin@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | drivers/scsi/scsi_scan.c | 3 | ||||
-rw-r--r-- | include/scsi/scsi.h | 14 |
2 files changed, 16 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 84b4879cff11..34d0de6cd511 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -1080,7 +1080,8 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget, | |||
1080 | * PDT=1Fh none (no FDD connected to the requested logical unit) | 1080 | * PDT=1Fh none (no FDD connected to the requested logical unit) |
1081 | */ | 1081 | */ |
1082 | if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) && | 1082 | if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) && |
1083 | (result[0] & 0x1f) == 0x1f) { | 1083 | (result[0] & 0x1f) == 0x1f && |
1084 | !scsi_is_wlun(lun)) { | ||
1084 | SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO | 1085 | SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO |
1085 | "scsi scan: peripheral device type" | 1086 | "scsi scan: peripheral device type" |
1086 | " of 31, no device added\n")); | 1087 | " of 31, no device added\n")); |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 5c40cc537d4c..192f8716aa9e 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -309,6 +309,20 @@ struct scsi_lun { | |||
309 | }; | 309 | }; |
310 | 310 | ||
311 | /* | 311 | /* |
312 | * The Well Known LUNS (SAM-3) in our int representation of a LUN | ||
313 | */ | ||
314 | #define SCSI_W_LUN_BASE 0xc100 | ||
315 | #define SCSI_W_LUN_REPORT_LUNS (SCSI_W_LUN_BASE + 1) | ||
316 | #define SCSI_W_LUN_ACCESS_CONTROL (SCSI_W_LUN_BASE + 2) | ||
317 | #define SCSI_W_LUN_TARGET_LOG_PAGE (SCSI_W_LUN_BASE + 3) | ||
318 | |||
319 | static inline int scsi_is_wlun(unsigned int lun) | ||
320 | { | ||
321 | return (lun & 0xff00) == SCSI_W_LUN_BASE; | ||
322 | } | ||
323 | |||
324 | |||
325 | /* | ||
312 | * MESSAGE CODES | 326 | * MESSAGE CODES |
313 | */ | 327 | */ |
314 | 328 | ||