SCSI devices like UFS may maintain their own cache to speed up writes, however this is lost on board reset (and may be lost on device removal or reset by OS drivers).
Currently this can be worked around by "waiting for a while" after writing data to disk, but of course this is not an acceptable solution. Ideally U-Boot would have a mechanism to flush caches during board reset, but until that logic is hooked up let's be sure that all writes are actually propagated to the storage device so that we don't lose data on board reset. This is particularly noticeable during capsule updates, since the update file is deleted and the board is reset immediately afterwards which resulted in the same capsule update being applied over and over again. This specifically fixes Qualcomm SDM845 devices with UFS 2.1, but likely all UFS devices that use a cache. --- Caleb Connolly (3): scsi: fix typo in setup_read_ext() scsi: de-dup calls to scsi_setup_write_ext() scsi: sync cache on write drivers/scsi/scsi.c | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) --- base-commit: a383b9bd4d7e430fe7c254297540bae596649dba Caleb Connolly <caleb.conno...@linaro.org>