Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] Disable DIF on Hitachi Ultrastar 15K300

Hitachi Ultrastar 15K300 is quirky. Disable T10 PI (DIF).

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

authored by

Martin K. Petersen and committed by
James Bottomley
d974e426 8172499a

+9
+1
drivers/scsi/scsi_devinfo.c
··· 172 172 {"HITACHI", "DF400", "*", BLIST_REPORTLUN2}, 173 173 {"HITACHI", "DF500", "*", BLIST_REPORTLUN2}, 174 174 {"HITACHI", "DISK-SUBSYSTEM", "*", BLIST_REPORTLUN2}, 175 + {"HITACHI", "HUS1530", "*", BLIST_NO_DIF}, 175 176 {"HITACHI", "OPEN-", "*", BLIST_REPORTLUN2}, 176 177 {"HITACHI", "OP-C-", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, 177 178 {"HITACHI", "3380-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
+3
drivers/scsi/scsi_scan.c
··· 911 911 if (*bflags & BLIST_RETRY_HWERROR) 912 912 sdev->retry_hwerror = 1; 913 913 914 + if (*bflags & BLIST_NO_DIF) 915 + sdev->no_dif = 1; 916 + 914 917 transport_configure_device(&sdev->sdev_gendev); 915 918 916 919 if (sdev->host->hostt->slave_configure) {
+4
include/scsi/scsi_device.h
··· 156 156 unsigned is_visible:1; /* is the device visible in sysfs */ 157 157 unsigned can_power_off:1; /* Device supports runtime power off */ 158 158 unsigned wce_default_on:1; /* Cache is ON by default */ 159 + unsigned no_dif:1; /* T10 PI (DIF) should be disabled */ 159 160 160 161 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ 161 162 struct list_head event_list; /* asserted events */ ··· 477 476 478 477 static inline int scsi_device_protection(struct scsi_device *sdev) 479 478 { 479 + if (sdev->no_dif) 480 + return 0; 481 + 480 482 return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); 481 483 } 482 484
+1
include/scsi/scsi_devinfo.h
··· 30 30 #define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */ 31 31 #define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */ 32 32 #define BLIST_ATTACH_PQ3 0x1000000 /* Scan: Attach to PQ3 devices */ 33 + #define BLIST_NO_DIF 0x2000000 /* Disable T10 PI (DIF) */ 33 34 #endif