Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236512
b: refs/heads/master
c: ab42abf
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Contreras authored and Greg Kroah-Hartman committed Mar 14, 2011
1 parent 7dd89c8 commit fb06b33
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 17e2a542032f3ab735352d1d4b5d2ca3c154158a
refs/heads/master: ab42abf33a3efdf754710a0a513c00c40854cd61
19 changes: 14 additions & 5 deletions trunk/drivers/staging/tidspbridge/rmgr/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,12 +779,14 @@ int proc_begin_dma(void *hprocessor, void *pmpu_addr, u32 ul_size,
(u32)pmpu_addr,
ul_size, dir);

mutex_lock(&proc_lock);

/* find requested memory are in cached mapping information */
map_obj = find_containing_mapping(pr_ctxt, (u32) pmpu_addr, ul_size);
if (!map_obj) {
pr_err("%s: find_containing_mapping failed\n", __func__);
status = -EFAULT;
goto err_out;
goto no_map;
}

if (memory_give_ownership(map_obj, (u32) pmpu_addr, ul_size, dir)) {
Expand All @@ -793,6 +795,8 @@ int proc_begin_dma(void *hprocessor, void *pmpu_addr, u32 ul_size,
status = -EFAULT;
}

no_map:
mutex_unlock(&proc_lock);
err_out:

return status;
Expand All @@ -817,21 +821,24 @@ int proc_end_dma(void *hprocessor, void *pmpu_addr, u32 ul_size,
(u32)pmpu_addr,
ul_size, dir);

mutex_lock(&proc_lock);

/* find requested memory are in cached mapping information */
map_obj = find_containing_mapping(pr_ctxt, (u32) pmpu_addr, ul_size);
if (!map_obj) {
pr_err("%s: find_containing_mapping failed\n", __func__);
status = -EFAULT;
goto err_out;
goto no_map;
}

if (memory_regain_ownership(map_obj, (u32) pmpu_addr, ul_size, dir)) {
pr_err("%s: InValid address parameters %p %x\n",
__func__, pmpu_addr, ul_size);
status = -EFAULT;
goto err_out;
}

no_map:
mutex_unlock(&proc_lock);
err_out:
return status;
}
Expand Down Expand Up @@ -1724,9 +1731,8 @@ int proc_un_map(void *hprocessor, void *map_addr,
(p_proc_object->bridge_context, va_align, size_align);
}

mutex_unlock(&proc_lock);
if (status)
goto func_end;
goto unmap_failed;

/*
* A successful unmap should be followed by removal of map_obj
Expand All @@ -1735,6 +1741,9 @@ int proc_un_map(void *hprocessor, void *map_addr,
*/
remove_mapping_information(pr_ctxt, (u32) map_addr, size_align);

unmap_failed:
mutex_unlock(&proc_lock);

func_end:
dev_dbg(bridge, "%s: hprocessor: 0x%p map_addr: 0x%p status: 0x%x\n",
__func__, hprocessor, map_addr, status);
Expand Down

0 comments on commit fb06b33

Please sign in to comment.