emmc trim support in P5040 and kernel 3.4

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

emmc trim support in P5040 and kernel 3.4

1,859件の閲覧回数
jerryduan
Contributor I

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

 

ラベル(1)
0 件の賞賛
5 返答(返信)

704件の閲覧回数
jerryduan
Contributor I

BTW, could you tell me if Freescale PowerPC linux tree supports eMMC TRIM? if so, in what SDK version?

0 件の賞賛

704件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

704件の閲覧回数
jerryduan
Contributor I

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

0 件の賞賛

704件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

704件の閲覧回数
jerryduan
Contributor I

Thanks for your information! I fixed it now.

0 件の賞賛