diff options
-rw-r--r-- | drivers/dsp/syslink/devh/44xx/devh44xx.c | 13 |
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)) |