Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297502
b: refs/heads/master
c: 6bc711f
h: refs/heads/master
v: v3
  • Loading branch information
Viresh Kumar authored and Vinod Koul committed Feb 22, 2012
1 parent 69f6338 commit fd8d74f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 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: ff7b05f29fd4db810021d905e2dad95ab4fe2984
refs/heads/master: 6bc711f6bd9dd393e1f9bbae354906affcd02aa5
20 changes: 16 additions & 4 deletions trunk/drivers/dma/dw_dmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,14 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,

mem = sg_phys(sg);
len = sg_dma_len(sg);
mem_width = 2;
if (unlikely(mem & 3 || len & 3))

if (!((mem | len) & 7))
mem_width = 3;
else if (!((mem | len) & 3))
mem_width = 2;
else if (!((mem | len) & 1))
mem_width = 1;
else
mem_width = 0;

slave_sg_todev_fill_desc:
Expand Down Expand Up @@ -807,8 +813,14 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,

mem = sg_phys(sg);
len = sg_dma_len(sg);
mem_width = 2;
if (unlikely(mem & 3 || len & 3))

if (!((mem | len) & 7))
mem_width = 3;
else if (!((mem | len) & 3))
mem_width = 2;
else if (!((mem | len) & 1))
mem_width = 1;
else
mem_width = 0;

slave_sg_fromdev_fill_desc:
Expand Down

0 comments on commit fd8d74f

Please sign in to comment.