Commit 57a1abd1 authored by Simon Que's avatar Simon Que Committed by Hari Kanigeri

Subject: SYSLINK fixes for shutdown stage

This patch fixes the setup/destroy of several modules to make
the cleanup stage run to completion.
Signed-off-by: default avatarSimon Que <sque@ti.com>
parent 07ec96af
...@@ -445,7 +445,7 @@ int messageq_destroy(void) ...@@ -445,7 +445,7 @@ int messageq_destroy(void)
if (!(atomic_dec_return(&messageq_state.ref_count) if (!(atomic_dec_return(&messageq_state.ref_count)
== MESSAGEQ_MAKE_MAGICSTAMP(0))) { == MESSAGEQ_MAKE_MAGICSTAMP(0))) {
status = -EBUSY; status = 1;
goto exit; goto exit;
} }
......
...@@ -285,6 +285,12 @@ int nameserver_destroy(void) ...@@ -285,6 +285,12 @@ int nameserver_destroy(void)
goto exit; goto exit;
} }
if (!(atomic_dec_return(&nameserver_state.ref_count)
== NAMESERVER_MAKE_MAGICSTAMP(0))) {
retval = 1;
goto exit;
}
if (WARN_ON(nameserver_state.list_lock == NULL)) { if (WARN_ON(nameserver_state.list_lock == NULL)) {
retval = -ENODEV; retval = -ENODEV;
goto exit; goto exit;
...@@ -296,12 +302,6 @@ int nameserver_destroy(void) ...@@ -296,12 +302,6 @@ int nameserver_destroy(void)
goto exit; goto exit;
} }
if (!(atomic_dec_return(&nameserver_state.ref_count)
== NAMESERVER_MAKE_MAGICSTAMP(0))) {
retval = -EBUSY;
goto exit;
}
retval = mutex_lock_interruptible(nameserver_state.list_lock); retval = mutex_lock_interruptible(nameserver_state.list_lock);
if (retval) if (retval)
goto exit; goto exit;
......
...@@ -185,7 +185,7 @@ int sharedregion_destroy(void) ...@@ -185,7 +185,7 @@ int sharedregion_destroy(void)
if (!(atomic_dec_return(&sharedregion_state.ref_count) if (!(atomic_dec_return(&sharedregion_state.ref_count)
== SHAREDREGION_MAKE_MAGICSTAMP(0))) { == SHAREDREGION_MAKE_MAGICSTAMP(0))) {
retval = -EBUSY; /* Syslink is not handling this on 2.0.0.06 */ retval = 1; /* Syslink is not handling this on 2.0.0.06 */
goto error; goto error;
} }
......
...@@ -578,8 +578,11 @@ s32 sysmgr_destroy(void) ...@@ -578,8 +578,11 @@ s32 sysmgr_destroy(void)
} }
if (atomic_dec_return(&sysmgr_state.ref_count) if (atomic_dec_return(&sysmgr_state.ref_count)
== SYSMGR_MAKE_MAGICSTAMP(0)) != SYSMGR_MAKE_MAGICSTAMP(0))
goto exit; {
status = 1;
goto exit;
}
/* Finalize Platform module*/ /* Finalize Platform module*/
if (sysmgr_state.platform_init_flag == true) { if (sysmgr_state.platform_init_flag == true) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment