From 17745d4ce57b8454b7082087b48b3e2027fdf5bc Mon Sep 17 00:00:00 2001 From: Fernando Guzman Lugo Date: Fri, 21 Oct 2011 14:09:51 -0500 Subject: remoteproc: disable autosuspend when enter secure mode Secure module reads iommu register in order to avoid modification by malicious code. For that reason iommu can not be turned off during secure play back. Change-Id: I2457f538c2f227dca5e6f44c817e4d0faf147e88 Signed-off-by: Fernando Guzman Lugo --- drivers/remoteproc/remoteproc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/remoteproc') diff --git a/drivers/remoteproc/remoteproc.c b/drivers/remoteproc/remoteproc.c index 680a701..907fc01 100644 --- a/drivers/remoteproc/remoteproc.c +++ b/drivers/remoteproc/remoteproc.c @@ -675,7 +675,8 @@ static void rproc_start(struct rproc *rproc, u64 bootaddr) pm_runtime_set_autosuspend_delay(dev, rproc->sus_timeout); pm_runtime_get_noresume(rproc->dev); pm_runtime_set_active(rproc->dev); - pm_runtime_enable(rproc->dev); + if (!rproc->secure_mode) + pm_runtime_enable(rproc->dev); pm_runtime_mark_last_busy(rproc->dev); pm_runtime_put_autosuspend(rproc->dev); #endif @@ -1340,7 +1341,9 @@ void rproc_put(struct rproc *rproc) */ pm_runtime_get_sync(rproc->dev); pm_runtime_put_noidle(rproc->dev); - pm_runtime_disable(rproc->dev); + if (!rproc->secure_reset) + pm_runtime_disable(rproc->dev); + pm_runtime_set_suspended(rproc->dev); #endif ret = rproc->ops->stop(rproc); -- cgit v1.1 From dc8f85b6b2e637752829caa706f769e53eb9ef73 Mon Sep 17 00:00:00 2001 From: Miguel Vadillo Date: Fri, 21 Oct 2011 15:19:56 -0500 Subject: omap4: remoteproc: wake up clkdm in activate() to access iommu iommu is part of the domain of each remoteproc; wake the domain in activate function as well. This change was missed in: 61a044d436aa1891d08010d027cc3d13ab2cbf0f Change-Id: Ibe4fcfd9664796b7f60ff4f6d122b4af078de627 Signed-off-by: Miguel Vadillo --- drivers/remoteproc/omap_remoteproc.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'drivers/remoteproc') diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index 1e01a33..d86b4b4 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -192,13 +192,23 @@ int omap_rproc_activate(struct omap_device *od) #ifdef CONFIG_REMOTE_PROC_AUTOSUSPEND struct omap_rproc_priv *rpp = rproc->priv; struct iommu *iommu; +#endif + /** + * Domain is in HW SUP thus in hw_auto but + * since remoteproc will be enabled clkdm + * needs to be in sw_sup (Do not let it idle). + */ + if (pdata->clkdm) + clkdm_wakeup(pdata->clkdm); +#ifdef CONFIG_REMOTE_PROC_AUTOSUSPEND if (!rpp->iommu) { iommu = iommu_get(pdata->iommu_name); if (IS_ERR(iommu)) { dev_err(dev, "iommu_get error: %ld\n", PTR_ERR(iommu)); - return PTR_ERR(iommu); + ret = PTR_ERR(iommu); + goto err; } rpp->iommu = iommu; } @@ -207,14 +217,6 @@ int omap_rproc_activate(struct omap_device *od) rpp->mbox = omap_mbox_get(pdata->sus_mbox_name, NULL); #endif - /** - * Domain is in HW SUP thus in hw_auto but - * since remoteproc will be enabled clkdm - * needs to be in sw_sup (Do not let it idle). - */ - if (pdata->clkdm) - clkdm_wakeup(pdata->clkdm); - for (i = 0; i < pdata->timers_cnt; i++) omap_dm_timer_start(timers[i].odt); @@ -226,7 +228,7 @@ int omap_rproc_activate(struct omap_device *od) break; } } - +err: /** * Domain is in force_wkup but since remoteproc * was enabled it is safe now to switch clkdm -- cgit v1.1 From 35973186ff2db2e08bf0f5bd8d67b414be46e480 Mon Sep 17 00:00:00 2001 From: Iliyan Malchev Date: Fri, 21 Oct 2011 15:11:32 -0700 Subject: Revert "omap4: remoteproc: wake up clkdm in activate() to access iommu" This reverts commit dc8f85b6b2e637752829caa706f769e53eb9ef73. --- drivers/remoteproc/omap_remoteproc.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'drivers/remoteproc') diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c index d86b4b4..1e01a33 100644 --- a/drivers/remoteproc/omap_remoteproc.c +++ b/drivers/remoteproc/omap_remoteproc.c @@ -192,23 +192,13 @@ int omap_rproc_activate(struct omap_device *od) #ifdef CONFIG_REMOTE_PROC_AUTOSUSPEND struct omap_rproc_priv *rpp = rproc->priv; struct iommu *iommu; -#endif - /** - * Domain is in HW SUP thus in hw_auto but - * since remoteproc will be enabled clkdm - * needs to be in sw_sup (Do not let it idle). - */ - if (pdata->clkdm) - clkdm_wakeup(pdata->clkdm); -#ifdef CONFIG_REMOTE_PROC_AUTOSUSPEND if (!rpp->iommu) { iommu = iommu_get(pdata->iommu_name); if (IS_ERR(iommu)) { dev_err(dev, "iommu_get error: %ld\n", PTR_ERR(iommu)); - ret = PTR_ERR(iommu); - goto err; + return PTR_ERR(iommu); } rpp->iommu = iommu; } @@ -217,6 +207,14 @@ int omap_rproc_activate(struct omap_device *od) rpp->mbox = omap_mbox_get(pdata->sus_mbox_name, NULL); #endif + /** + * Domain is in HW SUP thus in hw_auto but + * since remoteproc will be enabled clkdm + * needs to be in sw_sup (Do not let it idle). + */ + if (pdata->clkdm) + clkdm_wakeup(pdata->clkdm); + for (i = 0; i < pdata->timers_cnt; i++) omap_dm_timer_start(timers[i].odt); @@ -228,7 +226,7 @@ int omap_rproc_activate(struct omap_device *od) break; } } -err: + /** * Domain is in force_wkup but since remoteproc * was enabled it is safe now to switch clkdm -- cgit v1.1