Hi,
I am using P5040 (eSDHC vendor version is 0x13)and linux 3.4 for our project. When I test the TRIM feature, I got the following:
$fstrim /mnt/mymmc/
fstrim: /mnt/mymmc/: FITRIM ioctl failed: Operation not supported
$cat /sys/class/block/mmc/queue/discard_max_bytes
0
But, I am using a Micron eMMC 4.41 chip, I believe that it supports TRIM. Since kernel upgrade is not an option for our project, just wonder if there is any simple patch I can apply to enable my eMMC trim.
Thanks for helping me out.
Jerry
BTW, could you tell me if Freescale PowerPC linux tree supports eMMC TRIM? if so, in what SDK version?
Hello Jerry,
I verified Linux SDK 1.4 Kernel(3.8 the most nearest version of yours) image with ext4 support enabled, emmc trim is supported, please refer to my log.
root@p5020ds:~# uname -a
Linux p5020ds 3.8.13-rt9-QorIQ-SDK-V1.4 #1 SMP Wed Oct 29 14:04:13 CST 2014 ppc GNU/Linux
root@p5020ds:~# fstrim /media/mmcblk0
root@p5020ds:~# cat /sys/class/block/mmcblk0/queue/discard_max_bytes
197132288
root@p5020ds:~#
eMMC TRIM is already been included in the early Kernel , please refer to the attached patch, I also attached SDK 1.4 MMC driver, please differ with yours.
Have a great day,
Yiping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Yiping,
Thanks for your reply! May I ask if it is a SD or eMMC device when you test in your P5020ds. If It is a eMMC, could you tell me its cid, csd and ext_csd? After some googling, it seems that depending on your particular eMMC device from different chip vendor, the current linux mmc sub-system may or may not support trim for it.
Regards,
Jerry
FYI. https://www.mail-archive.com/linux-mmc%40vger.kernel.org/msg23643.html
Hello Jerry,
I used a SD card, I don't have eMMC cards on my side.
I also suspect this is a hardware compatible problem, I search for SDK 1.4 Linux Kernel git tree and find the attached patch, probably it could be helpful for you.
In addition, it's better to use ext4 file system in your verification, which fully supports discard.
Have a great day,
Yiping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks for your information! I fixed it now.