Problem with mounting a device second time.

ali nasir supremenasir at yahoo.com
Wed Apr 18 10:47:11 UTC 2012


Hi,

We are facing some problems with mounting an sdcard the second time after removing the first one, on the RTEMS 4.10.1, for eg if a device /dev/sdc01 is mounted on /mnt/sdcard and we unmount this device, then we cannot mount the same device again. However, if we try to mount /dev/sdc02 on mnt/sdcard, then this works. 

If we try to mount the same device again, the create_phys returns error 12 (RTEMS_RESOURCE_IN_USE). 
Note that this error comes when we have done some write operation on the previously inserted card. If we do not do any write operation on the previous device, then we are able to mount the second card with the same device name (/dev/sdc01)

The unmount of the card is performed using the following calls in the sequence, with the card inserted:
unmount
rmdir
rtems_bdbuf_syncdev
rtems_disk_delete
rtems_bdbuf_purge_dev
rtems_io_unregister_driver
The above sequence is taken from the disk_detach_worker from the media.c file 

Can we use the media manager with the RTEMS 4.10.1 or 4.10.2? Is there an example how to use the media manger? Can the media manager solve the above mentioned problem?

Regards,
Ali




More information about the users mailing list