Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173322
b: refs/heads/master
c: cc93fc3
h: refs/heads/master
v: v3
  • Loading branch information
Sandeep Paulraj authored and Kevin Hilman committed Nov 25, 2009
1 parent f92bb72 commit 65eeb32
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 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: dc4c05a5131d691ccbc06c2e670385127871bdbe
refs/heads/master: cc93fc3f34552e791e480ac21a17eceb9c0e26f2
32 changes: 24 additions & 8 deletions trunk/arch/arm/mach-davinci/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,17 +515,30 @@ static int reserve_contiguous_params(int ctlr, unsigned int id,
{
int i, j;
unsigned int count = num_params;
int stop_param = start_param;
DECLARE_BITMAP(tmp_inuse, EDMA_MAX_PARAMENTRY);

for (i = start_param; i < edma_info[ctlr]->num_slots; ++i) {
j = EDMA_CHAN_SLOT(i);
if (!test_and_set_bit(j, edma_info[ctlr]->edma_inuse))
if (!test_and_set_bit(j, edma_info[ctlr]->edma_inuse)) {
/* Record our current beginning slot */
if (count == num_params)
stop_param = i;

count--;
set_bit(j, tmp_inuse);

if (count == 0)
break;
else if (id == EDMA_CONT_PARAMS_FIXED_EXACT)
break;
else
count = num_params;
} else {
clear_bit(j, tmp_inuse);

if (id == EDMA_CONT_PARAMS_FIXED_EXACT) {
stop_param = i;
break;
} else
count = num_params;
}
}

/*
Expand All @@ -534,12 +547,15 @@ static int reserve_contiguous_params(int ctlr, unsigned int id,
* of contiguous parameter RAMs but do not find the exact number
* requested as we may reach the total number of parameter RAMs
*/
if (count) {
for (j = i - num_params + count + 1; j <= i ; ++j)
if (i == edma_info[ctlr]->num_slots)
stop_param = i;

for (j = start_param; j < stop_param; j++)
if (test_bit(j, tmp_inuse))
clear_bit(j, edma_info[ctlr]->edma_inuse);

if (count)
return -EBUSY;
}

for (j = i - num_params + 1; j <= i; ++j)
memcpy_toio(edmacc_regs_base[ctlr] + PARM_OFFSET(j),
Expand Down

0 comments on commit 65eeb32

Please sign in to comment.