usb: device: msc: synchronize cache after writes
Flush disk cache when write command finishes. Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
This commit is contained in:
parent
566c64f0c0
commit
04059ec8a7
|
@ -772,6 +772,11 @@ static void thread_memory_write_done(void)
|
|||
length -= size;
|
||||
csw.DataResidue -= size;
|
||||
|
||||
if (!length) {
|
||||
if (disk_access_ioctl(disk_pdrv, DISK_IOCTL_CTRL_SYNC, NULL)) {
|
||||
LOG_ERR("!! Disk cache sync error !!");
|
||||
}
|
||||
}
|
||||
|
||||
if ((!length) || (stage != MSC_PROCESS_CBW)) {
|
||||
csw.Status = (stage == MSC_ERROR) ? CSW_FAILED : CSW_PASSED;
|
||||
|
|
Loading…
Reference in a new issue