summaryrefslogtreecommitdiff
path: root/nuttx/fs
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-07-29 15:34:31 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-07-29 15:34:31 -0600
commit0ac2ac1d8196c25465a7b63e3f339fc723f7c4cd (patch)
tree27ddc5f0722822b822accc0cebee19505d9ef16a /nuttx/fs
parent42f5d29534eb3199f5d257b8a1c03c3bf26a6996 (diff)
downloadpx4-nuttx-0ac2ac1d8196c25465a7b63e3f339fc723f7c4cd.tar.gz
px4-nuttx-0ac2ac1d8196c25465a7b63e3f339fc723f7c4cd.tar.bz2
px4-nuttx-0ac2ac1d8196c25465a7b63e3f339fc723f7c4cd.zip
SAMA5D4: Add auto-mounter support for HSMCI0
Diffstat (limited to 'nuttx/fs')
-rw-r--r--nuttx/fs/fs_automount.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/nuttx/fs/fs_automount.c b/nuttx/fs/fs_automount.c
index 8a1c44c4e..14b2420fc 100644
--- a/nuttx/fs/fs_automount.c
+++ b/nuttx/fs/fs_automount.c
@@ -199,6 +199,8 @@ static void automount_mount(FAR struct automounter_state_s *priv)
FAR const struct automount_lower_s *lower = priv->lower;
int ret;
+ fvdbg("Mounting %s\n", lower->mountpoint);
+
/* Check if the something is already mounted at the mountpoint. */
ret = automount_findinode(lower->mountpoint);
@@ -274,6 +276,8 @@ static int automount_unmount(FAR struct automounter_state_s *priv)
FAR const struct automount_lower_s *lower = priv->lower;
int ret;
+ fvdbg("Unmounting %s\n", lower->mountpoint);
+
/* Check if the something is already mounted at the mountpoint. */
ret = automount_findinode(lower->mountpoint);
@@ -366,6 +370,7 @@ static void automount_timeout(int argc, uint32_t arg1, ...)
(FAR struct automounter_state_s *)((uintptr_t)arg1);
int ret;
+ fllvdbg("Timeout!\n");
DEBUGASSERT(argc == 1 && priv);
/* Check the state of things. This timeout at the interrupt level and
@@ -379,7 +384,7 @@ static void automount_timeout(int argc, uint32_t arg1, ...)
/* Queue work to occur immediately. */
- ret = work_queue(LPWORK, &priv->work, automount_worker, priv, 0);
+ ret = work_queue(LPWORK, &priv->work, automount_worker, priv, 0);
if (ret < 0)
{
/* NOTE: Currently, work_cancel only returns success */
@@ -565,7 +570,19 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower)
/* Handle the initial state of the mount on the caller's thread */
priv->inserted = AUTOMOUNT_INSERTED(lower);
- automount_worker(priv);
+
+ /* Set up the first action at a delay from the initialization time (to
+ * allow time for any extended block driver initialization to complete.
+ */
+
+ ret = work_queue(LPWORK, &priv->work, automount_worker, priv,
+ priv->lower->ddelay);
+ if (ret < 0)
+ {
+ /* NOTE: Currently, work_cancel only returns success */
+
+ fdbg("ERROR: Failed to schedule work: %d\n", ret);
+ }
/* Attach and enable automounter interrupts */