aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMiguel Vadillo <vadillo@ti.com>2011-10-17 19:19:17 -0500
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-05-10 23:40:43 +0200
commitfff3bc4c6250a4062458667b6c5aba794ea966c1 (patch)
tree11a4fda8cae08e705db18f307f5a9ae446be92f2 /arch
parent84b3179ead3d5fab5b5bb7db391d7232618f73e7 (diff)
downloadkernel_samsung_tuna-fff3bc4c6250a4062458667b6c5aba794ea966c1.zip
kernel_samsung_tuna-fff3bc4c6250a4062458667b6c5aba794ea966c1.tar.gz
kernel_samsung_tuna-fff3bc4c6250a4062458667b6c5aba794ea966c1.tar.bz2
omap: remoteproc: add a notification for loading error
When calling rproc_get for the first time, the loading of the remoteproc image will be requested using a non-blocking request_firmware_no_wait, and the caller can continue before the actual loading is complete. The loader later can return an error due to a non-existing or wrong image and there should be a way to notify about this to users having a rproc handle. This functionality is added and is leveraged by rpmsg to release some resources it had already acquired since requesting a firmware load. Change-Id: I1d3523efbcfd613bca74d363084791ceaaaa9989 Signed-off-by: Miguel Vadillo <vadillo@ti.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-omap/omap_rpmsg.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/omap_rpmsg.c b/arch/arm/plat-omap/omap_rpmsg.c
index f4bc0ea..ec861f5 100644
--- a/arch/arm/plat-omap/omap_rpmsg.c
+++ b/arch/arm/plat-omap/omap_rpmsg.c
@@ -257,6 +257,18 @@ static int rpmsg_rproc_pos_suspend(struct omap_rpmsg_vproc *rpdev)
return NOTIFY_DONE;
}
+static int rpmsg_rproc_load_error(struct omap_rpmsg_vproc *rpdev)
+{
+ mutex_lock(&rpdev->lock);
+ if (rpdev->mbox) {
+ omap_mbox_put(rpdev->mbox, &rpdev->nb);
+ rpdev->mbox = NULL;
+ }
+ mutex_unlock(&rpdev->lock);
+
+ return NOTIFY_DONE;
+}
+
static int rpmsg_rproc_resume(struct omap_rpmsg_vproc *rpdev)
{
mutex_lock(&rpdev->lock);
@@ -290,6 +302,8 @@ static int rpmsg_rproc_events(struct notifier_block *this,
return rpmsg_rproc_suspend(rpdev);
case RPROC_POS_SUSPEND:
return rpmsg_rproc_pos_suspend(rpdev);
+ case RPROC_LOAD_ERROR:
+ return rpmsg_rproc_load_error(rpdev);
case RPROC_RESUME:
return rpmsg_rproc_resume(rpdev);
case RPROC_SECURE: