summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cb6320f)
raw | patch | inline | side by side (parent: cb6320f)
author | Suman Anna <s-anna@ti.com> | |
Wed, 6 Mar 2019 20:16:38 +0000 (14:16 -0600) | ||
committer | Suman Anna <s-anna@ti.com> | |
Sun, 10 Mar 2019 21:33:15 +0000 (16:33 -0500) |
This reverts commit b26210cda63564a7478486faaea713f6ea965633.
The commit b26210cda635 ("remoteproc: Remove depricated crash completion")
has dropped the crash_comp completion variable as it was not needed after
the rproc_trigger_recovery() function was modified to leverage rproc_stop()
and rproc_start() functions in commit 7e83cab824a8 ("remoteproc: Modify
recovery path to use rproc_{start,stop}()"). These new functions execute
only a portion of the previous functions, and break the error recovery
on OMAP remoteproc devices.
Reintroduce the crash completion variable by reverting the above commit
in preparation for reverting the error recovery logic to not use the
rproc_start() and rproc_stop() functions.
Signed-off-by: Suman Anna <s-anna@ti.com>
The commit b26210cda635 ("remoteproc: Remove depricated crash completion")
has dropped the crash_comp completion variable as it was not needed after
the rproc_trigger_recovery() function was modified to leverage rproc_stop()
and rproc_start() functions in commit 7e83cab824a8 ("remoteproc: Modify
recovery path to use rproc_{start,stop}()"). These new functions execute
only a portion of the previous functions, and break the error recovery
on OMAP remoteproc devices.
Reintroduce the crash completion variable by reverting the above commit
in preparation for reverting the error recovery logic to not use the
rproc_start() and rproc_stop() functions.
Signed-off-by: Suman Anna <s-anna@ti.com>
drivers/remoteproc/remoteproc_core.c | patch | blob | history | |
include/linux/remoteproc.h | patch | blob | history |
index 89580b957d66239ecdbde266ea4996c670965a50..76fd36413c565e53c52dfb55f776793c67fe5f61 100644 (file)
rproc_unprepare_subdevices(rproc);
+ /* if in crash state, unlock crash handler */
+ if (rproc->state == RPROC_CRASHED)
+ complete_all(&rproc->crash_comp);
+
rproc->state = RPROC_OFFLINE;
dev_info(dev, "stopped remote processor %s\n", rproc->name);
dev_err(dev, "recovering %s\n", rproc->name);
+ init_completion(&rproc->crash_comp);
+
ret = mutex_lock_interruptible(&rproc->lock);
if (ret)
return ret;
/* generate coredump */
rproc_coredump(rproc);
+ /* wait until there is no more rproc users */
+ wait_for_completion(&rproc->crash_comp);
+
/* load firmware */
ret = request_firmware(&firmware_p, rproc->firmware, dev);
if (ret < 0) {
INIT_LIST_HEAD(&rproc->dump_segments);
INIT_WORK(&rproc->crash_handler, rproc_crash_handler_work);
+ init_completion(&rproc->crash_comp);
rproc->state = RPROC_OFFLINE;
index e0baae1659c2ac3a20753b7db9e652bad99f29bb..ed33b09ff0ce073649c7ef992e6308b0629c2005 100644 (file)
* @index: index of this rproc device
* @crash_handler: workqueue for handling a crash
* @crash_cnt: crash counter
+ * @crash_comp: completion used to sync crash handler and the rproc reload
* @recovery_disabled: flag that state if recovery was disabled
* @max_notifyid: largest allocated notify id.
* @table_ptr: pointer to the resource table in effect
int index;
struct work_struct crash_handler;
unsigned int crash_cnt;
+ struct completion crash_comp;
bool recovery_disabled;
int max_notifyid;
struct resource_table *table_ptr;