aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sd.h
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2013-06-06 22:15:55 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-25 17:07:30 -0400
commit98dcc2946adbe4349ef1ef9b99873b912831edd4 (patch)
tree2b4a51a862e10f4cedc54c36d779e9ccfe69f962 /drivers/scsi/sd.h
parent64ea2992a29aa0bdc4eaf457351b063caafb6655 (diff)
SCSI: sd: Update WRITE SAME heuristics
commit 66c28f97120e8a621afd5aa7a31c4b85c547d33d upstream. SATA drives located behind a SAS controller would incorrectly receive WRITE SAME commands. Tweak the heuristics so that: - If REPORT SUPPORTED OPERATION CODES is provided we will use that to choose between WRITE SAME(16), WRITE SAME(10) and disabled. This also fixes an issue with the old code which would issue WRITE SAME(10) despite the command not being whitelisted in REPORT SUPPORTED OPERATION CODES. - If REPORT SUPPORTED OPERATION CODES is not provided we will fall back to WRITE SAME(10) unless the device has an ATA Information VPD page. The assumption is that a SATL which is smart enough to implement WRITE SAME would also provide REPORT SUPPORTED OPERATION CODES. To facilitate the new heuristics scsi_report_opcode() has been modified to so we can distinguish between "operation not supported" and "RSOC not supported". Reported-by: H. Peter Anvin <hpa@zytor.com> Tested-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/scsi/sd.h')
-rw-r--r--drivers/scsi/sd.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h
index 2386aeb41fe8..7a049de22051 100644
--- a/drivers/scsi/sd.h
+++ b/drivers/scsi/sd.h
@@ -84,6 +84,7 @@ struct scsi_disk {
84 unsigned lbpws : 1; 84 unsigned lbpws : 1;
85 unsigned lbpws10 : 1; 85 unsigned lbpws10 : 1;
86 unsigned lbpvpd : 1; 86 unsigned lbpvpd : 1;
87 unsigned ws10 : 1;
87 unsigned ws16 : 1; 88 unsigned ws16 : 1;
88}; 89};
89#define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev) 90#define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev)