summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFernando Guzman Lugo <x0095840@ti.com>2010-10-04 22:53:05 -0500
committerSebastien Jan <s-jan@ti.com>2011-12-19 14:03:27 +0100
commit8004cdeaef313a983ab048b70e067239b6df0a51 (patch)
tree0ac965fb9b5c68ef06e6d8570fbd154e37f9d4f4
parentd82c61b602cb1c4deeb6bdec20ec0af28ae01142 (diff)
syslink: devh - call rproc_stop if IOMMUCLOSE is received
If syslink_daemon releases the handle to iommu before calling to rproc_stop (if the process is killed we don't control the order in which the handels are released) that could cause mmufaults on remote processor side. This patch fixes that issue. Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com> Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com>
-rw-r--r--drivers/dsp/syslink/devh/44xx/devh44xx.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/dsp/syslink/devh/44xx/devh44xx.c b/drivers/dsp/syslink/devh/44xx/devh44xx.c
index 92ead7d71f72..c3cf971671b4 100644
--- a/drivers/dsp/syslink/devh/44xx/devh44xx.c
+++ b/drivers/dsp/syslink/devh/44xx/devh44xx.c
@@ -48,6 +48,7 @@ struct omap_devh_runtime_info {
int brd_state;
struct iommu *iommu;
struct omap_rproc *rproc;
+ pid_t mgr_pid;
};
enum {
@@ -157,6 +158,9 @@ static int devh44xx_sysm3_iommu_notifier_call(struct notifier_block *nb,
switch ((int)val) {
case IOMMU_CLOSE:
+ if (pinfo->rproc->state != OMAP_RPROC_STOPPED
+ && pinfo->mgr_pid == current->tgid)
+ rproc_stop(pinfo->rproc);
return devh44xx_notifier_call(nb, val, v, pdata);
case IOMMU_FAULT:
pinfo->brd_state = DEVH_BRDST_ERROR;
@@ -180,6 +184,9 @@ static int devh44xx_appm3_iommu_notifier_call(struct notifier_block *nb,
switch ((int)val) {
case IOMMU_CLOSE:
+ if (pinfo->rproc->state != OMAP_RPROC_STOPPED
+ && pinfo->mgr_pid == current->tgid)
+ rproc_stop(pinfo->rproc);
return devh44xx_notifier_call(nb, val, v, pdata);
case IOMMU_FAULT:
pinfo->brd_state = DEVH_BRDST_ERROR;
@@ -203,6 +210,9 @@ static int devh44xx_tesla_iommu_notifier_call(struct notifier_block *nb,
switch ((int)val) {
case IOMMU_CLOSE:
+ if (pinfo->rproc->state != OMAP_RPROC_STOPPED
+ && pinfo->mgr_pid == current->tgid)
+ rproc_stop(pinfo->rproc);
return devh44xx_notifier_call(nb, val, v, pdata);
case IOMMU_FAULT:
pinfo->brd_state = DEVH_BRDST_ERROR;
@@ -407,6 +417,7 @@ static int devh44xx_sysm3_rproc_notifier_call(struct notifier_block *nb,
switch ((int)val) {
case OMAP_RPROC_START:
pinfo->brd_state = DEVH_BRDST_RUNNING;
+ pinfo->mgr_pid = current->tgid;
pinfo->iommu = iommu_get("ducati");
if (pinfo->iommu != ERR_PTR(-ENODEV) &&
pinfo->iommu != ERR_PTR(-EINVAL))
@@ -444,6 +455,7 @@ static int devh44xx_appm3_rproc_notifier_call(struct notifier_block *nb,
switch ((int)val) {
case OMAP_RPROC_START:
pinfo->brd_state = DEVH_BRDST_RUNNING;
+ pinfo->mgr_pid = current->tgid;
pinfo->iommu = iommu_get("ducati");
if (pinfo->iommu != ERR_PTR(-ENODEV) &&
pinfo->iommu != ERR_PTR(-EINVAL))
@@ -481,6 +493,7 @@ static int devh44xx_tesla_rproc_notifier_call(struct notifier_block *nb,
switch ((int)val) {
case OMAP_RPROC_START:
pinfo->brd_state = DEVH_BRDST_RUNNING;
+ pinfo->mgr_pid = current->tgid;
pinfo->iommu = iommu_get("tesla");
if (pinfo->iommu != ERR_PTR(-ENODEV) &&
pinfo->iommu != ERR_PTR(-EINVAL))