[SCSI] Workaround for disks that report bad optimal transfer length
authorMartin K. Petersen <martin.petersen@oracle.com>
Thu, 25 Apr 2013 01:19:47 +0000 (21:19 -0400)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 24 Jun 2013 20:00:10 +0000 (13:00 -0700)
Not all disks fill out the VPD pages correctly. Add a blacklist flag
that allows us ignore the SBC-3 VPD pages for a given device. The
BLIST_SKIP_VPD_PAGES flag triggers our existing skip_vpd_pages
scsi_device parameter to bypass VPD scanning.

Also blacklist the offending Seagate drive model.

Reported-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/scsi_devinfo.c
drivers/scsi/scsi_scan.c
include/scsi/scsi_devinfo.h

index 43fca9170bf26e7a119e3674965b77b296887e05..f969aca0b54eee3bef3f314bd50226f319b72bfb 100644 (file)
@@ -228,6 +228,7 @@ static struct {
        {"SanDisk", "ImageMate CF-SD1", NULL, BLIST_FORCELUN},
        {"SEAGATE", "ST34555N", "0930", BLIST_NOTQ},    /* Chokes on tagged INQUIRY */
        {"SEAGATE", "ST3390N", "9546", BLIST_NOTQ},
+       {"SEAGATE", "ST900MM0006", NULL, BLIST_SKIP_VPD_PAGES},
        {"SGI", "RAID3", "*", BLIST_SPARSELUN},
        {"SGI", "RAID5", "*", BLIST_SPARSELUN},
        {"SGI", "TP9100", "*", BLIST_REPORTLUN2},
index 852915a08465439e64d61daa7c2c8d830ce74494..307a811376070e38926269c2e4e5a02243bd696d 100644 (file)
@@ -926,6 +926,9 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
 
        sdev->eh_timeout = SCSI_DEFAULT_EH_TIMEOUT;
 
+       if (*bflags & BLIST_SKIP_VPD_PAGES)
+               sdev->skip_vpd_pages = 1;
+
        transport_configure_device(&sdev->sdev_gendev);
 
        if (sdev->host->hostt->slave_configure) {
index cc1f3e786ad71e863bc1fc5d0d3e2e91b884998a..447d2d7466fccbe93f4e75d7773d982f67e22584 100644 (file)
@@ -31,4 +31,5 @@
 #define BLIST_MAX_512          0x800000 /* maximum 512 sector cdb length */
 #define BLIST_ATTACH_PQ3       0x1000000 /* Scan: Attach to PQ3 devices */
 #define BLIST_NO_DIF           0x2000000 /* Disable T10 PI (DIF) */
+#define BLIST_SKIP_VPD_PAGES   0x4000000 /* Ignore SBC-3 VPD pages */
 #endif