summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSubramaniam Chanderashekarapuram <subramaniam.ca@ti.com>2012-06-04 21:46:40 -0500
committerAndy Green <andy.green@linaro.org>2012-09-07 13:05:44 +0800
commit8afa8668c820d2540a072c497d0918ed4e649df7 (patch)
treeb3246f13aeaf004f53e48e8ce9dfb4053e3e1f54 /drivers
parent72a42216472eff5bc73fa3e7cbecc30577b34d99 (diff)
remoteproc: export rproc_error_reporter function
The rproc_error_reporter function is currently being used to report MMU faults and trigger a recovery. This is internal to the remoteproc framework. However, the function can be used to report errors other than just iommu faults, like errors that a remoteproc detects and notifies the remoteproc driver. The rproc_error_reporter function therefore is now exported to allow other clients to report an error. Change-Id: Ib4efd8a70e2ae745afbaaea5bca11f33ba07ad0a Signed-off-by: Subramaniam Chanderashekarapuram <subramaniam.ca@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/remoteproc/remoteproc_core.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 95400bd5b55f..4ed7af76197d 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -250,14 +250,20 @@ static const char *rproc_err_to_string(enum rproc_err type)
*
* This function must be called every time a fatal error is detected
*/
-static void rproc_error_reporter(struct rproc *rproc, enum rproc_err type)
+void rproc_error_reporter(struct rproc *rproc, enum rproc_err type)
{
- struct device *dev = &rproc->dev;
+ struct device *dev;
+
+ if (!rproc) {
+ pr_err("invalid rproc handle\n");
+ return;
+ }
+
+ dev = &rproc->dev;
dev_err(dev, "fatal error #%u detected in %s: error type %s\n",
++rproc->crash_cnt, rproc->name, rproc_err_to_string(type));
-
rproc->state = RPROC_CRASHED;
/*
@@ -266,6 +272,7 @@ static void rproc_error_reporter(struct rproc *rproc, enum rproc_err type)
*/
schedule_work(&rproc->error_handler);
}
+EXPORT_SYMBOL(rproc_error_reporter);
/*
* This is the IOMMU fault handler we register with the IOMMU API