summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFernando Guzman Lugo <x0095840@ti.com>2010-10-04 22:53:05 -0500
committerRicardo Perez Olivares <x0081762@ti.com>2010-10-06 12:39:55 -0500
commitc9824950995a2c59da5b3e6b744fa38486571553 (patch)
tree3f3562d047e25982da3939da7b716ea14713cec1 /drivers
parent8a1e9fe9c3b25176607794252d520828b4679d0e (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 0e1d09b09d0c..272ea565a993 100644
--- a/drivers/dsp/syslink/devh/44xx/devh44xx.c
+++ b/drivers/dsp/syslink/devh/44xx/devh44xx.c
@@ -45,6 +45,7 @@ struct omap_devh_runtime_info {
int brd_state;
struct iommu *iommu;
struct omap_rproc *rproc;
+ pid_t mgr_pid;
};
enum {
@@ -119,6 +120,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;
@@ -142,6 +146,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;
@@ -165,6 +172,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;
@@ -251,6 +261,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))
@@ -288,6 +299,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))
@@ -325,6 +337,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))