U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] scsi: ensure writes are flushed to disk
@ 2025-03-25 13:02 Caleb Connolly
  2025-03-25 13:02 ` [PATCH 1/3] scsi: fix typo in setup_read_ext() Caleb Connolly
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Caleb Connolly @ 2025-03-25 13:02 UTC (permalink / raw)
  To: Tom Rini
  Cc: Neil Armstrong, Marek Vasut, Quentin Schulz, u-boot, u-boot-qcom,
	Caleb Connolly

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.connolly@linaro.org>


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-03-25 17:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-25 13:02 [PATCH 0/3] scsi: ensure writes are flushed to disk Caleb Connolly
2025-03-25 13:02 ` [PATCH 1/3] scsi: fix typo in setup_read_ext() Caleb Connolly
2025-03-25 13:25   ` Neil Armstrong
2025-03-25 13:02 ` [PATCH 2/3] scsi: de-dup calls to scsi_setup_write_ext() Caleb Connolly
2025-03-25 13:38   ` Neil Armstrong
2025-03-25 13:45     ` Caleb Connolly
2025-03-25 13:02 ` [PATCH 3/3] scsi: sync cache on write Caleb Connolly
2025-03-25 13:33   ` Neil Armstrong
2025-03-25 13:49     ` Caleb Connolly
2025-03-25 15:18       ` neil.armstrong
2025-03-25 17:57         ` Caleb Connolly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox