Problem with SD card unmount with rtems 4.10.99

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Apr 7 09:26:45 UTC 2014


Hello Ali,

On 2014-04-07 05:15, ali nasir wrote:
> Hi,
>
> I am facing a problem during the SDcard unmount with the rtems 4.10.99 (GIT
> HEAD). Following sequence is performed during the mount:
> 1. rtems_io_register_driver .This returns the major number of the device
> 2. Then create a device (dev) using the call to rtems_filesystem_make_dev_t
> 3. rtems_disk_io_initialize
> 4. rtems_disk_create_phys is then called with the device (dev) returned from
> above call to rtems_filesystem_make_dev_t and the name as /dev/sdc0
> 5. rtems_bdpart_register_from_disk("/dev/sdc0")
> 6. rtems_fsmount. The rtems_fstab_entry has two entries. one for the partition
> (/dev/sdc01) and the other as /dev/sdc0
> The above sequence is succesfull.
> The unmount sequence is as follows:
> 1. unmount("/mnt/sdcard")
> 2. rmdir("/mnt/sdcard")
> 3. Call the rtems_media_get_device_identifier("/dev/sdc01", &dev) to get the
> dev. Note that here we start with the first partition
> 4. Call rtems_disk_obtain(dev) to get the disk_device pointer.
> 5. rtems_bdbuf_syncdev is then called. The pointer returned by disk_obtain is
> passed here.
> But at this point, i notice that the rtems_disk_obtain returns a NULL pointer
> and the syncdev crashes. I also see that the dev returned from the call to
> rtems_media_get_device_identifier does not seem to be correct. It does not give
> me the correct major number.
> This sequence used to work with the rtems4.10.2. The only difference was that
> in 4.10.2, the syncdev used to take the 'dev' itself as the argument. In
> 4.10.2, if this partition was not correctly removed, then all further SD card
> mount failed and needed a system reset for further mounts.
>
> What is the correct sequence to unmount an existing single partition SDcard
> with the latest RTEMS?Note that it used to work correct with the 4.10.2
> I see that there is a media manager also in place? Any example on how to use
> the media manager?

on RTEMS 4.11 it is enough to call unmount(mount_path) and optionally the 
rmdir(mount_path).

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list