mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-16 17:58:23 +00:00
nvme: Enable FUA
Most NVME devcies maintain data in internal cache for an uncertain times, and u-boot has no method to force NVME to flush cache. So this patch adds FUA to avoid data loss caused by power off after data programming. Signed-off-by: Jon Lin <jon.lin@rock-chips.com> Reviewed-by: Stefan Agner <stefan@agner.ch>
This commit is contained in:
parent
4f2e228086
commit
b6bfb8971d
1 changed files with 4 additions and 0 deletions
|
@ -762,6 +762,10 @@ static ulong nvme_blk_rw(struct udevice *udev, lbaint_t blknr,
|
|||
c.rw.appmask = 0;
|
||||
c.rw.metadata = 0;
|
||||
|
||||
/* Enable FUA for data integrity if vwc is enabled */
|
||||
if (dev->vwc)
|
||||
c.rw.control |= NVME_RW_FUA;
|
||||
|
||||
while (total_lbas) {
|
||||
if (total_lbas < lbas) {
|
||||
lbas = (u16)total_lbas;
|
||||
|
|
Loading…
Reference in a new issue