Skip to content

Commit 726b8b8

Browse files
danieldegrassePeter Tönz
authored andcommitted
[sg fromtree] 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 zephyrproject-rtos#46689 Signed-off-by: Daniel DeGrasse <[email protected]> (cherry picked from commit fdefd87)
1 parent bd1c0b0 commit 726b8b8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

subsys/sd/sdmmc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,12 @@ int sdmmc_ioctl(struct sd_card *card, uint8_t cmd, void *buf)
15141514
case DISK_IOCTL_GET_ERASE_BLOCK_SZ:
15151515
(*(uint32_t *)buf) = card->block_size;
15161516
break;
1517+
case DISK_IOCTL_CTRL_SYNC:
1518+
/* Ensure card is not busy with data write.
1519+
* Note that SD stack does not support enabling caching, so
1520+
* cache flush is not required here
1521+
*/
1522+
return sdmmc_wait_ready(card);
15171523
default:
15181524
return -ENOTSUP;
15191525
}

0 commit comments

Comments
 (0)