Skip to contentSkip to conversation

Doubt on mmc erase command

DISCUSSION Sheetal 2 participants 3 messages Feb 10, 2015 – Oct 13, 2015 MMC, SD and SDIO

lore
Share & tools
lore

Sheetal

author
#0 lore raw

Hello,

I'm trying to send ERASE Command to the emmc by deleting a file on one of the emmc partitions and then doing a sync, But I'm noticing that even this will not issue the erase command to emmc.

I did trace the code on, from where this erase command is issued, but my trace ended at an ioctl call "do_vfs_ioctl()" more specific "SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)" system call definition does a call to do_vfs_ioctl.

Please help me understand how to initiate this from userspace.

#1 lore raw

Hi Sheetal,

Try enabling mmc trace events to check what is the cmd you are getting to confirm erase going through.
You shoud get cmd 35/36/38 if erase is going through in case of emmc.

-Ritesh

Quoted 16 lines · Sheetal

Hello,

I'm trying to send ERASE Command to the emmc by deleting a file on one of the emmc partitions and then doing a sync, But I'm noticing that even this will not issue the erase command to emmc.

I did trace the code on, from where this erase command is issued, but my trace ended at an ioctl call "do_vfs_ioctl()" more specific "SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)" system call definition does a call to do_vfs_ioctl.

Please help me understand how to initiate this from userspace. --
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#2 lore raw

Hello Ritesh Harjani,

Thanks for the info Ritesh, I'll try out your pointer to mmc trace events next time i run into eMMC issue

In the current case, I found out that in case of file deletion, only the file's metadata(such as entry in inode table, inode_bitmap and other filesystem parameters) is freed and it won't invoke the ERASE command seq explicitly(atleast in case of EXT4 it doesn't send ERASE CMD). I think only in case of formatting(mkfs) of the partition or the whole eMMC, ERASE command is issued.

Thanks
Sheetal

Quoted 30 lines · Ritesh Harjani

Hi Sheetal,

Try enabling mmc trace events to check what is the cmd you are getting to confirm erase going through.
You shoud get cmd 35/36/38 if erase is going through in case of emmc.

-Ritesh

Quoted 16 lines · Sheetal

Hello,

I'm trying to send ERASE Command to the emmc by deleting a file on one of the emmc partitions and then doing a sync, But I'm noticing that even this will not issue the erase command to emmc.

I did trace the code on, from where this erase command is issued, but my trace ended at an ioctl call "do_vfs_ioctl()" more specific "SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)" system call definition does a call to do_vfs_ioctl.

Please help me understand how to initiate this from userspace. --
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html