Skip to content

Commit ea045fd

Browse files
kawasakiDamien Le Moal
authored andcommitted
ata: libata-scsi: fix SYNCHRONIZE CACHE (16) command failure
SAT SCSI/ATA Translation specification requires SCSI SYNCHRONIZE CACHE (10) and (16) commands both shall be translated to ATA flush command. Also, ZBC Zoned Block Commands specification mandates SYNCHRONIZE CACHE (16) command support. However, libata translates only SYNCHRONIZE CACHE (10). This results in SYNCHRONIZE CACHE (16) command failures on SATA drives and then libata translation does not conform to ZBC. To avoid the failure, add support for SYNCHRONIZE CACHE (16). Signed-off-by: Shin'ichiro Kawasaki <[email protected]> Cc: [email protected] Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
1 parent 015618c commit ea045fd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/ata/libata-scsi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3264,6 +3264,7 @@ static unsigned int ata_scsiop_maint_in(struct ata_scsi_args *args, u8 *rbuf)
32643264
case REPORT_LUNS:
32653265
case REQUEST_SENSE:
32663266
case SYNCHRONIZE_CACHE:
3267+
case SYNCHRONIZE_CACHE_16:
32673268
case REZERO_UNIT:
32683269
case SEEK_6:
32693270
case SEEK_10:
@@ -3922,6 +3923,7 @@ static inline ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev, u8 cmd)
39223923
return ata_scsi_write_same_xlat;
39233924

39243925
case SYNCHRONIZE_CACHE:
3926+
case SYNCHRONIZE_CACHE_16:
39253927
if (ata_try_flush_cache(dev))
39263928
return ata_scsi_flush_xlat;
39273929
break;
@@ -4145,6 +4147,7 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd)
41454147
* turning this into a no-op.
41464148
*/
41474149
case SYNCHRONIZE_CACHE:
4150+
case SYNCHRONIZE_CACHE_16:
41484151
fallthrough;
41494152

41504153
/* no-op's, complete with success */

0 commit comments

Comments
 (0)