summaryrefslogtreecommitdiff
path: root/drivers
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-20 16:52:25 +0100
commit66454595d98a03d4fe62e1e15ee5b22c9f3975ea (patch)
tree0bd697b805227d9a60d76fd5d28926e4d4e676c8 /drivers
parentc12dd13ccd0da445265961a7764b6d49a332671a (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>
Diffstat (limited to 'drivers')
-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))