aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_scan.c
diff options
context:
space:
mode:
authorKurt Garloff <garloff@suse.de>2006-04-03 09:18:35 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-04-14 14:56:03 -0400
commit6c7154c97e20c0ea28547240dc86731c0cee1b2f (patch)
tree9960dbadf3f685e70c03f0551f0bb890a68b94b7 /drivers/scsi/scsi_scan.c
parent4186ab1973758190916703eb8889ebe8002c5c8f (diff)
[SCSI] Better log messages for PQ3 devs
Some devices report a peripheral qualifier of 3 for LUN 0; with the original code, we would still try a REPORT_LUNS scan (if SCSI level is >= 3 or if we have the BLIST_REPORTLUNS2 passed in), but NOT any sequential scan. Also, the device at LUN 0 (which is not connected according to the PQ) is not registered with the OS. Unfortunately, SANs exist that are SCSI-2 and do NOT support REPORT_LUNS, but report a unknown device with PQ 3 on LUN 0. We still need to scan them, and most probably we even need BLIST_SPARSELUN (and BLIST_LARGELUN). See the bug reference for an infamous example. This patch 2/3: If a PQ3 device is found, log a message that describes the device (INQUIRY DATA and C:B:T:U tuple) and make a suggestion for blacklisting it. Signed-off-by: Kurt Garloff <garloff@suse.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r--drivers/scsi/scsi_scan.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 820c4ad7b581..5603dc6eca47 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -808,6 +808,29 @@ static inline void scsi_destroy_sdev(struct scsi_device *sdev)
808 put_device(&sdev->sdev_gendev); 808 put_device(&sdev->sdev_gendev);
809} 809}
810 810
811/**
812 * scsi_inq_str - print INQUIRY data from min to max index,
813 * strip trailing whitespace
814 * @buf: Output buffer with at least end-first+1 bytes of space
815 * @inq: Inquiry buffer (input)
816 * @first: Offset of string into inq
817 * @end: Index after last character in inq
818 */
819static unsigned char* scsi_inq_str(unsigned char* buf, unsigned char *inq,
820 unsigned first, unsigned end)
821{
822 unsigned term = 0, idx;
823 for (idx = 0; idx+first < end && idx+first < inq[4]+5; ++idx) {
824 if (inq[idx+first] > 0x20) {
825 buf[idx] = inq[idx+first];
826 term = idx+1;
827 } else {
828 buf[idx] = ' ';
829 }
830 }
831 buf[term] = 0;
832 return buf;
833}
811 834
812/** 835/**
813 * scsi_probe_and_add_lun - probe a LUN, if a LUN is found add it 836 * scsi_probe_and_add_lun - probe a LUN, if a LUN is found add it
@@ -888,9 +911,18 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
888 * logical disk configured at sdev->lun, but there 911 * logical disk configured at sdev->lun, but there
889 * is a target id responding. 912 * is a target id responding.
890 */ 913 */
891 SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO 914 SCSI_LOG_SCAN_BUS(2, sdev_printk(KERN_INFO, sdev, "scsi scan:"
892 "scsi scan: peripheral qualifier of 3," 915 " peripheral qualifier of 3, device not"
893 " no device added\n")); 916 " added\n"))
917 if (lun == 0) {
918 unsigned char vend[9], mod[17];
919 SCSI_LOG_SCAN_BUS(1, sdev_printk(KERN_INFO, sdev,
920 "scsi scan: consider passing scsi_mod."
921 "dev_flags=%s:%s:0x240 or 0x800240\n",
922 scsi_inq_str(vend, result, 8, 16),
923 scsi_inq_str(mod, result, 16, 32)));
924 }
925
894 res = SCSI_SCAN_TARGET_PRESENT; 926 res = SCSI_SCAN_TARGET_PRESENT;
895 goto out_free_result; 927 goto out_free_result;
896 } 928 }