sd: add proper handling for DISK_IOCTL_CTRL_SYNC

Add handling for DISK_IOCTL_CTRL_SYNC to SD subsystem. Note that
SD caching is not enabled by the SD stack, so the only required
operation to sync the disk is to wait for any active data programming
to complete.

Fixes #46689

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
Daniel DeGrasse 2022-06-27 10:38:47 -05:00 committed by Fabio Baltieri
parent 71d1b277cb
commit fdefd873fc

View file

@ -1501,6 +1501,12 @@ int sdmmc_ioctl(struct sd_card *card, uint8_t cmd, void *buf)
case DISK_IOCTL_GET_ERASE_BLOCK_SZ:
(*(uint32_t *)buf) = card->block_size;
break;
case DISK_IOCTL_CTRL_SYNC:
/* Ensure card is not busy with data write.
* Note that SD stack does not support enabling caching, so
* cache flush is not required here
*/
return sdmmc_wait_ready(card);
default:
return -ENOTSUP;
}