ata: ahci: implement SCSI_SYNC_CACHE
authorCaleb Connolly <caleb.connolly@linaro.org>
Wed, 26 Mar 2025 12:24:10 +0000 (13:24 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 10 Apr 2025 20:21:41 +0000 (14:21 -0600)
commit77c13f30b67c1a30b33b4dd4820c5a2528c3a3bb
treea2a8ab8d1fb07ee95140e70875d189342466a3d9
parentffe4e6ab42d2534302be825e49a2d085acf80f30
ata: ahci: implement SCSI_SYNC_CACHE

The SCSI layer now issues a SYNC_CACHE command after every write to
ensure there is no data loss due to a board reset after write.

Implement support for this command and remove the same logic from the
ATA write path to be consistent with other SCSI backends.

Ranges are not supported and the whole cache will be flushed in all
cases.

This was done per iteration in ata_scsiop_read_write(), but it's not
clear why this was the case, calling it once for the entire write ought
to achieve the same result.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
drivers/ata/ahci.c