Imx7 removable media swapped in /dev on initial boot if left in

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Imx7 removable media swapped in /dev on initial boot if left in

506 Views
edwardtyrrell
Senior Contributor I

Hi,

I have a difficult problem with removable media that if inserted ( sdcard ) on initial boot-up then from that point on the /dev/mmcblk* are swapped forever. This causes multiple problems:

1) Removable mounting issues, files on the card cannot be seen

2) When an ls is done on the mount path, I see the kernel and device tree!

3) User level operations depend on the correct /dev/mmc* path, hence they fail

On initial boot we normally leave the removable media out ( sdcard ), then everything is fine after that. The sdcard is seen as removable media. Left in the problem above occurs every time. 

More concerning is over-the-air kernel updates, if the customer has the card in while doing a kernel update then on the next boot this problem occurs. I'm guessing it's rebuild udev or something.  

I'm assuming this problem may be in my device tree or the ordering of discovery, at the moment the associated usdhc structure is set with - removable, enable-sdio-wakeup and keep-power-in-suspend

Kernel is Yocto Krogoth 4.1.32 

Thanks.

0 Kudos
Reply
2 Replies

383 Views
b36401
NXP Employee
NXP Employee

You can create a script that finds actual entry for the card and makes a symlink to /dev/mmcblkX. And you can point this symlink as a device to mount in the fstab.

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

383 Views
edwardtyrrell
Senior Contributor I

Hi,

Thanks for your reply but unfortunately it's not that simple. When this issue occurs e.g. flashed and on initial boot with card inserted the /dev/mmc* always remains. To clarify the board has nand flash and the removable sdcard is for a files, music, samba etc. What's worse is card's supposed /dev/mmc* now permanently point to my kernel and dtb objects. The /dev/mmc* I want should be removable, appear and disappear from /dev/ with card insertion - it's not.

&usdhc2 {

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_usdhc2>;
cd-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
wp-gpios = <&gpio5 10 GPIO_ACTIVE_HIGH>;
bus-width = <4>;

removable;

enable-sdio-wakeup;

keep-power-in-suspend;

status = "okay";

};

0 Kudos
Reply