ata: libata-scsi: fix SYNCHRONIZE CACHE (16) command failure
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 7 Nov 2022 04:02:29 +0000 (13:02 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 08:57:16 +0000 (09:57 +0100)
commit344ddbd688d869aff2831e1345755d1b163000f4
tree7d5c67b16e5cec14735c9ef0f09a94e14c502cc6
parent516f9f23008b1e3033df7944f5d616b95076acd3
ata: libata-scsi: fix SYNCHRONIZE CACHE (16) command failure

commit ea045fd344cb15c164e9ffc8b8cffb6883df8475 upstream.

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 <shinichiro.kawasaki@wdc.com>
Cc: stable@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ata/libata-scsi.c